altosui: Post error dialog on invalid ROM config values.
authorKeith Packard <keithp@keithp.com>
Thu, 2 Sep 2010 05:56:34 +0000 (22:56 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 3 Sep 2010 14:04:28 +0000 (07:04 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/altosui/AltosRomconfigUI.java

index 10b3af8..2134975 100644 (file)
@@ -134,8 +134,17 @@ public class AltosRomconfigUI
        public void actionPerformed(ActionEvent e) {
                String  cmd = e.getActionCommand();
 
-               if (cmd.equals("ok"))
+               if (cmd.equals("ok")) {
+                       AltosRomconfig  romconfig = romconfig();
+                       if (romconfig == null || !romconfig.valid()) {
+                               JOptionPane.showMessageDialog(this,
+                                                             "Invalid serial number or radio calibration value",
+                                                             "Invalid rom configuration",
+                                                             JOptionPane.ERROR_MESSAGE);
+                               return;
+                       }
                        selected = true;
+               }
                setVisible(false);
        }