summaryrefslogtreecommitdiff
path: root/altosui/AltosUIPreferences.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-01-02 17:26:59 -0800
committerKeith Packard <keithp@keithp.com>2012-06-02 19:26:29 -0700
commit3c2f601139d36761de6a8a2210545d082ef16133 (patch)
tree3255c18ed9cfb7e92427a7619465e57c654fea9e /altosui/AltosUIPreferences.java
parent40ee170753f4fd422c848e34a8da104683b7c8a2 (diff)
altosui: Complete split out of separate java library
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosUIPreferences.java')
-rw-r--r--altosui/AltosUIPreferences.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/altosui/AltosUIPreferences.java b/altosui/AltosUIPreferences.java
index da6c3968..38af734e 100644
--- a/altosui/AltosUIPreferences.java
+++ b/altosui/AltosUIPreferences.java
@@ -25,10 +25,9 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.awt.Component;
import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
+import org.altusmetrum.AltosLib.*;
-/* import org.altusmetrum.AltosLib.*; */
-
-class AltosUIPreferences extends AltosPreferences {
+public class AltosUIPreferences extends AltosPreferences {
/* font size preferences name */
final static String fontSizePreference = "FONT-SIZE";
@@ -47,6 +46,9 @@ class AltosUIPreferences extends AltosPreferences {
static String look_and_feel = null;
+ /* Serial debug */
+ static boolean serial_debug;
+
public static void init() {
font_listeners = new LinkedList<AltosFontListener>();
@@ -55,6 +57,8 @@ class AltosUIPreferences extends AltosPreferences {
look_and_feel = preferences.get(lookAndFeelPreference, UIManager.getSystemLookAndFeelClassName());
ui_listeners = new LinkedList<AltosUIListener>();
+ serial_debug = preferences.getBoolean(serialDebugPreference, false);
+ AltosSerial.set_debug(serial_debug);
}
static { init(); }
@@ -156,4 +160,17 @@ class AltosUIPreferences extends AltosPreferences {
ui_listeners.remove(l);
}
}
+ public static void set_serial_debug(boolean new_serial_debug) {
+ serial_debug = new_serial_debug;
+ AltosSerial.set_debug(serial_debug);
+ synchronized (preferences) {
+ preferences.putBoolean(serialDebugPreference, serial_debug);
+ flush_preferences();
+ }
+ }
+
+ public static boolean serial_debug() {
+ return serial_debug;
+ }
+
} \ No newline at end of file