Save config file

This commit is contained in:
Laurent Clouet
2019-09-15 21:34:16 +02:00
parent 56239ae6dd
commit 7b693a8f36
3 changed files with 12 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ import com.sheepit.client.datamodel.HeartBeatInfos;
import com.sheepit.client.datamodel.JobInfos;
import com.sheepit.client.datamodel.JobValidation;
import com.sheepit.client.datamodel.ServerConfig;
import lombok.Getter;
import org.simpleframework.xml.core.Persister;
import com.sheepit.client.Configuration.ComputeType;
@@ -81,7 +82,10 @@ import com.sheepit.client.os.OS;
public class Server extends Thread implements HostnameVerifier, X509TrustManager {
private String base_url;
@Getter
private ServerConfig serverConfig;
private Configuration user_config;
private Client client;
private Log log;

View File

@@ -49,6 +49,7 @@ import com.sheepit.client.SettingsLoader;
import com.sheepit.client.Stats;
import com.sheepit.client.standalone.swing.activity.Settings;
import com.sheepit.client.standalone.swing.activity.Working;
import lombok.Getter;
import lombok.Setter;
public class GuiSwing extends JFrame implements Gui {
@@ -71,6 +72,7 @@ public class GuiSwing extends JFrame implements Gui {
private boolean waitingForAuthentication;
private Client client;
@Getter
@Setter
private SettingsLoader settingsLoader;

View File

@@ -551,6 +551,12 @@ public class Settings implements Activity {
if (saveFile.isSelected()) {
parent.setSettingsLoader(new SettingsLoader(config.getConfigFilePath(), login.getText(), new String(password.getPassword()), proxyText, hostnameText, method, selected_gpu, cpu_cores, max_ram, max_rendertime, cachePath, autoSignIn.isSelected(), GuiSwing.type, priority.getValue()));
// wait for successful authentication (to store the public key)
// or do we already have one?
if (parent.getClient().getServer().getServerConfig() != null && parent.getClient().getServer().getServerConfig().getPublickey() != null) {
parent.getSettingsLoader().saveFile();
}
}
}
}