Make sure the user always sees confirmation for flight log management.
Signed-off-by: Keith Packard <keithp@keithp.com>
+ private String showDeletedFlights() {
+ String result = "";
+
+ for (AltosEepromLog flight : flights) {
+ if (flight.delete) {
+ if (result.equals(""))
+ result = String.format("%d", flight.flight);
+ else
+ result = String.format("%s, %d", result, flight.flight);
+ }
+ }
+ return result;
+ }
+
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
boolean success = e.getID() != 0;
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
boolean success = e.getID() != 0;
System.out.printf("Eeprom manager action %s %d\n", cmd, e.getID());
if (cmd.equals("download")) {
if (success) {
System.out.printf("Eeprom manager action %s %d\n", cmd, e.getID());
if (cmd.equals("download")) {
if (success) {
- System.out.printf("Download succeeded\n");
if (any_delete)
delete.start();
else
finish();
}
} else if (cmd.equals("delete")) {
if (any_delete)
delete.start();
else
finish();
}
} else if (cmd.equals("delete")) {
- if (success)
- System.out.printf("Delete succeeded\n");
+ if (success) {
+ JOptionPane.showMessageDialog(frame,
+ String.format("Flights erased: %s",
+ showDeletedFlights()),
+ serial_line.device.toShortString(),
+ JOptionPane.INFORMATION_MESSAGE);
+ }
flights = new AltosEepromList(serial_line, remote);
if (flights.size() == 0) {
flights = new AltosEepromList(serial_line, remote);
if (flights.size() == 0) {
+ JOptionPane.showMessageDialog(frame,
+ String.format("No flights available on %d",
+ device.getSerial()),
+ serial_line.device.toShortString(),
+ JOptionPane.INFORMATION_MESSAGE);
} else {
AltosEepromSelect select = new AltosEepromSelect(frame, flights);
} else {
AltosEepromSelect select = new AltosEepromSelect(frame, flights);