diff options
author | Keith Packard <keithp@keithp.com> | 2010-11-20 00:13:58 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-11-20 00:13:58 -0800 |
commit | 9a99cabc1c34c657fc95246192ba6d330f5f22d3 (patch) | |
tree | 18823288d3b3c3444d3efbdd46c238ffe9a316d2 /ao-tools/altosui/AltosFlightUI.java | |
parent | 71c41eadd12c3ece5fffce7669e4991778046d4e (diff) |
altosui: Fix channel changing in flight UI to actually work
Replacing the menu with a combo box required reworking the way events
are delivered from that widget back to the channel changing
function. Just delete the old magic and use the JComboBox action
listener directly.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosFlightUI.java')
-rw-r--r-- | ao-tools/altosui/AltosFlightUI.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ao-tools/altosui/AltosFlightUI.java b/ao-tools/altosui/AltosFlightUI.java index 56ab7ebc..ac88aa15 100644 --- a/ao-tools/altosui/AltosFlightUI.java +++ b/ao-tools/altosui/AltosFlightUI.java @@ -127,6 +127,7 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { } Container bag; + JComboBox channels; public AltosFlightUI(AltosVoice in_voice, AltosFlightReader in_reader, final int serial) { AltosPreferences.init(this); @@ -147,10 +148,10 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { if (serial >= 0) { // Channel menu - JComboBox channels = new AltosChannelMenu(AltosPreferences.channel(serial)); + channels = new AltosChannelMenu(AltosPreferences.channel(serial)); channels.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - int channel = Integer.parseInt(e.getActionCommand()); + int channel = channels.getSelectedIndex(); reader.set_channel(channel); AltosPreferences.set_channel(serial, channel); } |