altosuilib: Track open frames, exit when none remain
[fw/altos] / altosui / AltosGraphUI.java
index be63c6e655ba6b5a209b59b54fd65dd8ccb2800a..4f394d73fb932a617bc62a806e7b1ab313640768 100644 (file)
@@ -35,7 +35,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
        JTabbedPane             pane;
        AltosGraph              graph;
        AltosUIEnable           enable;
-       AltosUIMapNew           map;
+       AltosUIMap              map;
        AltosState              state;
        AltosGraphDataSet       graphDataSet;
        AltosFlightStats        stats;
@@ -47,7 +47,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
                for (AltosState state : states) {
                        if (state.gps != null && state.gps.locked && state.gps.nsat >= 4) {
                                if (map == null)
-                                       map = new AltosUIMapNew();
+                                       map = new AltosUIMap();
                                map.show(state, null);
                                has_gps = true;
                        }
@@ -100,8 +100,6 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
                addWindowListener(new WindowAdapter() {
                                @Override
                                public void windowClosing(WindowEvent e) {
-                                       setVisible(false);
-                                       dispose();
                                        AltosUIPreferences.unregister_font_listener(AltosGraphUI.this);
                                        AltosPreferences.unregister_units_listener(AltosGraphUI.this);
                                }