Index: /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java	(revision 1644)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java	(revision 1645)
@@ -29,5 +29,7 @@
 import javax.swing.JOptionPane;
 
+import org.openstreetmap.josm.actions.AboutAction;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.xml.sax.SAXException;
@@ -62,5 +64,5 @@
             for (PluginInformation d : toUpdate) {
                 File pluginFile = new File(pluginDir, d.name + ".jar.new");
-                if (download(d.downloadlink, pluginFile))
+                if (download(d, pluginFile))
                     count++;
                 else
@@ -101,11 +103,7 @@
     }
 
-    private static String escape(String s) {
-        return s.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
-    }
-
     public static boolean downloadPlugin(PluginInformation pd) {
         File file = new File(Main.pref.getPluginsDirFile(), pd.name + ".jar");
-        if (!download(pd.downloadlink, file)) {
+        if (!download(pd, file)) {
             JOptionPane.showMessageDialog(Main.parent, tr("Could not download plugin: {0} from {1}", pd.name, pd.downloadlink));
         } else {
@@ -123,7 +121,18 @@
     }
 
-    private static boolean download(String url, File file) {
+    private static boolean download(PluginInformation pd, File file) {
+        if(pd.mainversion > AboutAction.getVersionNumber())
+        {
+            int answer = new ExtendedDialog(Main.parent,
+                        tr("Skip download"),
+                        tr("JOSM version {0} required for plugin {1}.", pd.mainversion, pd.name),
+                        new String[] {tr("Download Plugin"), tr("Skip Download")},
+                        new String[] {"download.png", "cancel.png"}).getValue();
+            if (answer != 1)
+                return false;
+        }
+
         try {
-            InputStream in = new URL(url).openStream();
+            InputStream in = new URL(pd.downloadlink).openStream();
             OutputStream out = new FileOutputStream(file);
             byte[] buffer = new byte[8192];
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 1644)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 1645)
@@ -76,15 +76,8 @@
                 if (info.early != early)
                     continue;
-                if (info.mainversion != null) {
-                    int requiredJOSMVersion = 0;
-                    try {
-                        requiredJOSMVersion = Integer.parseInt(info.mainversion);
-                    } catch(NumberFormatException e) {
-                        e.printStackTrace();
-                    }
-                    if (requiredJOSMVersion > AboutAction.getVersionNumber()) {
-                        JOptionPane.showMessageDialog(Main.parent, tr("Plugin requires JOSM update: {0}.", pluginName));
-                        continue;
-                    }
+                if (info.mainversion > AboutAction.getVersionNumber()) {
+                    JOptionPane.showMessageDialog(Main.parent, tr("Plugin {0} requires JOSM update to version {1}.", pluginName,
+                    info.mainversion));
+                    continue;
                 }
                 if(info.requires != null)
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 1644)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 1645)
@@ -31,5 +31,5 @@
     public File file = null;
     public String name = null;
-    public String mainversion = null;
+    public int mainversion = 0;
     public String className = null;
     public String requires = null;
@@ -110,5 +110,9 @@
         stage = stageStr == null ? 50 : Integer.parseInt(stageStr);
         version = attr.getValue("Plugin-Version");
-        mainversion = attr.getValue("Plugin-Mainversion");
+        try {
+            mainversion = Integer.parseInt(attr.getValue("Plugin-Mainversion"));
+        } catch(NumberFormatException e) {
+            e.printStackTrace();
+        }
         author = attr.getValue("Author");
 
