int cur_tab = 0;
+ boolean exit_on_close = false;
+
int which_tab(AltosState state) {
if (state.state < Altos.ao_flight_boost)
return tab_pad;
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;
this.setJMenuBar(menubar);
}
- this.setSize(new Dimension (width(), height()));
+ this.setSize(this.getPreferredSize());
this.validate();
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
disconnect();
setVisible(false);
dispose();
+ if (exit_on_close)
+ System.exit(0);
}
});