diff --git a/src/net/apocalypselabs/symat/Functions.java b/src/net/apocalypselabs/symat/Functions.java index 382477d..8e70986 100644 --- a/src/net/apocalypselabs/symat/Functions.java +++ b/src/net/apocalypselabs/symat/Functions.java @@ -189,13 +189,29 @@ public class Functions { Other */ public String sysinfo() { - String info = "==Java System Information==\n"; + String info = "==Java Information==\n"; info += "Java version: " + System.getProperty("java.version"); info += "\nJava vendor: " + System.getProperty("java.vendor"); info += "\nJava home: " + System.getProperty("java.home"); 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. */ diff --git a/src/net/apocalypselabs/symat/PrefStorage.java b/src/net/apocalypselabs/symat/PrefStorage.java index 4a20b79..b2193f1 100644 --- a/src/net/apocalypselabs/symat/PrefStorage.java +++ b/src/net/apocalypselabs/symat/PrefStorage.java @@ -47,7 +47,10 @@ public class PrefStorage { } public static void unset(String key) { + saveSetting(key, ""); + save(); prefs.remove(key); + save(); } public static String getSetting(String key) {