X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosEepromManage.java;h=7a7211960b02545b197b238ebb9229a4c20f2df4;hp=e6739e770eb0f55e572d3876a174e8d11e82a13e;hb=2120d362cefceba69e75996b6391d9558978c01d;hpb=382c54a0d052c8975b57c995ef83bc8934bde242 diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index e6739e77..7a721196 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -21,7 +21,8 @@ import java.awt.event.*; import javax.swing.*; import java.io.*; import java.util.concurrent.*; -import org.altusmetrum.AltosLib.*; +import org.altusmetrum.altoslib_1.*; +import org.altusmetrum.altosuilib_1.*; public class AltosEepromManage implements ActionListener { @@ -44,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 = ""; @@ -93,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); @@ -153,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()), @@ -194,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;