From c2701ae646124f0668c5f2d1df3fc80f0075a9d7 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 10 Feb 2013 14:17:04 -0800 Subject: altosui: Interrupt MonitorIdle when changing frequency/callsign When switching radio parameters, the local device needs to have the parameters switched, so interrupt the current operation and start over, the frequency and callsign will be set the next time through. Signed-off-by: Keith Packard --- altosui/AltosIdleMonitorUI.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'altosui/AltosIdleMonitorUI.java') diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 462bff18..8c883eeb 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -37,11 +37,8 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl boolean remote; void stop_display() { - if (thread != null && thread.isAlive()) { - thread.interrupt(); - try { - thread.join(); - } catch (InterruptedException ie) {} + if (thread != null) { + thread.abort(); } thread = null; } @@ -92,8 +89,11 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl /* DocumentListener interface methods */ public void changedUpdate(DocumentEvent e) { - if (callsign_value != null) - AltosUIPreferences.set_callsign(callsign_value.getText()); + if (callsign_value != null) { + String callsign = callsign_value.getText(); + thread.set_callsign(callsign); + AltosUIPreferences.set_callsign(callsign); + } } public void insertUpdate(DocumentEvent e) { -- cgit v1.2.3