diff options
author | Keith Packard <keithp@keithp.com> | 2013-02-10 14:56:10 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-02-10 14:58:19 -0800 |
commit | f0a125503e502d213711df0d7774d837d4d98447 (patch) | |
tree | 7f6d17f314f97e21e36a4ab33f2446e8972ae2d0 | |
parent | 17455da530833d3db03ee2ace7b15130ed307670 (diff) |
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 <keithp@keithp.com>
-rw-r--r-- | altosui/AltosEepromManage.java | 12 |
1 files changed, 11 insertions, 1 deletions
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); |