diff options
| author | Keith Packard <keithp@keithp.com> | 2010-08-21 17:57:31 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-08-21 17:57:31 -0700 |
| commit | e1463d8e265dfd42c824d90088cd2a51b4cf8131 (patch) | |
| tree | 4e19ae1bd45f7ff71e032e44f360e00452e97015 /ao-tools/altosui/AltosPreferences.java | |
| parent | 09252ec22d58e946494e4ca2cf367bf3bbe1cc50 (diff) | |
altosui: Make teledongle callsign configurable
Teledongle uses the callsign in packet mode; this provides a way to
set that.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosPreferences.java')
| -rw-r--r-- | ao-tools/altosui/AltosPreferences.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ao-tools/altosui/AltosPreferences.java b/ao-tools/altosui/AltosPreferences.java index 297e1aae..690f8f1e 100644 --- a/ao-tools/altosui/AltosPreferences.java +++ b/ao-tools/altosui/AltosPreferences.java @@ -37,6 +37,9 @@ class AltosPreferences { /* voice preference name */ final static String voicePreference = "VOICE"; + /* callsign preference name */ + final static String callsignPreference = "CALLSIGN"; + /* Default logdir is ~/TeleMetrum */ final static String logdirName = "TeleMetrum"; @@ -52,6 +55,8 @@ class AltosPreferences { /* Voice preference */ static boolean voice; + static String callsign; + public static void init(Component ui) { preferences = Preferences.userRoot().node("/org/altusmetrum/altosui"); @@ -71,6 +76,8 @@ class AltosPreferences { channel = preferences.getInt(channelPreference, 0); voice = preferences.getBoolean(voicePreference, true); + + callsign = preferences.get(callsignPreference,"N0CALL"); } static void flush_preferences() { @@ -154,4 +161,16 @@ class AltosPreferences { public static boolean voice() { return voice; } + + public static void set_callsign(String new_callsign) { + callsign = new_callsign; + synchronized(preferences) { + preferences.put(callsignPreference, callsign); + flush_preferences(); + } + } + + public static String callsign() { + return callsign; + } } |
