From f0a125503e502d213711df0d7774d837d4d98447 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 10 Feb 2013 14:56:10 -0800 Subject: [PATCH] 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 --- altosui/AltosEepromManage.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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); -- 2.30.2