From d93787284c8e514a929edb9f944c98ae0206a33f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 24 Aug 2010 03:59:09 -0700 Subject: altosui: Delay mapping Flash UI until flashing actually starts The flash operation may be abandoned before it even starts; this makes sure the UI doesn't flash up on the screen. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosFlashUI.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ao-tools/altosui/AltosFlashUI.java') diff --git a/ao-tools/altosui/AltosFlashUI.java b/ao-tools/altosui/AltosFlashUI.java index 0c2041e3..b88a16b3 100644 --- a/ao-tools/altosui/AltosFlashUI.java +++ b/ao-tools/altosui/AltosFlashUI.java @@ -57,8 +57,10 @@ public class AltosFlashUI } else { String cmd = e.getActionCommand(); if (cmd.equals("done")) - dispose(); - else { + ; + else if (cmd.equals("start")) { + setVisible(true); + } else { pbar.setValue(e.getID()); pbar.setString(cmd); } @@ -88,15 +90,14 @@ public class AltosFlashUI "Cannot open image", file.toString(), JOptionPane.ERROR_MESSAGE); - return; } catch (IOException e) { JOptionPane.showMessageDialog(frame, e.getMessage(), file.toString(), JOptionPane.ERROR_MESSAGE); - return; } catch (InterruptedException ie) { } + dispose(); } public void abort() { -- cgit v1.2.3 From 220f3afdaa432c65f8ad45be7cdbe5c8a3616db3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 24 Aug 2010 04:01:47 -0700 Subject: altosui: always display romconfig ui while flashing --- ao-tools/altosui/AltosFlashUI.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'ao-tools/altosui/AltosFlashUI.java') diff --git a/ao-tools/altosui/AltosFlashUI.java b/ao-tools/altosui/AltosFlashUI.java index b88a16b3..73a97a6b 100644 --- a/ao-tools/altosui/AltosFlashUI.java +++ b/ao-tools/altosui/AltosFlashUI.java @@ -72,14 +72,15 @@ public class AltosFlashUI flash.addActionListener(this); try { flash.open(); - if (!flash.check_rom_config()) { - AltosRomconfigUI romconfig_ui = new AltosRomconfigUI (frame); - romconfig_ui.showDialog(); - AltosRomconfig romconfig = romconfig_ui.romconfig(); - if (romconfig == null) - return; - flash.set_romconfig(romconfig); - } + 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()); -- cgit v1.2.3