Merge remote-tracking branch 'origin/master'
[fw/altos] / altosui / AltosEepromManage.java
index 27b03bedb876c69a301e5b2208657d27400f0b7a..b2d8a130fba1bbe11db4c1ec0a349c726e7e4e34 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package AltosUI;
+package altosui;
 
-import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import javax.swing.filechooser.FileNameExtensionFilter;
-import javax.swing.table.*;
 import java.io.*;
-import java.util.*;
-import java.text.*;
-import java.util.prefs.*;
 import java.util.concurrent.*;
-import org.altusmetrum.AltosLib.*;
-
-import libaltosJNI.*;
+import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altosuilib_1.*;
 
 public class AltosEepromManage implements ActionListener {
 
@@ -52,6 +45,15 @@ public class AltosEepromManage implements ActionListener {
                }
        }
 
+       private int countDeletedFlights() {
+               int count = 0;
+               for (AltosEepromLog flight : flights) {
+                       if (flight.selected)
+                               count++;
+               }
+               return count;
+       }
+
        private String showDeletedFlights() {
                String  result = "";
 
@@ -101,7 +103,8 @@ public class AltosEepromManage implements ActionListener {
                } else if (cmd.equals("delete")) {
                        if (success) {
                                JOptionPane.showMessageDialog(frame,
-                                                             String.format("Flights erased: %s",
+                                                             String.format("%d flights erased: %s",
+                                                                           countDeletedFlights(),
                                                                            showDeletedFlights()),
                                                              serial_line.device.toShortString(),
                                                              JOptionPane.INFORMATION_MESSAGE);
@@ -161,7 +164,7 @@ public class AltosEepromManage implements ActionListener {
                                                      ee.getLocalizedMessage(),
                                                      JOptionPane.ERROR_MESSAGE);
                } else if (e instanceof TimeoutException) {
-                       TimeoutException te = (TimeoutException) e;
+                       //TimeoutException te = (TimeoutException) e;
                        JOptionPane.showMessageDialog(frame,
                                                      String.format("Communications failed with \"%s\"",
                                                                    device.toShortString()),
@@ -202,10 +205,10 @@ public class AltosEepromManage implements ActionListener {
 
        public AltosEepromManage(JFrame given_frame) {
 
-               boolean running = false;
+               //boolean       running = false;
 
                frame = given_frame;
-               device = AltosDeviceDialog.show(frame, Altos.product_any);
+               device = AltosDeviceUIDialog.show(frame, Altos.product_any);
 
                remote = false;