X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=micropeak%2FMicroFileChooser.java;h=3ca128ee97bfddc79cefd3f55ad77d2162b7b528;hp=d254098783bb509da82dc7bbfcb6baa12cc0cd7b;hb=4e1b134e29313a1bdac18de57fe547299e5ded2a;hpb=56a1210a7b04a3623d19ec282f26fecc79c126dd diff --git a/micropeak/MicroFileChooser.java b/micropeak/MicroFileChooser.java index d2540987..3ca128ee 100644 --- a/micropeak/MicroFileChooser.java +++ b/micropeak/MicroFileChooser.java @@ -20,8 +20,8 @@ package org.altusmetrum.micropeak; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; -import org.altusmetrum.AltosLib.*; -import org.altusmetrum.altosuilib.*; +import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altosuilib_1.*; public class MicroFileChooser extends JFileChooser { JFrame frame; @@ -36,24 +36,12 @@ public class MicroFileChooser extends JFileChooser { return file; } - public InputStream runDialog() { + public File runDialog() { int ret; ret = showOpenDialog(frame); - if (ret == APPROVE_OPTION) { - file = getSelectedFile(); - if (file == null) - return null; - filename = file.getName(); - try { - return new FileInputStream(file); - } catch (FileNotFoundException fe) { - JOptionPane.showMessageDialog(frame, - fe.getMessage(), - "Cannot open file", - JOptionPane.ERROR_MESSAGE); - } - } + if (ret == APPROVE_OPTION) + return getSelectedFile(); return null; } @@ -62,6 +50,6 @@ public class MicroFileChooser extends JFileChooser { setDialogTitle("Select MicroPeak Data File"); setFileFilter(new FileNameExtensionFilter("MicroPeak data file", "mpd")); - setCurrentDirectory(AltosUIPreferences.logdir()); + setCurrentDirectory(AltosUIPreferences.last_logdir()); } }