summaryrefslogtreecommitdiff
path: root/altosui/AltosUIPreferences.java
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2012-09-12 21:29:17 -0600
committerBdale Garbee <bdale@gag.com>2012-09-12 21:29:17 -0600
commite91cb50e2a3a139ac7a0e09bffe569c7c1fa4381 (patch)
tree1473739d7ba84638861efaaabbdc7219a66cdb37 /altosui/AltosUIPreferences.java
parent3b612efcd1dddc6a3d59012f7ed57754b1f798c2 (diff)
parent07d9ba938f2742da1bce5d8df55cbc236207a981 (diff)
Merge branch 'branch-1.1' into debian
Diffstat (limited to 'altosui/AltosUIPreferences.java')
-rw-r--r--altosui/AltosUIPreferences.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/altosui/AltosUIPreferences.java b/altosui/AltosUIPreferences.java
index 10ab26c3..8f1e45d9 100644
--- a/altosui/AltosUIPreferences.java
+++ b/altosui/AltosUIPreferences.java
@@ -102,15 +102,17 @@ public class AltosUIPreferences extends AltosPreferences {
}
}
public static int font_size() {
- return font_size;
+ synchronized (preferences) {
+ return font_size;
+ }
}
static void set_fonts() {
}
public static void set_font_size(int new_font_size) {
- font_size = new_font_size;
synchronized (preferences) {
+ font_size = new_font_size;
preferences.putInt(fontSizePreference, font_size);
flush_preferences();
Altos.set_fonts(font_size);
@@ -132,12 +134,12 @@ public class AltosUIPreferences extends AltosPreferences {
}
public static void set_look_and_feel(String new_look_and_feel) {
- look_and_feel = new_look_and_feel;
try {
- UIManager.setLookAndFeel(look_and_feel);
+ UIManager.setLookAndFeel(new_look_and_feel);
} catch (Exception e) {
}
synchronized(preferences) {
+ look_and_feel = new_look_and_feel;
preferences.put(lookAndFeelPreference, look_and_feel);
flush_preferences();
for (AltosUIListener l : ui_listeners)
@@ -146,7 +148,9 @@ public class AltosUIPreferences extends AltosPreferences {
}
public static String look_and_feel() {
- return look_and_feel;
+ synchronized (preferences) {
+ return look_and_feel;
+ }
}
public static void register_ui_listener(AltosUIListener l) {
@@ -161,16 +165,18 @@ public class AltosUIPreferences extends AltosPreferences {
}
}
public static void set_serial_debug(boolean new_serial_debug) {
- serial_debug = new_serial_debug;
- AltosLink.set_debug(serial_debug);
+ AltosLink.set_debug(new_serial_debug);
synchronized (preferences) {
+ serial_debug = new_serial_debug;
preferences.putBoolean(serialDebugPreference, serial_debug);
flush_preferences();
}
}
public static boolean serial_debug() {
- return serial_debug;
+ synchronized (preferences) {
+ return serial_debug;
+ }
}
} \ No newline at end of file