Add license reset function
This commit is contained in:
parent
df4ad2531c
commit
45fe46ad33
@ -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.
|
||||||
*/
|
*/
|
||||||
|
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user