Add license reset function

This commit is contained in:
skylarmt 2015-01-13 02:51:39 -07:00
parent df4ad2531c
commit 45fe46ad33
2 changed files with 20 additions and 1 deletions

View File

@ -189,13 +189,29 @@ public class Functions {
Other Other
*/ */
public String sysinfo() { public String sysinfo() {
String info = "==Java System Information==\n"; String info = "==Java Information==\n";
info += "Java version: " + System.getProperty("java.version"); info += "Java version: " + System.getProperty("java.version");
info += "\nJava vendor: " + System.getProperty("java.vendor"); info += "\nJava vendor: " + System.getProperty("java.vendor");
info += "\nJava home: " + System.getProperty("java.home"); info += "\nJava home: " + System.getProperty("java.home");
return info; return info;
} }
/**
* Reset the license, quit the application.
*/
public void resetlicense() {
int result = JOptionPane.showConfirmDialog(null,
"Are you sure you want to reset your license?\n"
+ "This will close SyMAT and all open files!",
"Reset license",
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (result == JOptionPane.YES_OPTION) {
PrefStorage.unset("license");
System.exit(0);
}
}
/** /**
* Make sure the graph window shows. * Make sure the graph window shows.
*/ */

View File

@ -47,7 +47,10 @@ public class PrefStorage {
} }
public static void unset(String key) { public static void unset(String key) {
saveSetting(key, "");
save();
prefs.remove(key); prefs.remove(key);
save();
} }
public static String getSetting(String key) { public static String getSetting(String key) {