Improvement: allow multi config file support

This commit is contained in:
Laurent Clouet
2018-12-18 22:53:01 +01:00
parent dba0b9160b
commit 39b9830879
4 changed files with 26 additions and 16 deletions

View File

@@ -97,7 +97,7 @@ public class Settings implements Activity {
@Override
public void show() {
Configuration config = parent.getConfiguration();
new SettingsLoader().merge(config);
new SettingsLoader(config.getConfigFilePath()).merge(config);
List<GPUDevice> gpus = GPU.listDevices(config);
@@ -617,14 +617,7 @@ public class Settings implements Activity {
}
if (saveFile.isSelected()) {
new SettingsLoader(login.getText(), new String(password.getPassword()), proxyText, hostnameText, method, selected_gpu, cpu_cores, max_ram, max_rendertime, cachePath, autoSignIn.isSelected(), GuiSwing.type, tile, priority.getValue()).saveFile();
}
else {
try {
new File(new SettingsLoader().getFilePath()).delete();
}
catch (SecurityException e3) {
}
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, tile, priority.getValue()).saveFile();
}
}
}