Index: applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java
===================================================================
--- applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java	(revision 27868)
+++ applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java	(revision 29228)
@@ -14,4 +14,5 @@
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -24,6 +25,11 @@
 import java.util.TreeMap;
 
+import javax.swing.AbstractAction;
+import javax.swing.Action;
 import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.JButton;
 import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
 import javax.swing.JComponent;
 import javax.swing.JEditorPane;
@@ -31,4 +37,5 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
 import javax.swing.JTable;
 import javax.swing.JTextField;
@@ -52,4 +59,5 @@
 import org.openstreetmap.josm.gui.MultiSplitLayout;
 import org.openstreetmap.josm.gui.MultiSplitPane;
+import org.openstreetmap.josm.plugins.roadsigns.RoadSignsPlugin.PresetMetaData;
 import org.openstreetmap.josm.plugins.roadsigns.Sign.SignParameter;
 import org.openstreetmap.josm.plugins.roadsigns.Sign.Tag;
@@ -72,6 +80,6 @@
  */
 class RoadSignInputDialog extends ExtendedDialog {
-    protected final SignSelection sel;
-    protected final List<Sign> signs;
+    protected SignSelection sel;
+    protected List<Sign> signs;
     protected JTable previewTable;
     protected JCheckBox addTrafficSignTag;
@@ -84,10 +92,21 @@
     protected JScrollPane scrollInfo;
 
-    public RoadSignInputDialog(List<Sign> signs) {
+    public RoadSignInputDialog() {
         super(Main.parent, tr("Road Sign Plugin"), new String[] {tr("OK"), tr("Cancel")}, false /* modal */);
-        this.signs = signs;
+        this.signs = RoadSignsPlugin.signs;
         sel = new SignSelection();
         setButtonIcons(new String[] { "ok.png", "cancel.png" });
-        setContent(buildPanel(), false);
+        final JTabbedPane tabs = new JTabbedPane();
+        tabs.add(tr("signs"), buildSignsPanel());
+        Action updateAction = new AbstractAction() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                RoadSignInputDialog.this.signs = RoadSignsPlugin.signs;
+                sel = new SignSelection();
+                tabs.setComponentAt(0, buildSignsPanel());
+            }
+        };
+        tabs.add(tr("settings"), new SettingsPanel(false, updateAction));
+        setContent(tabs, false);
     }
 
