+ 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;
- if (success)
- System.out.printf("Delete succeeded\n");
- finish();
+ 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);
device.toShortString(),
ee.getLocalizedMessage(),
JOptionPane.ERROR_MESSAGE);
device.toShortString(),
ee.getLocalizedMessage(),
JOptionPane.ERROR_MESSAGE);
} catch (TimeoutException te) {
JOptionPane.showMessageDialog(frame,
String.format("Communications failed with \"%s\"",
device.toShortString()),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} catch (TimeoutException te) {
JOptionPane.showMessageDialog(frame,
String.format("Communications failed with \"%s\"",
device.toShortString()),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);