X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosEepromManage.java;h=aa43ab9ee3c4f740187bc3f391f387b14ec54f19;hp=563c90b3ce78dd0b81228854c9f74d112fda9fff;hb=9a4c2c7fc6af922d052e23a1b99bf847fbf9b0e9;hpb=95268d681c9a6652d84db383f55a4fe8a4ac5173 diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index 563c90b3..aa43ab9e 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -17,19 +17,12 @@ package altosui; -import java.awt.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.table.*; import java.io.*; -import java.util.*; -import java.text.*; -import java.util.prefs.*; import java.util.concurrent.*; -import org.altusmetrum.AltosLib.*; - -import libaltosJNI.*; +import org.altusmetrum.altoslib_4.*; +import org.altusmetrum.altosuilib_2.*; public class AltosEepromManage implements ActionListener { @@ -52,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 = ""; @@ -101,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); @@ -130,11 +133,13 @@ public class AltosEepromManage implements ActionListener { for (AltosEepromLog flight : flights) any_selected = any_selected || flight.selected; if (any_selected) { - download = new AltosEepromDownload(frame, + AltosEepromMonitorUI monitor = new AltosEepromMonitorUI(frame); + monitor.addActionListener(this); + serial_line.set_frame(frame); + download = new AltosEepromDownload(monitor, serial_line, remote, flights); - download.addActionListener(this); /* * Start flight log download */ @@ -161,7 +166,7 @@ public class AltosEepromManage implements ActionListener { ee.getLocalizedMessage(), JOptionPane.ERROR_MESSAGE); } else if (e instanceof TimeoutException) { - TimeoutException te = (TimeoutException) e; + //TimeoutException te = (TimeoutException) e; JOptionPane.showMessageDialog(frame, String.format("Communications failed with \"%s\"", device.toShortString()), @@ -202,10 +207,10 @@ public class AltosEepromManage implements ActionListener { public AltosEepromManage(JFrame given_frame) { - boolean running = false; + //boolean running = false; frame = given_frame; - device = AltosDeviceDialog.show(frame, Altos.product_any); + device = AltosDeviceUIDialog.show(frame, Altos.product_any); remote = false;