Index: trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 4932)
@@ -456,5 +456,5 @@
             if(visible) {
                 new WindowGeometry(rememberSizePref,
-                        defaultWindowGeometry).applySafeMultiScreen(this);
+                        defaultWindowGeometry).applySafe(this);
             } else {
                 new WindowGeometry(this).remember(rememberSizePref);
Index: trunk/src/org/openstreetmap/josm/gui/MainApplet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplet.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplet.java	(revision 4932)
@@ -50,5 +50,4 @@
             setContentPane(contentPanePrivate);
             setJMenuBar(menu);
-            setBounds(bounds);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 4932)
@@ -65,5 +65,5 @@
         mainFrame.setContentPane(contentPanePrivate);
         mainFrame.setJMenuBar(menu);
-        mainFrame.setBounds(bounds);
+        geometry.applySafe(mainFrame);
         LinkedList<Image> l = new LinkedList<Image>();
         l.add(ImageProvider.get("logo_16x16x32").getImage());
@@ -74,5 +74,4 @@
         l.add(ImageProvider.get("logo_48x48x8").getImage());
         l.add(ImageProvider.get("logo").getImage());
-        //mainFrame.setIconImage(ImageProvider.get("logo").getImage());
         mainFrame.setIconImages(l);
         mainFrame.addWindowListener(new WindowAdapter(){
@@ -247,5 +246,4 @@
         monitor.indeterminateSubTask(tr("Setting defaults"));
         preConstructorInit(args);
-        removeObsoletePreferences();
 
         monitor.indeterminateSubTask(tr("Creating main GUI"));
@@ -319,23 +317,4 @@
             RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager());
         }
-
-    }
-
-    /**
-     * Removes obsolete preference settings. If you throw out a once-used preference
-     * setting, add it to the list here with an expiry date (written as comment). If you
-     * see something with an expiry date in the past, remove it from the list.
-     */
-    public static void removeObsoletePreferences() {
-
-        String[] obsolete = {
-                "edit.make-parallel-way-action.snap-threshold"  // 10/2011 - replaced by snap-threshold-percent. Can be removed mid 2012
-        };
-        for (String key : obsolete) {
-            if (Main.pref.hasKey(key)) {
-                Main.pref.removeFromCollection(key, Main.pref.get(key));
-                System.out.println(tr("Preference setting {0} has been removed since it is no longer used.", key));
-            }
-        }
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 4932)
@@ -479,8 +479,8 @@
 
     /**
-     * Returns the current width of the (possibly resized) toggle dialog area
-     */
-    public int getToggleDlgWidth() {
-        return dialogsPanel.getWidth();
+     * Remember the current width of the (possibly resized) toggle dialog area
+     */
+    public void rememberToggleDialogWidth() {
+        Main.pref.putInteger("toggleDialogs.width", dialogsPanel.getWidth());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/SplashScreen.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SplashScreen.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/SplashScreen.java	(revision 4932)
@@ -29,4 +29,5 @@
 import org.openstreetmap.josm.gui.progress.SwingRenderingProgressMonitor;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.WindowGeometry;
 
 /**
@@ -58,4 +59,5 @@
         GridBagConstraints gbc = new GridBagConstraints();
         gbc.gridheight = 2;
+        gbc.insets = new Insets(0, 0, 0, 70);
         innerContentPane.add(logo, gbc);
 
@@ -92,6 +94,5 @@
         pack();
 
-        // Center the splash screen
-        setLocationRelativeTo(null);
+        WindowGeometry.centerOnScreen(this, "gui.geometry");
 
         // Add ability to hide splash screen by clicking it
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 4932)
@@ -51,4 +51,6 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.WindowGeometry;
+import org.openstreetmap.josm.tools.WindowGeometry.WindowGeometryException;
 
 /**
@@ -507,10 +509,7 @@
             });
 
-            String bounds = Main.pref.get(preferencePrefix+".bounds",null);
-            if (bounds != null) {
-                String[] b = bounds.split(",");
-                setBounds(getDetachedGeometry(new Rectangle(
-                        Integer.parseInt(b[0]),Integer.parseInt(b[1]),Integer.parseInt(b[2]),Integer.parseInt(b[3]))));
-            } else {
+            try {
+                new WindowGeometry(preferencePrefix+".geometry").applySafe(this);
+            } catch (WindowGeometryException e) {
                 ToggleDialog.this.setPreferredSize(ToggleDialog.this.getDefaultDetachedSize());
                 pack();
@@ -523,5 +522,5 @@
         protected void rememberGeometry() {
             if (detachedDialog != null) {
-                Main.pref.put(preferencePrefix+".bounds", detachedDialog.getX()+","+detachedDialog.getY()+","+detachedDialog.getWidth()+","+detachedDialog.getHeight());
+                new WindowGeometry(detachedDialog).remember(preferencePrefix+".geometry");
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 4932)
@@ -328,5 +328,5 @@
             boundingBoxChanged(currentBounds,null);
         }
-        else if (Main.pref.hasKey("osm-download.bounds")) {
+        else if (!Main.pref.get("osm-download.bounds").isEmpty()) {
             // read the bounding box from the preferences
             try {
Index: trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java	(revision 4932)
@@ -74,5 +74,5 @@
     public void placeOnScreen(HistoryBrowserDialog dialog) {
         WindowGeometry geometry = WindowGeometry.centerOnScreen(new Dimension(800,500));
-        geometry.apply(dialog);
+        geometry.applySafe(dialog);
         Point p = dialog.getLocation();
         while(hasDialogWithCloseUpperLeftCorner(p)) {
Index: trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 4932)
@@ -75,5 +75,5 @@
     public void setVisible(boolean visible) {
         if (visible) {
-            WindowGeometry.centerInWindow(Main.parent, new Dimension(350,300)).apply(this);
+            WindowGeometry.centerInWindow(Main.parent, new Dimension(350,300)).applySafe(this);
         }
         super.setVisible(visible);
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 4932)
@@ -72,5 +72,5 @@
     protected void build() {
         WindowGeometry geometry = WindowGeometry.centerOnScreen(new Dimension(600,300));
-        geometry.apply(this);
+        geometry.applySafe(this);
         getContentPane().setLayout(new BorderLayout());
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/GPXSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/GPXSettingsPanel.java	(revision 4931)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/GPXSettingsPanel.java	(revision 4932)
@@ -297,6 +297,6 @@
     public void loadPreferences () {
         makeAutoMarkers.setSelected(Main.pref.getBoolean("marker.makeautomarkers", true));
-        if(layerName!=null && !Main.pref.hasKey("draw.rawgps.lines."+layerName)
-                && !Main.pref.hasKey("draw.rawgps.lines.local."+layerName)){
+        if(layerName!=null && Main.pref.get("draw.rawgps.lines."+layerName).isEmpty()
+                && Main.pref.get("draw.rawgps.lines.local."+layerName).isEmpty()){
             // no line preferences for layer is found
             drawRawGpsLinesGlobal.setSelected(true);
@@ -323,5 +323,5 @@
         drawRawGpsLinesActionListener.actionPerformed(null);
 
-        if(layerName!=null && !Main.pref.hasKey("draw.rawgps.colors."+layerName)) {
+        if(layerName!=null && Main.pref.get("draw.rawgps.colors."+layerName).isEmpty()) {
             colorTypeGlobal.setSelected(true);
             colorDynamic.setSelected(false);
