Index: /applications/editors/josm/plugins/utilsplugin2/build.xml
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/build.xml	(revision 26638)
+++ /applications/editors/josm/plugins/utilsplugin2/build.xml	(revision 26639)
@@ -30,5 +30,5 @@
 <project name="utilsplugin2" default="dist" basedir=".">
     <!-- enter the SVN commit message -->
-    <property name="commit.message" value="Utilsplugin2: added setting tab"/>
+    <property name="commit.message" value="Utilsplugin2: configuring custom URLs"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="4395"/>
Index: /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java	(revision 26638)
+++ /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java	(revision 26639)
@@ -10,11 +10,12 @@
 import java.awt.event.KeyEvent;
 import java.net.URLEncoder;
-import java.util.ArrayList;
 import java.util.Collection;
 
+import java.util.List;
 import java.util.regex.Matcher;
 
 import java.util.regex.Pattern;
 import javax.swing.BorderFactory;
+import javax.swing.JComboBox;
 import javax.swing.JOptionPane;
 
@@ -63,4 +64,6 @@
             return;
         }
+        if (Main.pref.getBoolean("utilsplugin2.askurl",false)==true) 
+            ChooseURLAction.showConfigDialog();
         
         String addr = Main.pref.get("utilsplugin2.customurl", defaultURL);
@@ -122,3 +125,4 @@
         setEnabled(selection != null );
     }
+
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java	(revision 26638)
+++ /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java	(revision 26639)
@@ -10,4 +10,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.gui.MapFrame;
@@ -42,4 +43,6 @@
     JMenuItem selModifiedWays;
     
+    JMenuItem selectURL;
+    
     public UtilsPlugin2(PluginInformation info) {
         super(info);
@@ -73,4 +76,8 @@
         selModifiedWays = MainMenu.add(selectionMenu, new SelectModWaysAction());
         undoSelection = MainMenu.add(selectionMenu, new UndoSelectionAction());
+        
+        selectURL = MainMenu.add(toolsMenu, new ChooseURLAction());
+        
+
     }
 
@@ -102,4 +109,5 @@
         selModifiedWays.setEnabled(enabled);
         undoSelection.setEnabled(enabled);
+        selectURL.setEnabled(enabled);
     }
     @Override
Index: /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPluginPreferences.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPluginPreferences.java	(revision 26638)
+++ /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPluginPreferences.java	(revision 26639)
@@ -5,4 +5,7 @@
 package utilsplugin2;
 
+import java.util.Scanner;
+import java.awt.event.ActionEvent;
+import javax.swing.JButton;
 import java.util.List;
 import javax.swing.table.TableModel;
@@ -16,8 +19,14 @@
 import javax.swing.event.TableModelEvent;
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 import java.awt.GridBagConstraints;
+import java.awt.event.ActionListener;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.PrintWriter;
 import javax.swing.JPanel;
 import javax.swing.ListSelectionModel;
@@ -35,4 +44,7 @@
     HistoryComboBox combo1=new HistoryComboBox();
     JTable table;
+    JButton resetButton;
+    JButton loadButton;
+    JButton saveButton;
 
     @Override
@@ -46,21 +58,31 @@
         // FIXME: get rid of hardcoded URLS
         List<String> items = (List<String>) Main.pref.getCollection("utilsplugin2.urlHistory");
-        if (items==null || items.size()==0) {
-            items= new ArrayList<String>();
-            items.add("Wikipedia");
-            items.add("http://en.wikipedia.org/w/index.php?search={name}&fulltext=Search");
-            items.add("Wikipedia RU");
-            items.add(defaultURL);
-            items.add("LatLon buildings");
-            items.add("http://latlon.org/buildings?zoom=17&lat={#lat}&lon={#lon}&layers=B");
-            items.add("AMDMi3 Russian streets");
-            items.add("http://addresses.amdmi3.ru/?zoom=11&lat={#lat}&lon={#lon}&layers=B00");
-            items.add("Element history");
-            items.add("http://www.openstreetmap.org/browse/{#type}/{#id}/history");
-            items.add("Browse element");
-            items.add("http://www.openstreetmap.org/browse/{#type}/{#id}");
+        if (items==null) {
+            items = resetURLList();
+            fillRows(items);
         }
         String addr = Main.pref.get("utilsplugin2.customurl", defaultURL);
         //System.out.println("pref:"+addr);
+        
+        resetButton = new JButton(tr("Reset"));
+        resetButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                fillRows(resetURLList());
+            }
+        });
+        
+        saveButton = new JButton(tr("Save to file"));
+        saveButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                saveURLList();
+            }
+        });
+        
+        loadButton = new JButton(tr("Load from file"));
+        loadButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                fillRows(loadURLList());
+            }
+        });
         
         table=new JTable(new DefaultTableModel(null,new String[]{"Title","URL"}));
@@ -71,8 +93,11 @@
                 + " <b>&#123;#id&#125;</b> is replaced with the element ID<br/>"
                 + " <b>&#123;#type&#125;</b> is replaced with \"node\",\"way\" or \"relation\" <br/>"
