mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-13 14:44:48 -04:00
v0.2
This commit is contained in:
parent
c4d0959cf3
commit
f5a9ddf8df
13 changed files with 162 additions and 91 deletions
23
src/main/java/nsusbloader/AppPreferences.java
Normal file
23
src/main/java/nsusbloader/AppPreferences.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
package nsusbloader;
|
||||
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
public class AppPreferences {
|
||||
private static final AppPreferences INSTANCE = new AppPreferences();
|
||||
public static AppPreferences getInstance() { return INSTANCE; }
|
||||
|
||||
private Preferences preferences;
|
||||
|
||||
private AppPreferences(){ preferences = Preferences.userRoot().node("NS-USBloader"); }
|
||||
|
||||
public String getTheme(){
|
||||
String theme = preferences.get("THEME", "/res/app_dark.css"); // Don't let user to change settings manually
|
||||
if (!theme.matches("(^/res/app_dark.css$)|(^/res/app_light.css$)"))
|
||||
theme = "/res/app_dark.css";
|
||||
return theme;
|
||||
}
|
||||
public void setTheme(String theme){ preferences.put("THEME", theme); }
|
||||
|
||||
public String getRecent(){ return preferences.get("RECENT", System.getProperty("user.home")); }
|
||||
public void setRecent(String path){ preferences.put("RECENT", path); }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue