Import config from file

This commit is contained in:
Laurent Clouet
2015-04-07 20:07:53 +01:00
parent d07fe1b9fc
commit 34957be7a8
2 changed files with 22 additions and 4 deletions

View File

@@ -24,11 +24,15 @@ public class SettingsLoader {
private String autoSignIn;
public SettingsLoader() {
generateFilePath();
path = getDefaultFilePath();
}
public SettingsLoader(String path_) {
path = path_;
}
public SettingsLoader(String login_, String password_, ComputeType computeMethod_, GPUDevice gpu_, String cacheDir_, boolean autoSignIn_) {
generateFilePath();
path = getDefaultFilePath();
login = login_;
password = password_;
cacheDir = cacheDir_;
@@ -47,8 +51,8 @@ public class SettingsLoader {
}
}
private void generateFilePath() {
path = System.getProperty("user.home") + File.separator + ".sheepit.conf";
public static String getDefaultFilePath() {
return System.getProperty("user.home") + File.separator + ".sheepit.conf";
}
public String getFilePath() {