diff options
| author | Bdale Garbee <bdale@gag.com> | 2010-08-27 03:08:53 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2010-08-27 03:08:53 -0600 | 
| commit | c443f43f8dee6e0fcbcecf9d09e948fd928b7af4 (patch) | |
| tree | 653fe6ba91e165aaf8a6b4eef17602c5f1bd62a9 /ao-tools/altosui/AltosFlashUI.java | |
| parent | 295043112ccde35092945c286596f9045ee6fa05 (diff) | |
| parent | 2923cf5057f9cef110dd547d8677ea5b60e00796 (diff) | |
Merge branch 'new-packet-format' of ssh://git.gag.com/scm/git/fw/altos into new-package-format
Diffstat (limited to 'ao-tools/altosui/AltosFlashUI.java')
| -rw-r--r-- | ao-tools/altosui/AltosFlashUI.java | 26 | 
1 files changed, 14 insertions, 12 deletions
| diff --git a/ao-tools/altosui/AltosFlashUI.java b/ao-tools/altosui/AltosFlashUI.java index 0c2041e3..73a97a6b 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);  			} @@ -70,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()); @@ -88,15 +91,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() { | 
