summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-08-23 23:01:36 -0700
committerKeith Packard <keithp@keithp.com>2010-08-23 23:01:36 -0700
commita55b132668a819cc26478a609cb79bd9190deb9d (patch)
tree27ad72810ce23a9f885314044be3ef25fe41b077 /ao-tools/altosui/AltosUI.java
parentef8376c4dd8262a34e02b6bb9e19e907ac2f4330 (diff)
altosui: Separate out log file choosing dialog to share with CSV generator
This dialog will be shared with the CSV file generating code, so split it out instead of duplicating it. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosUI.java')
-rw-r--r--ao-tools/altosui/AltosUI.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java
index 9fd47ea7..64f96cdd 100644
--- a/ao-tools/altosui/AltosUI.java
+++ b/ao-tools/altosui/AltosUI.java
@@ -42,6 +42,7 @@ import altosui.AltosFlightStatusTableModel;
import altosui.AltosFlightInfoTableModel;
import altosui.AltosChannelMenu;
import altosui.AltosFlashUI;
+import altosui.AltosLogfileChooser;
import libaltosJNI.*;
@@ -529,17 +530,12 @@ public class AltosUI extends JFrame {
* Replay a flight from telemetry data
*/
private void Replay() {
- JFileChooser logfile_chooser = new JFileChooser();
+ AltosLogfileChooser chooser = new AltosLogfileChooser(
+ AltosUI.this);
- logfile_chooser.setDialogTitle("Select Flight Record File");
- logfile_chooser.setFileFilter(new FileNameExtensionFilter("Flight data file", "eeprom", "telem"));
- logfile_chooser.setCurrentDirectory(AltosPreferences.logdir());
- int returnVal = logfile_chooser.showOpenDialog(AltosUI.this);
+ File file = chooser.runDialog();
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = logfile_chooser.getSelectedFile();
- if (file == null)
- System.out.println("No file selected?");
+ if (file != null) {
String filename = file.getName();
try {
FileInputStream replay = new FileInputStream(file);