projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'buttonbox' of git://git.gag.com/fw/altos into buttonbox
[fw/altos]
/
ao-tools
/
altosui
/
AltosFlashUI.java
diff --git
a/ao-tools/altosui/AltosFlashUI.java
b/ao-tools/altosui/AltosFlashUI.java
index 18795695640e2630218259602f999002a550213b..f63097ac408ad1f71356311365b487203ce8788f 100644
(file)
--- a/
ao-tools/altosui/AltosFlashUI.java
+++ b/
ao-tools/altosui/AltosFlashUI.java
@@
-28,9
+28,6
@@
import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.prefs.*;
import java.util.concurrent.LinkedBlockingQueue;
-import altosui.AltosHexfile;
-import altosui.AltosFlash;
-
public class AltosFlashUI
extends JDialog
implements Runnable, ActionListener
public class AltosFlashUI
extends JDialog
implements Runnable, ActionListener
@@
-68,10
+65,9
@@
public class AltosFlashUI
}
public void run() {
}
public void run() {
- flash = new AltosFlash(file, debug_dongle);
- flash.addActionListener(this);
try {
try {
- flash.open();
+ flash = new AltosFlash(file, debug_dongle);
+ flash.addActionListener(this);
AltosRomconfigUI romconfig_ui = new AltosRomconfigUI (frame);
romconfig_ui.set(flash.romconfig());
AltosRomconfigUI romconfig_ui = new AltosRomconfigUI (frame);
romconfig_ui.set(flash.romconfig());
@@
-91,6
+87,12
@@
public class AltosFlashUI
"Cannot open image",
file.toString(),
JOptionPane.ERROR_MESSAGE);
"Cannot open image",
file.toString(),
JOptionPane.ERROR_MESSAGE);
+ } catch (AltosSerialInUseException si) {
+ JOptionPane.showMessageDialog(frame,
+ String.format("Device \"%s\" already in use",
+ debug_dongle.toShortString()),
+ "Device in use",
+ JOptionPane.ERROR_MESSAGE);
} catch (IOException e) {
JOptionPane.showMessageDialog(frame,
e.getMessage(),
} catch (IOException e) {
JOptionPane.showMessageDialog(frame,
e.getMessage(),
@@
-187,13
+189,17
@@
public class AltosFlashUI
build_dialog();
build_dialog();
- debug_dongle = AltosDeviceDialog.show(frame, AltosDevice.
A
ny);
+ debug_dongle = AltosDeviceDialog.show(frame, AltosDevice.
product_a
ny);
if (debug_dongle == null)
return;
JFileChooser hexfile_chooser = new JFileChooser();
if (debug_dongle == null)
return;
JFileChooser hexfile_chooser = new JFileChooser();
+ File firmwaredir = AltosPreferences.firmwaredir();
+ if (firmwaredir != null)
+ hexfile_chooser.setCurrentDirectory(firmwaredir);
+
hexfile_chooser.setDialogTitle("Select Flash Image");
hexfile_chooser.setFileFilter(new FileNameExtensionFilter("Flash Image", "ihx"));
int returnVal = hexfile_chooser.showOpenDialog(frame);
hexfile_chooser.setDialogTitle("Select Flash Image");
hexfile_chooser.setFileFilter(new FileNameExtensionFilter("Flash Image", "ihx"));
int returnVal = hexfile_chooser.showOpenDialog(frame);
@@
-203,6
+209,9
@@
public class AltosFlashUI
file = hexfile_chooser.getSelectedFile();
file = hexfile_chooser.getSelectedFile();
+ if (file != null)
+ AltosPreferences.set_firmwaredir(file.getParentFile());
+
thread = new Thread(this);
thread.start();
}
thread = new Thread(this);
thread.start();
}