Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java	(revision 6777)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java	(revision 6780)
@@ -35,29 +35,5 @@
 	@Override protected void finish() {}
 
-	public static void download(String name, String wmsurl,
-			Bounds b, double pixelPerDegree) {
-		WMSLayer wmsLayer = null;
-
-		// simply check if we already have a layer created. if not, create; if yes, reuse.
-		for (Layer l : Main.main.map.mapView.getAllLayers()) {
-			if (l instanceof WMSLayer && l.name.equals(name)) {
-				wmsLayer = (WMSLayer) l;
-			}
-		}
-
-		// FIXME: move this to WMSPlugin/WMSInfo/preferences.
-		if (wmsLayer == null) {
-			if (wmsurl.matches("(?i).*layers=npeoocmap.*") || wmsurl.matches("(?i).*layers=npe.*") ){
-				wmsLayer = new WMSLayer(name, new OSGBGrabber(wmsurl));
-			} else {
-				wmsLayer = new WMSLayer(name, new WMSGrabber(wmsurl));
-			}
-			Main.main.addLayer(wmsLayer);
-		} 
-
-		Main.worker.execute(new DownloadWMSTask(wmsLayer, b, pixelPerDegree));
-	}
-
-	public static void download(String name, String wmsurl) {
+	public static void download(WMSLayer wmsLayer) {
 		MapView mv = Main.map.mapView;
 
@@ -66,5 +42,6 @@
 			mv.getLatLon(mv.getWidth(), 0));
 
-		download(name, wmsurl, b, mv.getWidth() / (b.max.lon() - b.min.lon()));
+		Main.worker.execute(new DownloadWMSTask(wmsLayer, b,
+			mv.getWidth() / (b.max.lon() - b.min.lon())));
 	}
 }
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java	(revision 6777)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java	(revision 6780)
@@ -6,4 +6,5 @@
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.layer.Layer;
 
 public class WMSDownloadAction extends JosmAction {
@@ -19,7 +20,19 @@
 		System.out.println(info.url);
 		
-		MapView mv = Main.map.mapView;
-		
-		DownloadWMSTask.download(info.name, info.url);
+		DownloadWMSTask.download(getLayer(info));
+	}
+
+	public static WMSLayer getLayer(WMSInfo info) {
+		// simply check if we already have a layer created. if not, create; if yes, reuse.
+		for (Layer l : Main.main.map.mapView.getAllLayers()) {
+			if (l instanceof WMSLayer && l.name.equals(info.name)) {
+				return (WMSLayer) l;
+			}
+		}
+
+		// FIXME: move this to WMSPlugin/WMSInfo/preferences.
+		WMSLayer wmsLayer = new WMSLayer(info.name, info.grabber);
+		Main.main.addLayer(wmsLayer);
+		return wmsLayer;
 	}
 };
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSInfo.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSInfo.java	(revision 6777)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSInfo.java	(revision 6780)
@@ -12,8 +12,14 @@
 	String name;
 	String url;
+	Grabber grabber;
 	int prefid;
 	
+	public WMSInfo(String name, String url, Grabber grabber, int prefid) {
+		this.name=name; this.url=url; this.prefid=prefid;
+		this.grabber = grabber;
+	}
+
 	public WMSInfo(String name, String url, int prefid) {
-		this.name=name; this.url=url; this.prefid=prefid;
+		this(name, url, WMSPlugin.getGrabber(url), prefid);
 	}
 	
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 6777)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 6780)
@@ -120,4 +120,12 @@
 		setEnabledAll(false);
 	}
+
+	public static Grabber getGrabber(String wmsurl) {
+		if (wmsurl.matches("(?i).*layers=npeoocmap.*") || wmsurl.matches("(?i).*layers=npe.*") ){
+			return new OSGBGrabber(wmsurl);
+		} else {
+			return new WMSGrabber(wmsurl);
+		}
+	}
 	
 	private static void setEnabledAll(boolean isEnabled) {
