summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosFlightUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-11-14 03:26:57 -0800
committerKeith Packard <keithp@keithp.com>2010-11-14 03:26:57 -0800
commit511903704f7e1b22e88dd3e3cc35fd3c0583820e (patch)
tree9bc4ccb95bd3d0a21f589112883e0148720cb671 /ao-tools/altosui/AltosFlightUI.java
parent11c95f687b1f68d35fa1a0af2c4e7982b8bb226a (diff)
altosui: With --replay option, exit when replay window is closed
Otherwise, the application hangs around forever. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosFlightUI.java')
-rw-r--r--ao-tools/altosui/AltosFlightUI.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/ao-tools/altosui/AltosFlightUI.java b/ao-tools/altosui/AltosFlightUI.java
index ae31048d..5134a24e 100644
--- a/ao-tools/altosui/AltosFlightUI.java
+++ b/ao-tools/altosui/AltosFlightUI.java
@@ -56,6 +56,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
int cur_tab = 0;
+ boolean exit_on_close = false;
+
int which_tab(AltosState state) {
if (state.state < Altos.ao_flight_boost)
return tab_pad;
@@ -122,8 +124,12 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
flightInfo.show(state, crc_errors);
}
+ public void set_exit_on_close() {
+ exit_on_close = true;
+ }
+
public AltosFlightUI(AltosVoice in_voice, AltosFlightReader in_reader, final int serial) {
- AltosPreferences.init(this);
+ AltosPreferences.init(this);
voice = in_voice;
reader = in_reader;
@@ -191,6 +197,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
disconnect();
setVisible(false);
dispose();
+ if (exit_on_close)
+ System.exit(0);
}
});