From: Keith Packard Date: Sun, 10 Feb 2013 22:56:10 +0000 (-0800) Subject: altosui: Display count of erased flights along with their numbers X-Git-Tag: altosdroid_v1.2-1~115 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=f0a125503e502d213711df0d7774d837d4d98447 altosui: Display count of erased flights along with their numbers An attempt to clarify what's going on by providing both a count and the flight numbers. Signed-off-by: Keith Packard --- diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index dbcc5048..7a721196 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -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 = ""; @@ -94,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);