Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/OSGBGrabber.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/OSGBGrabber.java	(revision 15649)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
-package wmsplugin;
-
-import uk.me.jstott.jcoord.OSRef;
-import uk.me.jstott.jcoord.LatLng;
-
-import java.io.IOException;
-
-import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.coor.EastNorth;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.projection.Projection;
-import org.openstreetmap.josm.data.projection.Epsg4326;
-
-// FIXME: Remove this hack when we have proper projection support.
-public class OSGBGrabber extends WMSGrabber {
-    public OSGBGrabber(String baseURL) {
-        super(baseURL);
-    }
-
-    private Epsg4326 latlonProj = new Epsg4326();
-
-    @Override public GeorefImage grab(Bounds b, Projection proj,
-            double pixelPerDegree) throws IOException {
-        Bounds bnew = toOSGB(b);
-        double pixelPerDegreeNew =
-            pixelPerDegree / (bnew.max.lon() - bnew.min.lon())
-                * (b.max.lon() - b.min.lon());
-
-        GeorefImage img = super.grab(bnew, latlonProj, pixelPerDegreeNew);
-
-        img.min = proj.latlon2eastNorth(fromOSGB(img.min));
-        img.max = proj.latlon2eastNorth(fromOSGB(img.max));
-
-        return img;
-    }
-
-    protected static Bounds toOSGB(Bounds b) {
-        LatLng[] lls = new LatLng[] {
-            new LatLng(b.min.lat(), b.min.lon()),
-            new LatLng(b.min.lat(), b.max.lon()),
-            new LatLng(b.max.lat(), b.min.lon()),
-            new LatLng(b.max.lat(), b.max.lon()) };
-
-        for (LatLng ll : lls) ll.toOSGB36();
-
-        OSRef[] grs = new OSRef[lls.length];
-        for (int i = 0; i < lls.length; i++) grs[i] = lls[i].toOSRef();
-
-        LatLon latlon = new LatLon(grs[0].getNorthing(), grs[0].getEasting());
-        Bounds bnew = new Bounds(latlon, latlon);
-        for (int i = 1; i < grs.length; i++)
-            bnew.extend(new LatLon(grs[i].getNorthing(), grs[i].getEasting()));
-
-        return bnew;
-    }
-
-    protected static LatLon fromOSGB(EastNorth en) {
-        LatLng ll = new OSRef(en.east(), en.north()).toLatLng();
-        ll.toWGS84();
-        return new LatLon(ll.getLat(), ll.getLng());
-    }
-}
-*/
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java	(revision 15649)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java	(revision 15707)
@@ -85,5 +85,5 @@
         if (urlWithPatterns) {
             String proj = Main.proj.toCode();
-            if(proj.equals("EPSG:3785")) // don't use mercator code
+            if(Main.proj instanceof org.openstreetmap.josm.data.projection.Mercator) // don't use mercator code directly
                 proj = "EPSG:4326";
 
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java	(revision 15649)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java	(revision 15707)
@@ -23,8 +23,7 @@
 import javax.swing.JOptionPane;
 import javax.swing.JSeparator;
-import javax.swing.filechooser.FileFilter;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.ExtensionFileFilter;
+import org.openstreetmap.josm.actions.DiskAccessAction;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -295,5 +294,6 @@
         }
         public void actionPerformed(ActionEvent ev) {
-            File f = openFileDialog(false);
+            File f = DiskAccessAction.createAndOpenSaveFileChooser(
+            tr("Save WMS layer"), ".wms");
             try
             {
@@ -322,5 +322,8 @@
         }
         public void actionPerformed(ActionEvent ev) {
-            File f = openFileDialog(true);
+            JFileChooser fc = DiskAccessAction.createAndOpenFileChooser(true,
+            false, tr("Load WMS layer"));
+            if(fc == null) return;
+            File f = fc.getSelectedFile();
             if (f == null) return;
             try
@@ -359,49 +362,3 @@
         }
     }
-
-    protected static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple) {
-        String curDir = Main.pref.get("lastDirectory");
-        if (curDir.equals(""))
-            curDir = ".";
-        JFileChooser fc = new JFileChooser(new File(curDir));
-        fc.setMultiSelectionEnabled(multiple);
-        for (int i = 0; i < ExtensionFileFilter.filters.length; ++i)
-            fc.addChoosableFileFilter(ExtensionFileFilter.filters[i]);
-        fc.setAcceptAllFileFilterUsed(true);
-
-        int answer = open ? fc.showOpenDialog(Main.parent) : fc.showSaveDialog(Main.parent);
-        if (answer != JFileChooser.APPROVE_OPTION)
-            return null;
-
-        if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir))
-            Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
-
-        if (!open) {
-            File file = fc.getSelectedFile();
-            if (file == null || (file.exists() && JOptionPane.YES_OPTION !=
-                JOptionPane.showConfirmDialog(Main.parent, tr("File exists. Overwrite?"), tr("Overwrite"), JOptionPane.YES_NO_OPTION)))
-                return null;
-        }
-
-        return fc;
-    }
-
-    public static File openFileDialog(boolean open) {
-        JFileChooser fc = createAndOpenFileChooser(open, false);
-        if (fc == null)
-            return null;
-
-        File file = fc.getSelectedFile();
-
-        String fn = file.getPath();
-        if (fn.indexOf('.') == -1) {
-            FileFilter ff = fc.getFileFilter();
-            if (ff instanceof ExtensionFileFilter)
-                fn = "." + ((ExtensionFileFilter)ff).defaultExtension;
-            else
-                fn += ".osm";
-            file = new File(fn);
-        }
-        return file;
-    }
 }
