Index: /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 5585)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 5586)
@@ -11,4 +11,5 @@
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
+import java.awt.Image;
 import java.awt.Insets;
 import java.awt.Rectangle;
@@ -45,4 +46,6 @@
 import javax.swing.DefaultListModel;
 import javax.swing.DefaultListSelectionModel;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
@@ -75,4 +78,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.ExtensionFileFilter;
+import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
@@ -85,4 +89,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.LanguageInfo;
+import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
 
@@ -628,9 +633,9 @@
         public String link;
         public String description;
+        public Integer minJosmVersion;
 
         public ExtendedSourceEntry(String simpleFileName, String url) {
             super(url, null, null, true);
             this.simpleFileName = simpleFileName;
-            version = author = link = description = title = null;
         }
 
@@ -661,4 +666,7 @@
             if (version != null) {
                 appendRow(s, tr("Version:"), version);
+            }
+            if (minJosmVersion != null) {
+                appendRow(s, tr("Minimum JOSM Version:"), Integer.toString(minJosmVersion));
             }
             return "<html><style>th{text-align:right}td{width:400px}</style>"
@@ -925,4 +933,35 @@
         public void actionPerformed(ActionEvent e) {
             List<ExtendedSourceEntry> sources = availableSourcesModel.getSelected();
+            int josmVersion = Version.getInstance().getVersion();
+            if (josmVersion != Version.JOSM_UNKNOWN_VERSION) {
+                Collection<String> messages = new ArrayList<String>();
+                for (ExtendedSourceEntry entry : sources) {
+                    if (entry.minJosmVersion != null && entry.minJosmVersion > josmVersion) {
+                        messages.add(tr("Entry ''{0}'' requires JOSM Version {1}. (Currently running: {2})",
+                                entry.title,
+                                Integer.toString(entry.minJosmVersion),
+                                Integer.toString(josmVersion))
+                        );
+                    }
+                }
+                if (!messages.isEmpty()) {
+                    ExtendedDialog dlg = new ExtendedDialog(Main.parent, tr("Warning"), new String [] { tr("Cancel"), tr("Continue anyway") });
+                    dlg.setButtonIcons(new Icon[] {
+                        ImageProvider.get("cancel"),
+                        ImageProvider.overlay(
+                            ImageProvider.get("ok"),
+                            new ImageIcon(ImageProvider.get("warning-small").getImage().getScaledInstance(12 , 12, Image.SCALE_SMOOTH)),
+                            ImageProvider.OverlayPosition.SOUTHEAST)
+                    });
+                    dlg.setToolTipTexts(new String[] {
+                        tr("Cancel and return to the previous dialog"),
+                        tr("Ignore warning and install style anyway")});
+                    dlg.setContent("<html>" + tr("Some entries have unmet dependencies:") +
+                            "<br>" + Utils.join("<br>", messages) + "</html>");
+                    dlg.setIcon(JOptionPane.WARNING_MESSAGE);
+                    if (dlg.showDialog().getValue() != 2)
+                        return;
+                }
+            }
             activeSourcesModel.addExtendedSourceEntries(sources);
         }
@@ -1236,4 +1275,10 @@
                             } else if ((lang + "description").equals(key)) {
                                 last.description = value;
+                            } else if ("min-josm-version".equals(key)) {
+                                try {
+                                    last.minJosmVersion = Integer.parseInt(value);
+                                } catch (NumberFormatException e) {
+                                    // ignore
+                                }
                             }
                         }
