Delete the settings file if the user does not want to save its info
This commit is contained in:
@@ -49,6 +49,10 @@ public class SettingsLoader {
|
||||
path = System.getProperty("user.home") + File.separator + ".sheepit.conf";
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void saveFile() {
|
||||
Properties prop = new Properties();
|
||||
OutputStream output = null;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.sheepit.client.standalone.swing.activity;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -270,6 +271,13 @@ public class Settings implements Activity {
|
||||
if (saveFile.isSelected()) {
|
||||
new SettingsLoader(login.getText(), new String(password.getPassword()), method, selected_gpu, cachePath).saveFile();
|
||||
}
|
||||
else {
|
||||
try {
|
||||
new File(new SettingsLoader().getFilePath()).delete();
|
||||
}
|
||||
catch (SecurityException e3) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user