-                + " <b>&#123;#lat&#125; , &#123;#lon&#125;</b> is replaced with element latitude/longitude"));
-        //help.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.));
-
-        all.add(new JLabel(tr("Custom URL configuration")),GBC.eop().insets(5,10,0,0));
+                + " <b>&#123;#lat&#125; , &#123;#lon&#125;</b> is replaced with element latitude/longitude <br/>"
+                + " Your can manually load settings from file <b>customurl.txt</b> in JOSM folder"));
+        
+        all.add(new JLabel(tr("Custom URL configuration")),GBC.std().insets(5,10,0,0));
+        all.add(resetButton,GBC.std().insets(25,10,0,0));
+        all.add(loadButton,GBC.std().insets(25,10,0,0));
+        all.add(saveButton,GBC.eol().insets(25,10,0,0));
         all.add(help,GBC.eop().insets(5,10,0,0));
         
@@ -87,5 +112,4 @@
                 int column = e.getColumn();
                 DefaultTableModel model = (DefaultTableModel)(e.getSource());
-                String columnName = model.getColumnName(column);
                 if (row<0  || column<0) return;
                 String data = (String)model.getValueAt(row, column);
@@ -100,8 +124,9 @@
 
     private void fillRows(List<String> items) {
+        if (items==null) return;
         int p=0,row=0;
         String name, url;
-        String data[][] = new String[][] {{"",""}};
         DefaultTableModel model = (DefaultTableModel) table.getModel();
+        model.setRowCount(0);
         int n=items.size();
         while (true) {
@@ -123,4 +148,67 @@
     public boolean ok() {
         String addr=combo1.getText();
+        List<String> lst = readItemsFromTable();
+        Main.pref.putCollection("utilsplugin2.urlHistory",lst);
+        try {
+            Main.pref.save();
+        } catch (IOException ex) {
+            Logger.getLogger(UtilsPluginPreferences.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        return false;
+    }
+
+    private List<String> resetURLList() {
+        ArrayList<String> items=new ArrayList<String>();
+            items= new ArrayList<String>();
+            items.add("Wikipedia");
+            items.add("http://en.wikipedia.org/w/index.php?search={name}&fulltext=Search");
+            items.add("Wikipedia RU");
+            items.add(defaultURL);
+            items.add("LatLon buildings");
+            items.add("http://latlon.org/buildings?zoom=17&lat={#lat}&lon={#lon}&layers=B");
+            items.add("AMDMi3 Russian streets");
+            items.add("http://addresses.amdmi3.ru/?zoom=11&lat={#lat}&lon={#lon}&layers=B00");
+            items.add("Element history [demo, =Ctrl-Shift-H]");
+            items.add("http://www.openstreetmap.org/browse/{#type}/{#id}/history");
+            items.add("Browse element [demo, =Ctrl-Shift-I]");
+            items.add("http://www.openstreetmap.org/browse/{#type}/{#id}");
+        Main.pref.putCollection("utilsplugin2.urlHistory",items);
+        return items;
+    }
+    
+    private List<String> loadURLList() {
+        ArrayList<String> items=new ArrayList<String>();
+        BufferedReader fr=null;
+        try {
+        File f = new File (Main.pref.getPreferencesDir(),"customurl.txt");
+        fr = new BufferedReader(new FileReader(f));
+        String s;
+        while ((s = fr.readLine()) !=null ) items.add(s);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try { if (fr!=null) fr.close(); } catch (Exception e) {}
+        }
+        return items;
+        
+    }
+    
+    private void saveURLList() {
+        List<String> items=readItemsFromTable();
+        File f = new File (Main.pref.getPreferencesDir(),"customurl.txt");
+        PrintWriter fw=null;
+        try {
+        fw=new PrintWriter(f);
+        for (String s : items) {
+            fw.println(s);
+        }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try { if (fw!=null) fw.close(); } catch (Exception e) {}
+        }
+    }
+
+    private List<String> readItemsFromTable() {
         TableModel model = (table.getModel());
         String v;
@@ -134,5 +222,4 @@
             lst.add(v);
         }
-        Main.pref.putCollection("utilsplugin2.urlHistory",lst);
         int row=table.getSelectedRow();
         if (row!=-1) {
@@ -140,13 +227,5 @@
             Main.pref.put("utilsplugin2.customurl",v);
         }
-        
-        try {
-            Main.pref.save();
-        } catch (IOException ex) {
-            Logger.getLogger(UtilsPluginPreferences.class.getName()).log(Level.SEVERE, null, ex);
-        }
-        return false;
-    }
-
-    
+        return lst;
+    }
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/IntersectedWaysRecursiveAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/IntersectedWaysRecursiveAction.java	(revision 26638)
+++ /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/IntersectedWaysRecursiveAction.java	(revision 26639)
@@ -25,5 +25,5 @@
         super(tr("All intersecting ways"), "intwayall", tr("Select all intersecting ways"),
                 Shortcut.registerShortcut("tools:intwayall", tr("Tool: {0}","All intersecting ways"),
-                KeyEvent.VK_I, Shortcut.GROUP_MENU, KeyEvent.SHIFT_DOWN_MASK|KeyEvent.CTRL_DOWN_MASK), true);
+                KeyEvent.VK_I, Shortcut.GROUP_MENU, KeyEvent.CTRL_DOWN_MASK|KeyEvent.ALT_DOWN_MASK), true);
         putValue("help", ht("/Action/SelectAllIntersectingWays"));
 
