diff options
author | Keith Packard <keithp@keithp.com> | 2010-09-01 22:46:04 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-09-03 07:04:28 -0700 |
commit | 9a690c9795e8257d2a3225f905117681668a472f (patch) | |
tree | cf60592cd26d8da744ca6e5bfe05db8dd395fb3c | |
parent | 2f07ad14a16dbf1b75c71784ceae303825c90ade (diff) |
altosui: allow flashing to be canceled from the rom config dialog
Was using the rom config class wrong, causing cancel actions to work
just like 'ok' actions. Oops.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | ao-tools/altosui/AltosFlashUI.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/ao-tools/altosui/AltosFlashUI.java b/ao-tools/altosui/AltosFlashUI.java index 73a97a6b..18795695 100644 --- a/ao-tools/altosui/AltosFlashUI.java +++ b/ao-tools/altosui/AltosFlashUI.java @@ -75,17 +75,17 @@ public class AltosFlashUI AltosRomconfigUI romconfig_ui = new AltosRomconfigUI (frame); romconfig_ui.set(flash.romconfig()); - romconfig_ui.showDialog(); - - AltosRomconfig romconfig = romconfig_ui.romconfig(); - if (romconfig == null || !romconfig.valid()) - return; - flash.set_romconfig(romconfig); - serial_value.setText(String.format("%d", - flash.romconfig().serial_number)); - file_value.setText(file.toString()); - setVisible(true); - flash.flash(); + AltosRomconfig romconfig = romconfig_ui.showDialog(); + + if (romconfig != null && romconfig.valid()) { + flash.set_romconfig(romconfig); + serial_value.setText(String.format("%d", + flash.romconfig().serial_number)); + file_value.setText(file.toString()); + setVisible(true); + flash.flash(); + flash = null; + } } catch (FileNotFoundException ee) { JOptionPane.showMessageDialog(frame, "Cannot open image", @@ -97,6 +97,8 @@ public class AltosFlashUI file.toString(), JOptionPane.ERROR_MESSAGE); } catch (InterruptedException ie) { + } finally { + abort(); } dispose(); } |