Updates for 0.9.5
[debian/openrocket] / src / net / sf / openrocket / gui / dialogs / preferences / PreferencesDialog.java
index f2ed0ef2ab2579d0f2ae5cc76e7a01438c16c4dd..0f46cfe9772b8d759117e4edcd0dda7881c15a99 100644 (file)
@@ -259,6 +259,10 @@ public class PreferencesDialog extends JDialog {
                }
                @Override
                public void setSelectedItem(Object item) {
+                       if (item == null) {
+                               // Clear selection - huh?
+                               return;
+                       }
                        if (!(item instanceof Unit)) {
                                throw new IllegalArgumentException("Illegal argument "+item);
                        }
@@ -297,6 +301,10 @@ public class PreferencesDialog extends JDialog {
                
                @Override
                public void setSelectedItem(Object item) {
+                       if (item == null) {
+                               // Clear selection - huh?
+                               return;
+                       }
                        if (!(item instanceof String)) {
                                throw new IllegalArgumentException("Illegal argument "+item);
                        }
@@ -347,6 +355,10 @@ public class PreferencesDialog extends JDialog {
                
                @Override
                public void setSelectedItem(Object item) {
+                       if (item == null) {
+                               // Clear selection - huh?
+                               return;
+                       }
                        if (!(item instanceof String)) {
                                throw new IllegalArgumentException("Illegal argument "+item);
                        }
@@ -442,7 +454,13 @@ public class PreferencesDialog extends JDialog {
                                        "You are running the latest version of OpenRocket.", 
                                        "No updates available", JOptionPane.INFORMATION_MESSAGE, null);
                } else {
-                       new UpdateInfoDialog(info).setVisible(true);
+                       UpdateInfoDialog infoDialog = new UpdateInfoDialog(info);
+                       infoDialog.setVisible(true);
+                       if (infoDialog.isReminderSelected()) {
+                               Prefs.putString(Prefs.LAST_UPDATE, "");
+                       } else {
+                               Prefs.putString(Prefs.LAST_UPDATE, info.getLatestVersion());
+                       }
                }
                
        }