summaryrefslogtreecommitdiff
path: root/telegps/TeleGPS.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-06-12 14:32:15 -0700
committerKeith Packard <keithp@keithp.com>2014-06-12 14:32:15 -0700
commit7d77d83685cbfce5323767bbfae3bd18be175ffc (patch)
treed8217823f9f4b3f10a3a0eccbc935841ef363341 /telegps/TeleGPS.java
parent8044eb8e23366e91c741060939baff5137f841c7 (diff)
telegps: Don't re-add frequency menu when already present.
If the receiver disappears, we'll stop tracking, but won't pull the frequency menu down. Doing that would take a bit of work, and it doesn't seem worth the effort. As a kludge-around, avoid re-creating the frequency menu if it's already displayed when we connect to another device. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'telegps/TeleGPS.java')
-rw-r--r--telegps/TeleGPS.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java
index 2503d53e..9aaa80c3 100644
--- a/telegps/TeleGPS.java
+++ b/telegps/TeleGPS.java
@@ -323,6 +323,9 @@ public class TeleGPS
void add_frequency_menu(int serial, final AltosFlightReader reader) {
// Channel menu
+ if (frequencies != null)
+ return;
+
frequencies = new AltosFreqList(AltosUIPreferences.frequency(serial));
frequencies.set_product("Monitor");
frequencies.set_serial(serial);
@@ -343,6 +346,7 @@ public class TeleGPS
void remove_frequency_menu() {
if (frequencies != null) {
menu_bar.remove(frequencies);
+ menu_bar.repaint();
frequencies = null;
}
}