altosui: Make sure packet mode is turned off when the connection fails
[fw/altos] / ao-tools / altosui / AltosFlightUI.java
index 1107d52725a62125d46c1c1940d73f908747d69a..24d25bd7c46a0a4683fc732ce4441711a48a3fed 100644 (file)
@@ -148,7 +148,6 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
                                public void actionPerformed(ActionEvent e) {
                                        int channel = channels.getSelectedIndex();
                                        reader.set_channel(channel);
-                                       AltosPreferences.set_channel(serial, channel);
                                }
                        });
                        c.gridx = 0;
@@ -198,15 +197,15 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
 
                setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                addWindowListener(new WindowAdapter() {
-                       @Override
-                       public void windowClosing(WindowEvent e) {
-                               disconnect();
-                               setVisible(false);
-                               dispose();
-                               if (exit_on_close)
-                                       System.exit(0);
-                       }
-               });
+                               @Override
+                               public void windowClosing(WindowEvent e) {
+                                       disconnect();
+                                       setVisible(false);
+                                       dispose();
+                                       if (exit_on_close)
+                                               System.exit(0);
+                               }
+                       });
 
                pack();
                setVisible(true);