From 7d77d83685cbfce5323767bbfae3bd18be175ffc Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 12 Jun 2014 14:32:15 -0700 Subject: [PATCH] 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 --- telegps/TeleGPS.java | 4 ++++ 1 file changed, 4 insertions(+) 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; } } -- 2.30.2