Changeset 2025 in josm for trunk/src/org/openstreetmap/josm/gui/MainApplication.java
- Timestamp:
- 2009-09-02T21:17:52+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r2017 r2025 47 47 mainFrame.addWindowListener(new WindowAdapter(){ 48 48 @Override public void windowClosing(final WindowEvent arg0) { 49 if ( Main.breakBecauseUnsavedChanges())49 if (!Main.saveUnsavedModifications()) 50 50 return; 51 51 Main.saveGuiGeometry(); … … 73 73 final Map<String, Collection<String>> args = new HashMap<String, Collection<String>>(); 74 74 for (String arg : argArray) { 75 if (!arg.startsWith("--")) 75 if (!arg.startsWith("--")) { 76 76 arg = "--download="+arg; 77 } 77 78 int i = arg.indexOf('='); 78 79 String key = i == -1 ? arg.substring(2) : arg.substring(2,i); 79 80 String value = i == -1 ? "" : arg.substring(i+1); 80 81 Collection<String> v = args.get(key); 81 if (v == null) 82 if (v == null) { 82 83 v = new LinkedList<String>(); 84 } 83 85 v.add(value); 84 86 args.put(key, v); … … 88 90 89 91 // Check if passed as parameter 90 if (args.containsKey("language")) 92 if (args.containsKey("language")) { 91 93 I18n.set((String)(args.get("language").toArray()[0])); 92 else94 } else { 93 95 I18n.set(Main.pref.get("language", null)); 96 } 94 97 95 98 if (argList.contains("--help") || argList.contains("-?") || argList.contains("-h")) { … … 143 146 144 147 if (((!args.containsKey("no-maximize") && !args.containsKey("geometry") 145 && Main.pref.get("gui.geometry").length() == 0) || args.containsKey("maximize"))146 && Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH))148 && Main.pref.get("gui.geometry").length() == 0) || args.containsKey("maximize")) 149 && Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH)) { 147 150 mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); 151 } 148 152 149 153 EventQueue.invokeLater(new Runnable() { … … 161 165 public static void removeObsoletePreferences() { 162 166 String[] obsolete = { 163 "sample.preference.that.does.not.exist", // sample comment, expiry date should go here164 "osm-server.version", // remove this around 10/2009165 "osm-server.additional-versions", // remove this around 10/2009166 null167 "sample.preference.that.does.not.exist", // sample comment, expiry date should go here 168 "osm-server.version", // remove this around 10/2009 169 "osm-server.additional-versions", // remove this around 10/2009 170 null 167 171 }; 168 172 for (String i : obsolete) { 169 if (i == null) continue; 173 if (i == null) { 174 continue; 175 } 170 176 if (Main.pref.hasKey(i)) { 171 177 Main.pref.removeFromCollection(i, Main.pref.get(i));
Note:
See TracChangeset
for help on using the changeset viewer.