@@ -96,5 +115,5 @@
         if (i == 0) { // OK Button
             Collection<OsmPrimitive> selPrim = Main.main.getCurrentDataSet().getSelected();
-            if (selPrim.size() != 0) {
+            if (!selPrim.isEmpty()) {
                 Main.pref.put("plugin.roadsigns.addTrafficSignTag", addTrafficSignTag.isSelected());
 
@@ -115,5 +134,5 @@
             cmds.add(new ChangePropertyCommand(selPrim, key, value));
         }
-        if (cmds.size() == 0)
+        if (cmds.isEmpty())
             return null;
         else if (cmds.size() == 1)
@@ -123,5 +142,5 @@
     }
 
-    private JComponent buildPanel() {
+    private JComponent buildSignsPanel() {
         String layoutDef =
             "(COLUMN "+
@@ -162,5 +181,5 @@
                 if (e == null || e.getURL() == null)
                     return;
-                System.err.println(e.getURL());
+                System.out.println(e.getURL());
                 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                     OpenBrowser.displayUrl(e.getURL().toString());
@@ -263,7 +282,6 @@
         private Pair<Integer, Integer> findIndex(SignWrapper swFind) {
             int selIdx=0;
-            int combIdx=0;
             for (SignCombination sc : combos) {
-                combIdx=0;
+                int combIdx=0;
                 for (SignWrapper sw : sc.signs) {
                     if (swFind == sw) {
@@ -717,5 +735,5 @@
 
             if (sign.wiki != null || sign.loc_wiki != null) {
-                String wikiPrefix = Main.main.pref.get("plugin.roadsigns.wikiprefix", "http://wiki.openstreetmap.org/wiki/");
+                String wikiPrefix = Main.pref.get("plugin.roadsigns.wikiprefix", "http://wiki.openstreetmap.org/wiki/");
                 txt.append("<p>");
                 if (sign.loc_wiki != null) {
@@ -791,3 +809,46 @@
         }
     }
+
+    public static class SettingsPanel extends JPanel {
+
+        private List<PresetMetaData> presetsData;
+        private JComboBox selectionBox;
+
+        public SettingsPanel(boolean standalone, final Action update) {
+            super(new GridBagLayout());
+            presetsData = RoadSignsPlugin.getAvailablePresetsMetaData();
+
+            selectionBox = new JComboBox(presetsData.toArray());
+            String code = Main.pref.get("plugin.roadsigns.preset.selection", null);
+            if (code != null) {
+                for (PresetMetaData data : presetsData) {
+                    if (code.equals(data.code)) {
+                        selectionBox.setSelectedItem(data);
+                    }
+                }
+            }
+            this.add(new JLabel(tr("Country preset:")), GBC.std().insets(5, 5, 5, 5));
+            this.add(selectionBox, GBC.eol().insets(0, 5, 5, 5));
+            if (!standalone) {
+                JButton apply = new JButton(new AbstractAction(tr("Apply")) {
+                    @Override
+                    public void actionPerformed(ActionEvent e) {
+                        try {
+                            apply();
+                        } catch (IOException ex) {
+                            return;
+                        }
+                        update.actionPerformed(null);
+                    }
+                });
+                this.add(apply, GBC.eol().insets(5, 0, 5, 5));
+            }
+            this.add(Box.createVerticalGlue(), GBC.eol().fill());
+        }
+
+        public void apply() throws IOException {
+            RoadSignsPlugin.setSelectedPreset(presetsData.get(selectionBox.getSelectedIndex()));
+        }
+    }
+
 }
Index: applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsPlugin.java
===================================================================
--- applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsPlugin.java	(revision 27868)
+++ applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsPlugin.java	(revision 29228)
@@ -8,10 +8,13 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Collections;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.List;
 
@@ -24,14 +27,23 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.data.Preferences.pref;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog;
 import org.openstreetmap.josm.io.MirroredInputStream;
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginInformation;
+import org.openstreetmap.josm.plugins.roadsigns.RoadSignInputDialog.SettingsPanel;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.Utils;
 
 public class RoadSignsPlugin extends Plugin {
-    private static boolean presetsLoaded = false;
+    static PresetMetaData selectedPreset;
     public static List<Sign> signs;
-    static List<String> iconDirs;
+    public static List<String> iconDirs;
+
+    public final static PresetMetaData PRESET_DE = new PresetMetaData("DE", tr("Germany"), "resource://data/roadsignpresetDE.xml", "resource://images/DE/");
+    public final static PresetMetaData PRESET_PL = new PresetMetaData("PL", tr("Poland"), "resource://data/roadsignpresetPL.xml", "resource://images/PL/");
+    public final static PresetMetaData PRESET_SK = new PresetMetaData("SK", tr("Slovakia"), "resource://data/roadsignpresetSK.xml", "resource://images/SK/");
+    public final static Collection<PresetMetaData> DEFAULT_PRESETS = Arrays.asList(PRESET_DE, PRESET_PL, PRESET_SK);
 
     public RoadSignsPlugin(PluginInformation info) {
@@ -56,6 +68,24 @@
 
         public void actionPerformed(ActionEvent e) {
-            loadSignPresets();
-            RoadSignInputDialog input = new RoadSignInputDialog(signs);
+            String code = Main.pref.get("plugin.roadsigns.preset.selection", null);
+            if (code == null) {
+                ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Settings"), new String[] { tr("Ok"), tr("Cancel") });
+                ed.setButtonIcons(new String[] {"ok", "cancel"});
+                SettingsPanel settings = new SettingsPanel(true, null);
+                ed.setContent(settings);
+                ed.showDialog();
+                if (ed.getValue() != 1) return;
+                try {
+                    settings.apply();
+                } catch (IOException ex) {
+                    return;
+                }
+            }
+            try {
+                loadSignPreset();
+            } catch (IOException ex) {
+                return;
+            }
+            RoadSignInputDialog input = new RoadSignInputDialog();
             input.showDialog();
         }
@@ -63,41 +93,135 @@
     }
 
-    protected static void loadSignPresets() {
-        if (presetsLoaded)
-            return;
-        presetsLoaded=true;
-        List<String> files = new ArrayList<String>(
-                Main.pref.getCollection("plugin.roadsigns.sources",
-                    Collections.<String>singletonList("resource://data/defaultroadsignpreset.xml")));
-        iconDirs = new ArrayList<String>(
-                Main.pref.getCollection("plugin.roadsigns.icon.sources", Collections.<String>emptySet()));
-
-        if (Main.pref.getBoolean("plugin.roadsigns.use_default_icon_source", true)) {
-            iconDirs.add("resource://images/");
-        }
-
-        for (String source : files) {
-            try {
-                InputStream in = getInputStream(source);
-                RoadSignsReader reader = new RoadSignsReader(in);
-                signs = reader.parse();
-
-            } catch (IOException ex) {
-                ex.printStackTrace();
-                JOptionPane.showMessageDialog(
-                        Main.parent,
-                        tr("Could not read tagging preset source: ''{0}''",source),
-                        tr("Error"),
-                        JOptionPane.ERROR_MESSAGE
-                );
-            } catch (SAXException ex) {
-                ex.printStackTrace();
-                JOptionPane.showMessageDialog(
-                        Main.parent,
-                        tr("Error parsing tagging preset from ''{0}'':\n", source)+ex.getMessage(),
-                        tr("Error"),
-                        JOptionPane.ERROR_MESSAGE
-                );
-            }
+    public static class PresetMetaData {
+        @pref public String code;
+        @pref public String display_name;
+        @pref public String preset_path;
+        @pref public String icon_path;
+
+        public PresetMetaData() {
+        }
+
+        public PresetMetaData(String country_code, String display_name, String preset_path, String icons_path) {
+            this.code = country_code;
+            this.display_name = display_name;
+            this.preset_path = preset_path;
+            this.icon_path = icons_path;
+        }
+
+        @Override
+        public String toString() {
+            return display_name;
+        }
+    }
+
+    public static void setSelectedPreset(PresetMetaData preset) throws IOException {
+        Main.pref.put("plugin.roadsigns.preset.selection", preset.code);
+        loadSignPreset();
+    }
+
+    public static List<PresetMetaData> getAvailablePresetsMetaData() {
+
+        List<PresetMetaData> presetsData = Main.pref.getListOfStructs("plugin.roadsigns.presets", DEFAULT_PRESETS, PresetMetaData.class);
+
+        String customFile = Main.pref.get("plugin.roadsigns.sources", null);
+        if (customFile == null) {
+            // for legacy reasons, try both string and collection preference type
+            Collection<String> customFiles = Main.pref.getCollection("plugin.roadsigns.sources", null);
+            if (customFiles != null && !customFiles.isEmpty()) {
+                customFile = customFiles.iterator().next();
+            }
+        }
+
+        if (customFile != null) {
+            // first check, if custom file preference has changed. If yes,
+            // change the current preset selection to custom directly
+            String lastCustomFile = Main.pref.get("plugin.roadsigns.sources.last", null);
+            if (!Utils.equal(customFile, lastCustomFile)) {
+                Main.pref.put("plugin.roadsigns.sources.last", customFile);
+                Main.pref.put("plugin.roadsigns.preset.selection", "custom");
+            }
+
+            String customIconDirsStr = Main.pref.get("plugin.roadsigns.icon.sources", null);
+            Collection<String> customIconDirs = null;
+            if (customIconDirsStr != null) {
+                customIconDirs = new ArrayList<String>(Arrays.asList(customIconDirsStr.split(",")));
+            } else {
+                customIconDirs = Main.pref.getCollection("plugin.roadsigns.icon.sources", null);
+            }
+            if (customIconDirs != null) {
+                customIconDirs = new ArrayList<String>(customIconDirs);
+            } else {
+                customIconDirs = new ArrayList<String>();
+            }
+            // add icon directory relative to preset file
+            if (!customFile.startsWith("resource:")) {
+                String parentDir = null;
+                try {
+                    URL url = new URL(customFile);
+                    parentDir = url.getPath();
+                } catch (MalformedURLException ex) {
+                    File f = new File(customFile);
+                    parentDir = f.getParent();
+                }
+                if (parentDir != null && !parentDir.isEmpty()) {
+                    customIconDirs.add(parentDir);
+                }
+            }
+            if (Main.pref.getBoolean("plugin.roadsigns.use_default_icon_source", true)) {
+                customIconDirs.add("resource://images/");
+            }
+            PresetMetaData custom = new PresetMetaData("custom", tr("custom"), customFile, Utils.join(",", customIconDirs));
+            presetsData.add(custom);
+        } else {
+            Main.pref.put("plugin.roadsigns.sources.last", null);
+        }
+
+        return presetsData;
+    }
+
+    protected static void loadSignPreset() throws IOException {
+        List<PresetMetaData> presetsData =  getAvailablePresetsMetaData();
+        String code = Main.pref.get("plugin.roadsigns.preset.selection", null);
+        if (selectedPreset != null && selectedPreset.code.equals(code)) return;
+
+        for (PresetMetaData data : presetsData) {
+            if (data.code.equals(code)) {
+                selectedPreset = data;
+                break;
+            }
+        }
+        if (selectedPreset == null) {
+            if (!presetsData.isEmpty()) {
+                selectedPreset = presetsData.get(0);
+            } else {
+                selectedPreset = PRESET_DE;
+            }
+        }
+        iconDirs = Arrays.asList(selectedPreset.icon_path.split(","));
+        String source = selectedPreset.preset_path;
+
+        try {
+            InputStream in = getInputStream(source);
+            RoadSignsReader reader = new RoadSignsReader(in);
+            signs = reader.parse();
+
+        } catch (IOException ex) {
+            ex.printStackTrace();
+            JOptionPane.showMessageDialog(
+                    Main.parent,
+                    tr("Could not read tagging preset source: ''{0}''",source),
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE
+            );
+            throw ex;
+        } catch (SAXException ex) {
+            ex.printStackTrace();
+            JOptionPane.showMessageDialog(
+                    Main.parent,
+                    tr("Error parsing tagging preset from ''{0}'':\n", source)+ex.getMessage(),
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE
+            );
+            throw new IOException(ex);
         }
     }
