summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosPreferences.java
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2010-09-11 15:15:14 +1000
committerAnthony Towns <aj@erisian.com.au>2010-09-11 15:15:14 +1000
commit3d64f5a6511529ca53699190f4d54de1ba62a9bd (patch)
treeef99ee573f9ba4c1e842a41c57d4ec2a3f46ce3c /ao-tools/altosui/AltosPreferences.java
parentec6da0824474e46de842845d7b53fe1a1dde33ed (diff)
parentb9623f8ef26491e9fa14e2478295fe6f5cbbd87f (diff)
Merge branch 'master' of git://git.gag.com/fw/altos
Diffstat (limited to 'ao-tools/altosui/AltosPreferences.java')
-rw-r--r--ao-tools/altosui/AltosPreferences.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/ao-tools/altosui/AltosPreferences.java b/ao-tools/altosui/AltosPreferences.java
index 690f8f1e..52627563 100644
--- a/ao-tools/altosui/AltosPreferences.java
+++ b/ao-tools/altosui/AltosPreferences.java
@@ -40,6 +40,9 @@ class AltosPreferences {
/* callsign preference name */
final static String callsignPreference = "CALLSIGN";
+ /* firmware directory preference name */
+ final static String firmwaredirPreference = "FIRMWARE";
+
/* Default logdir is ~/TeleMetrum */
final static String logdirName = "TeleMetrum";
@@ -55,8 +58,12 @@ class AltosPreferences {
/* Voice preference */
static boolean voice;
+ /* Callsign preference */
static String callsign;
+ /* Firmware directory */
+ static File firmwaredir;
+
public static void init(Component ui) {
preferences = Preferences.userRoot().node("/org/altusmetrum/altosui");
@@ -78,6 +85,12 @@ class AltosPreferences {
voice = preferences.getBoolean(voicePreference, true);
callsign = preferences.get(callsignPreference,"N0CALL");
+
+ String firmwaredir_string = preferences.get(firmwaredirPreference, null);
+ if (firmwaredir_string != null)
+ firmwaredir = new File(firmwaredir_string);
+ else
+ firmwaredir = null;
}
static void flush_preferences() {
@@ -173,4 +186,16 @@ class AltosPreferences {
public static String callsign() {
return callsign;
}
+
+ public static void set_firmwaredir(File new_firmwaredir) {
+ firmwaredir = new_firmwaredir;
+ synchronized (preferences) {
+ preferences.put(firmwaredirPreference, firmwaredir.getPath());
+ flush_preferences();
+ }
+ }
+
+ public static File firmwaredir() {
+ return firmwaredir;
+ }
}