summaryrefslogtreecommitdiff
path: root/altosui
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-06-24 20:52:34 -0700
committerKeith Packard <keithp@keithp.com>2014-06-24 20:58:49 -0700
commit7427f8bac7b3743ce0ab990612bf7168b95e22f9 (patch)
tree9fe894ad6a24fc245465dd94d703a886b7e00fb5 /altosui
parent6cb5955ab5aa3b42a507c4a02812cb5569b8562b (diff)
altosui: Don't show the tracker motion value when switching units
The tracker value was left enabled when hidden; the logic for deciding whether to update it with new information used only the enabled state, not the visible state. Set both states when hiding it to keep things more consistent Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui')
-rw-r--r--altosui/AltosConfigUI.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java
index 6e1b47c2..de1b582e 100644
--- a/altosui/AltosConfigUI.java
+++ b/altosui/AltosConfigUI.java
@@ -925,6 +925,8 @@ public class AltosConfigUI
}
public void units_changed(boolean imperial_units) {
+ boolean was_dirty = dirty;
+
String v = main_deploy_value.getSelectedItem().toString();
main_deploy_label.setText(get_main_deploy_label());
set_main_deploy_values();
@@ -937,6 +939,9 @@ public class AltosConfigUI
set_tracker_motion_values();
set_tracker_motion((int) (AltosConvert.height.parse(motion, !imperial_units) + 0.5));
}
+
+ if (!was_dirty)
+ set_clean();
}
public void set_apogee_delay(int new_apogee_delay) {
@@ -1151,9 +1156,11 @@ public class AltosConfigUI
if (tracker_motion < 0) {
tracker_motion_label.setVisible(false);
tracker_motion_value.setVisible(false);
+ tracker_motion_value.setEnabled(false);
} else {
tracker_motion_label.setVisible(true);
tracker_motion_value.setVisible(true);
+ tracker_motion_value.setEnabled(true);
tracker_motion_value.setSelectedItem(AltosConvert.height.say(tracker_motion));
}
}
@@ -1166,9 +1173,11 @@ public class AltosConfigUI
if (tracker_interval< 0) {
tracker_interval_label.setVisible(false);
tracker_interval_value.setVisible(false);
+ tracker_interval_value.setEnabled(false);
} else {
tracker_interval_label.setVisible(true);
tracker_interval_value.setVisible(true);
+ tracker_interval_value.setEnabled(true);
tracker_interval_value.setSelectedItem(String.format("%d", tracker_interval));
}
}