altosui: Display count of erased flights along with their numbers
authorKeith Packard <keithp@keithp.com>
Sun, 10 Feb 2013 22:56:10 +0000 (14:56 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 10 Feb 2013 22:58:19 +0000 (14:58 -0800)
An attempt to clarify what's going on by providing both a count and
the flight numbers.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosEepromManage.java

index dbcc50483cfe80b10bf5f7abfa9346c655b8d440..7a7211960b02545b197b238ebb9229a4c20f2df4 100644 (file)
@@ -45,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 = "";
 
        private String showDeletedFlights() {
                String  result = "";
 
@@ -94,7 +103,8 @@ public class AltosEepromManage implements ActionListener {
                } else if (cmd.equals("delete")) {
                        if (success) {
                                JOptionPane.showMessageDialog(frame,
                } 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);
                                                                            showDeletedFlights()),
                                                              serial_line.device.toShortString(),
                                                              JOptionPane.INFORMATION_MESSAGE);