summaryrefslogtreecommitdiff
path: root/telegps/TeleGPS.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-07-04 23:38:53 -0700
committerKeith Packard <keithp@keithp.com>2014-07-05 00:38:09 -0700
commit98c3c3f7edd58358939f7dacf5b8f4c336712f5b (patch)
tree8580e11d93fb6f7c777ef175f1baf4dfdb14c4d7 /telegps/TeleGPS.java
parent505c6a1f8b8d68fe6f74dcb4428c860157fae3de (diff)
altosui/telegps: Undo the frequency/telemetry menu changes
Using menus for these items isn't what we want; we want to show the current value on the screen, which is what a combo box is for. Switch back to those and remove the frequency and telemetry config from the TeleGPS menu bar so that Mac OS X is happy. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'telegps/TeleGPS.java')
-rw-r--r--telegps/TeleGPS.java28
1 files changed, 18 insertions, 10 deletions
diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java
index e78c2124..7e5ff42a 100644
--- a/telegps/TeleGPS.java
+++ b/telegps/TeleGPS.java
@@ -58,7 +58,7 @@ public class TeleGPS
JMenu file_menu;
JMenu monitor_menu;
JMenu device_menu;
- AltosFreqList frequencies;
+ AltosUIFreqList frequencies;
ActionListener frequency_listener;
Container bag;
@@ -351,18 +351,17 @@ public class TeleGPS
frequencies.set_product("Monitor");
frequencies.set_serial(serial);
frequencies.set_frequency(AltosUIPreferences.frequency(serial));
+ frequencies.setEnabled(true);
- menu_bar.add(frequencies);
- menu_bar.repaint();
}
void disable_frequency_menu() {
- if (frequency_listener == null)
- return;
- frequencies.removeActionListener(frequency_listener);
- menu_bar.remove(frequencies);
- menu_bar.repaint();
- frequency_listener = null;
+ if (frequency_listener != null) {
+ frequencies.removeActionListener(frequency_listener);
+ frequencies.setEnabled(false);
+ frequency_listener = null;
+ }
+
}
public void set_reader(AltosFlightReader reader, AltosDevice device) {
@@ -457,7 +456,16 @@ public class TeleGPS
file_menu = make_menu("File", file_menu_entries);
monitor_menu = make_menu("Monitor", monitor_menu_entries);
device_menu = make_menu("Device", device_menu_entries);
- frequencies = new AltosFreqList();
+
+ frequencies = new AltosUIFreqList();
+ frequencies.setEnabled(false);
+ c.gridx = 0;
+ c.gridy = 0;
+ c.fill = GridBagConstraints.NONE;
+ c.anchor = GridBagConstraints.WEST;
+ c.weightx = 0;
+ c.gridwidth = 1;
+ bag.add(frequencies, c);
displays = new LinkedList<AltosFlightDisplay>();