Index: /trunk/images_nodist/error.svg
===================================================================
--- /trunk/images_nodist/error.svg	(revision 3863)
+++ /trunk/images_nodist/error.svg	(revision 3863)
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="44"
+   height="44.009998"
+   id="svg6361"
+   sodipodi:version="0.32"
+   inkscape:version="0.47pre4 r22446"
+   sodipodi:docname="tango-process-stop.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.1"
+   inkscape:export-xdpi="523.64001"
+   inkscape:export-ydpi="523.64001">
+  <defs
+     id="defs3">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 24 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="48 : 24 : 1"
+       inkscape:persp3d-origin="24 : 16 : 1"
+       id="perspective52" />
+    <linearGradient
+       id="linearGradient2256">
+      <stop
+         style="stop-color:#ff0202;stop-opacity:1;"
+         offset="0"
+         id="stop2258" />
+      <stop
+         style="stop-color:#ff9b9b;stop-opacity:1;"
+         offset="1"
+         id="stop2260" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient2248">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop2250" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop2252" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient9647">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop9649" />
+      <stop
+         style="stop-color:#dbdbdb;stop-opacity:1;"
+         offset="1"
+         id="stop9651" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient7895">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop7897" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop7899" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient4981">
+      <stop
+         style="stop-color:#cc0000;stop-opacity:1;"
+         offset="0"
+         id="stop4983" />
+      <stop
+         style="stop-color:#b30000;stop-opacity:1.0000000;"
+         offset="1.0000000"
+         id="stop4985" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15762"
+       inkscape:collect="always">
+      <stop
+         id="stop15764"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop15766"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient14236">
+      <stop
+         id="stop14238"
+         offset="0.0000000"
+         style="stop-color:#ed4040;stop-opacity:1.0000000;" />
+      <stop
+         id="stop14240"
+         offset="1.0000000"
+         style="stop-color:#a40000;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11780">
+      <stop
+         style="stop-color:#ff8b8b;stop-opacity:1.0000000;"
+         offset="0.0000000"
+         id="stop11782" />
+      <stop
+         style="stop-color:#ec1b1b;stop-opacity:1.0000000;"
+         offset="1.0000000"
+         id="stop11784" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11014">
+      <stop
+         style="stop-color:#a80000;stop-opacity:1.0000000;"
+         offset="0.0000000"
+         id="stop11016" />
+      <stop
+         style="stop-color:#c60000;stop-opacity:1.0000000;"
+         offset="0.0000000"
+         id="stop13245" />
+      <stop
+         style="stop-color:#e50000;stop-opacity:1.0000000;"
+         offset="1.0000000"
+         id="stop11018" />
+    </linearGradient>
+    <linearGradient
+       y2="9.650753"
+       x2="9.8940229"
+       y1="5.3855424"
+       x1="5.736527"
+       gradientTransform="matrix(-1,0,0,-1,31.7217,31.29079)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient15772"
+       xlink:href="#linearGradient15762"
+       inkscape:collect="always" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient7895"
+       id="linearGradient7901"
+       x1="15.578875"
+       y1="16.285088"
+       x2="32.166405"
+       y2="28.394291"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4981"
+       id="linearGradient2243"
+       gradientUnits="userSpaceOnUse"
+       x1="23.995985"
+       y1="20.105337"
+       x2="41.047836"
+       y2="37.959785"
+       gradientTransform="matrix(0.988373,0,0,0.988373,0.279002,0.278984)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4981"
+       id="linearGradient3640"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(0.5,-0.25)"
+       x1="23.995985"
+       y1="20.105337"
+       x2="41.047836"
+       y2="37.959785" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11780"
+       id="linearGradient3642"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(0.5,-0.25)"
+       x1="15.737001"
+       y1="12.5036"
+       x2="53.570126"
+       y2="47.374317" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2248"
+       id="radialGradient3644"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(4.154957,0,0,3.198723,-52.34553,-21.75921)"
+       cx="16.75"
+       cy="10.666344"
+       fx="16.75"
+       fy="10.666344"
+       r="21.25" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2248"
+       id="radialGradient3670"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(4.154957,0,0,3.198723,-52.34553,-21.75921)"
+       cx="16.75"
+       cy="10.666344"
+       fx="16.75"
+       fy="10.666344"
+       r="21.25" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11780"
+       id="linearGradient3673"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(0.5,-0.25)"
+       x1="15.737001"
+       y1="12.5036"
+       x2="53.570126"
+       y2="47.374317" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4981"
+       id="linearGradient3676"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(0.5,-0.25)"
+       x1="23.995985"
+       y1="20.105337"
+       x2="41.047836"
+       y2="37.959785" />
+    <inkscape:perspective
+       id="perspective3690"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     inkscape:guide-bbox="true"
+     showguides="true"
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="0.15294118"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="8"
+     inkscape:cx="-4.512323"
+     inkscape:cy="15.495203"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="1400"
+     inkscape:window-height="974"
+     inkscape:window-x="0"
+     inkscape:window-y="24"
+     inkscape:showpageshadow="false"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata4">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+        <dc:date>2005-10-16</dc:date>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Andreas Nilsson</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:subject>
+          <rdf:Bag>
+            <rdf:li>stop</rdf:li>
+            <rdf:li>halt</rdf:li>
+            <rdf:li>error</rdf:li>
+          </rdf:Bag>
+        </dc:subject>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+        <dc:contributor>
+          <cc:Agent>
+            <dc:title>Jakub Steiner</dc:title>
+          </cc:Agent>
+        </dc:contributor>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     transform="translate(-2.4943857,-1.7369283)">
+    <path
+       style="fill:url(#linearGradient3676);fill-opacity:1;fill-rule:evenodd;stroke:#860000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 16.091006,2.2419213 17.085305,0 12.821274,13.0944637 0,17.893645 -12.648599,12.016899 -17.430337,0 -12.9242633,-12.838665 0,-17.194186 L 16.091006,2.2419213 z"
+       id="path9480"
+       sodipodi:nodetypes="ccccccccc" />
+    <path
+       style="opacity:0.81318683;fill:none;stroke:url(#linearGradient3673);stroke-width:1.00000024;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+       d="m 16.520655,3.2503424 16.227908,0 12.247893,12.4223746 0,17.114284 -11.857984,11.450829 -16.768219,0 -12.3611738,-12.279112 0,-16.363108 L 16.520655,3.2503424 z"
+       id="path9482"
+       sodipodi:nodetypes="ccccccccc" />
+    <path
+       style="opacity:0.28977272;fill:url(#radialGradient3670);fill-opacity:1;fill-rule:evenodd;stroke:none"
+       d="M 16.1875,2.5 3.25,15.3125 l 0,17 2.9375,2.90625 C 22.950041,35.2763 22.664665,22.200067 45.75,23.34375 l 0,-7.90625 L 33.0625,2.5 l -16.875,0 z"
+       id="path2241"
+       sodipodi:nodetypes="cccccccc" />
+    <path
+       style="font-size:48px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Courier New;-inkscape-font-specification:Courier New Bold"
+       d="m 28.476562,12.882813 -1.335937,14.484374 c -0.06252,0.750011 -0.312516,1.335948 -0.75,1.757813 -0.437515,0.406259 -0.98439,0.609384 -1.640625,0.609375 -0.656264,9e-6 -1.203138,-0.203116 -1.640625,-0.609375 -0.437512,-0.421865 -0.687512,-1.007802 -0.75,-1.757813 L 21,12.882813 C 20.93749,12.148464 20.90624,11.664089 20.90625,11.429688 20.90624,10.210966 21.273427,9.2344043 22.007812,8.5 22.742175,7.7500308 23.656237,7.3750311 24.75,7.375 c 1.07811,3.11e-5 1.984359,0.3750308 2.71875,1.125 0.749982,0.7500293 1.124982,1.695341 1.125,2.835938 -1.8e-5,0.234401 -0.03908,0.750026 -0.117188,1.546875"
+       id="path3710" />
+    <path
+       style="font-size:48px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Courier New;-inkscape-font-specification:Courier New Bold"
+       d="m 28.513748,36.738918 c -2.2e-5,0.879264 -0.329743,1.628631 -0.989168,2.248109 -0.659465,0.599497 -1.568699,0.899243 -2.727705,0.899244 -1.159042,-10e-7 -2.068276,-0.299747 -2.727706,-0.899244 -0.659459,-0.619478 -0.989182,-1.368845 -0.989166,-2.248109 -1.6e-5,-0.859273 0.319714,-1.588658 0.959193,-2.188158 0.659428,-0.619474 1.578654,-0.929213 2.757679,-0.929219 1.178989,6e-6 2.088223,0.299753 2.727705,0.899244 0.659425,0.5995 0.989146,1.338877 0.989168,2.218133"
+       id="path3679" />
+  </g>
+</svg>
Index: /trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 3863)
@@ -199,5 +199,11 @@
             file = new File(fn);
         }
-        if(file == null || (file.exists())) {
+        if (!confirmOverride(file))
+            return null;
+        return file;
+    }
+
+    public static boolean confirmOverride(File file) {
+        if (file == null || (file.exists())) {
             ExtendedDialog dialog = new ExtendedDialog(
                     Main.parent,
@@ -208,7 +214,7 @@
             dialog.setButtonIcons(new String[] {"save_as.png", "cancel.png"});
             dialog.showDialog();
-            if (dialog.getValue() != 1) return null;
-        }
-        return file;
+            return (dialog.getValue() == 1);
+        }
+        return true;
     }
 }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 3863)
@@ -5,5 +5,8 @@
 
 import java.awt.BorderLayout;
+import java.awt.Component;
 import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.GridBagLayout;
 import java.awt.Point;
 import java.awt.Rectangle;
@@ -11,21 +14,42 @@
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.AbstractAction;
 import javax.swing.DefaultListSelectionModel;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
 import javax.swing.JTable;
+import javax.swing.JTextArea;
 import javax.swing.JViewport;
 import javax.swing.ListSelectionModel;
+import javax.swing.SingleSelectionModel;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.TableModel;
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.SaveActionBase;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
@@ -33,5 +57,8 @@
 import org.openstreetmap.josm.gui.mappaint.StyleSource;
 import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
+import org.openstreetmap.josm.gui.preferences.SourceEntry;
+import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
+import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -67,4 +94,5 @@
         tblStyles.getColumnModel().getColumn(0).setMaxWidth(1);
         tblStyles.getColumnModel().getColumn(0).setResizable(false);
+        tblStyles.getColumnModel().getColumn(1).setCellRenderer(new StyleSourceRenderer());
         tblStyles.setShowGrid(false);
         tblStyles.setIntercellSpacing(new Dimension(0, 0));
@@ -124,6 +152,12 @@
     protected class StylesModel extends AbstractTableModel implements MapPaintSylesUpdateListener {
 
+        List<StyleSource> data = new ArrayList<StyleSource>();
+
+        public StylesModel() {
+            data = new ArrayList<StyleSource>(MapPaintStyles.getStyles().getStyleSources());
+        }
+
         private StyleSource getRow(int i) {
-            return MapPaintStyles.getStyles().getStyleSources().get(i);
+            return data.get(i);
         }
 
@@ -135,5 +169,5 @@
         @Override
         public int getRowCount() {
-            return MapPaintStyles.getStyles().getStyleSources().size();
+            return data.size();
         }
         
@@ -143,5 +177,5 @@
                 return getRow(row).active;
             else
-                return getRow(row).getDisplayString();
+                return getRow(row);
         }
 
@@ -171,5 +205,5 @@
          * views of this model.
          */
-        protected void ensureSelectedIsVisible() {
+        public void ensureSelectedIsVisible() {
             int index = selectionModel.getMinSelectionIndex();
             if (index < 0) return;
@@ -185,4 +219,5 @@
         @Override
         public void mapPaintStylesUpdated() {
+            data = new ArrayList<StyleSource>(MapPaintStyles.getStyles().getStyleSources());
             fireTableDataChanged();
             tblStyles.repaint();
@@ -191,6 +226,19 @@
         @Override
         public void mapPaintStyleEntryUpdated(int idx) {
+            data = new ArrayList<StyleSource>(MapPaintStyles.getStyles().getStyleSources());
             fireTableRowsUpdated(idx, idx);
             tblStyles.repaint();
+        }
+    }
+
+    private static class StyleSourceRenderer extends DefaultTableCellRenderer {
+        @Override
+        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+            StyleSource s = (StyleSource) value;
+            JLabel label = (JLabel)super.getTableCellRendererComponent(table,
+                    s.getDisplayString(), isSelected, hasFocus, row, column);
+            label.setIcon(s.getIcon());
+            label.setToolTipText(s.getToolTipText());
+            return label;
         }
     }
@@ -227,5 +275,7 @@
      */
     class MoveUpDownAction extends AbstractAction implements ListSelectionListener {
+
         final int increment;
+
         public MoveUpDownAction(boolean isDown) {
             increment = isDown ? 1 : -1;
@@ -320,4 +370,230 @@
     }
     
+    protected class SaveAsAction extends AbstractAction {
+
+        public SaveAsAction() {
+            putValue(NAME, tr("Save as..."));
+            putValue(SHORT_DESCRIPTION, tr("Save a copy of this Style to file and add it to the list"));
+            putValue(SMALL_ICON, ImageProvider.get("copy"));
+            setEnabled(tblStyles.getSelectedRows().length == 1);
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            int sel = tblStyles.getSelectionModel().getLeadSelectionIndex();
+            if (sel < 0 || sel >= model.getRowCount())
+                return;
+            final StyleSource s = model.getRow(sel);
+
+            String curDir = Main.pref.get("mappaint.clone-style.lastDirectory", System.getProperty("user.home"));
+
+            String suggestion = curDir + File.separator + s.getFileNamePart();
+            JFileChooser fc = new JFileChooser();
+            fc.setSelectedFile(new File(suggestion));
+
+            int answer = fc.showSaveDialog(Main.parent);
+            if (answer != JFileChooser.APPROVE_OPTION)
+                return;
+
+            if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir)) {
+                Main.pref.put("mappaint.clone-style.lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
+            }
+            File file = fc.getSelectedFile();
+
+            if (!SaveActionBase.confirmOverride(file))
+                return;
+
+            Main.worker.submit(new SaveToFileTask(s, file));
+        }
+
+        private class SaveToFileTask extends PleaseWaitRunnable {
+            private StyleSource s;
+            private File file;
+
+            private boolean canceled;
+            private boolean error;
+
+            public SaveToFileTask(StyleSource s, File file) {
+                super(tr("Reloading style sources"));
+                this.s = s;
+                this.file = file;
+            }
+
+            @Override
+            protected void cancel() {
+                canceled = true;
+            }
+
+            @Override
+            protected void realRun() {
+                getProgressMonitor().indeterminateSubTask(
+                        tr("Save style ''{0}'' as ''{1}''", s.getDisplayString(), file.getPath()));
+                BufferedInputStream bis = null;
+                BufferedOutputStream bos = null;
+                try {
+                    bis = new BufferedInputStream(s.getSourceInputStream());
+                    bos = new BufferedOutputStream(new FileOutputStream(file));
+                    byte[] buffer = new byte[4096];
+                    int length;
+                    while ((length = bis.read(buffer)) > -1 && !canceled) {
+                        bos.write(buffer, 0, length);
+                    }
+                } catch (IOException e) {
+                    error = true;
+                } finally {
+                    if (bis != null) {
+                        try {
+                            bis.close();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    if (bos != null) {
+                        try {
+                            bos.close();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
+
+            @Override
+            protected void finish() {
+                SwingUtilities.invokeLater(new Runnable() {
+                    @Override
+                    public void run() {
+                        if (!error && !canceled) {
+                            SourceEntry se = new SourceEntry(s);
+                            se.url = file.getPath();
+                            MapPaintStyles.addStyle(se);
+                            tblStyles.getSelectionModel().setSelectionInterval(model.getRowCount() - 1 , model.getRowCount() - 1);
+                            model.ensureSelectedIsVisible();
+                        }
+                    }
+                });
+            }
+        }
+    }
+
+    protected class InfoAction extends AbstractAction {
+
+        boolean errorsTabLoaded;
+        boolean sourceTabLoaded;
+
+        public InfoAction() {
+            putValue(NAME, tr("Info"));
+            putValue(SHORT_DESCRIPTION, tr("view meta information, error log and source definition"));
+            putValue(SMALL_ICON, ImageProvider.get("info"));
+            setEnabled(tblStyles.getSelectedRows().length == 1);
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            int sel = tblStyles.getSelectionModel().getLeadSelectionIndex();
+            if (sel < 0 || sel >= model.getRowCount())
+                return;
+            final StyleSource s = model.getRow(sel);
+            ExtendedDialog info = new ExtendedDialog(Main.parent, tr("Map Style info"), new String[] {"Close"});
+            info.setPreferredSize(new Dimension(600, 400));
+            info.setButtonIcons(new String[] {"ok.png"});
+
+            final JTabbedPane tabs = new JTabbedPane();
+
+            tabs.add("Info", buildInfoPanel(s));
+            JLabel lblInfo = new JLabel(tr("Info"));
+            lblInfo.setFont(lblInfo.getFont().deriveFont(Font.PLAIN));
+            tabs.setTabComponentAt(0, lblInfo);
+
+            final JPanel pErrors = new JPanel(new GridBagLayout());
+            tabs.add("Errors", pErrors);
+            JLabel lblErrors;
+            if (s.getErrors().isEmpty()) {
+                lblErrors = new JLabel(tr("Errors"));
+                lblErrors.setFont(lblInfo.getFont().deriveFont(Font.PLAIN));
+                lblErrors.setEnabled(false);
+                tabs.setTabComponentAt(1, lblErrors);
+                tabs.setEnabledAt(1, false);
+            } else {
+                lblErrors = new JLabel(tr("Errors"), ImageProvider.get("misc", "error"), JLabel.HORIZONTAL);
+                tabs.setTabComponentAt(1, lblErrors);
+            }
+
+            final JPanel pSource = new JPanel(new GridBagLayout());
+            tabs.addTab("Source", pSource);
+            JLabel lblSource = new JLabel(tr("Source"));
+            lblSource.setFont(lblSource.getFont().deriveFont(Font.PLAIN));
+            tabs.setTabComponentAt(2, lblSource);
+
+            tabs.getModel().addChangeListener(new ChangeListener() {
+                @Override
+                public void stateChanged(ChangeEvent e) {
+                    if (!errorsTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 1) {
+                        errorsTabLoaded = true;
+                        buildErrorsPanel(s, pErrors);
+                    }
+                    if (!sourceTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 2) {
+                        sourceTabLoaded = true;
+                        buildSourcePanel(s, pSource);
+                    }
+                }
+            });
+            info.setContent(tabs, false);
+            info.showDialog();
+        }
+
+        private JPanel buildInfoPanel(StyleSource s) {
+            JPanel p = new JPanel(new GridBagLayout());
+            StringBuilder text = new StringBuilder("<table cellpadding=3><tr><td>");
+            text.append("<b>" + tr("Name:") + "</b></td><td>" + s.getDisplayString() + "</td></tr>");
+            text.append("<tr><td>");
+            if (s.url.startsWith("http://")) {
+                text.append("<b>" + tr("URL:") + "</b></td><td>" + s.url + "</td></tr>");
+            } else if (s.url.startsWith("resource://")) {
+                text.append("<b>" + tr("Built-in Style, internal path:</b>") + "</b></td><td>" + s.url + "</td></tr>");
+            } else {
+                text.append("<b>" + tr("Path:") + "</b></td><td>" + s.url + "</td></tr>");
+            }
+            text.append("<tr><td><b>" + tr("Style is currently active?") + "</b></td><td>" + (s.active ? tr("Yes") : tr("No")) + "</td></tr>");
+            text.append("</table>");
+            p.add(new JScrollPane(new HtmlPanel(text.toString())), GBC.eol().fill(GBC.BOTH));
+            return p;
+        }
+
+        private void buildSourcePanel(StyleSource s, JPanel p) {
+            JTextArea txtSource = new JTextArea();
+            txtSource.setFont(new Font("Monospaced", txtSource.getFont().getStyle(), txtSource.getFont().getSize()));
+            txtSource.setEditable(false);
+            p.add(new JScrollPane(txtSource), GBC.std().fill());
+
+            InputStream is = null;
+            try {
+                is = s.getSourceInputStream();
+                BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+                String line;
+                while ((line = reader.readLine()) != null) {
+                    txtSource.append(line + "\n");
+                }
+            } catch (IOException ex) {
+                txtSource.append("<ERROR: failed to read file!>");
+            } finally {
+                try {
+                    is.close();
+                } catch (IOException ex) {
+                }
+            }
+        }
+
+        private void buildErrorsPanel(StyleSource s, JPanel p) {
+            JTextArea txtErrors = new JTextArea();
+            txtErrors.setFont(new Font("Monospaced", txtErrors.getFont().getStyle(), txtErrors.getFont().getSize()));
+            txtErrors.setEditable(false);
+            p.add(new JScrollPane(txtErrors), GBC.std().fill());
+            for (Throwable t : s.getErrors()) {
+                txtErrors.append(t.toString() + "\n");
+            }
+        }
+    }
+
     class PopupMenuHandler extends PopupMenuLauncher {
         @Override
@@ -339,4 +615,7 @@
         public MapPaintPopup() {
             add(reloadAction);
+            add(new SaveAsAction());
+            addSeparator();
+            add(new InfoAction());
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 3863)
@@ -102,39 +102,43 @@
 
         for (SourceEntry entry : sourceEntries) {
-            StyleSource style = null;
+            StyleSource source = fromSourceEntry(entry);
+            if (source != null) {
+                styles.add(source);
+            }
+        }
+        for (StyleSource source : styles.getStyleSources()) {
+            source.loadStyleSource();
+        }
+        
+        fireMapPaintSylesUpdated();
+    }
+
+    private static StyleSource fromSourceEntry(SourceEntry entry) {
+        MirroredInputStream in = null;
+        try {
+            in = new MirroredInputStream(entry.url);
+            InputStream zip = in.getZipEntry("xml", "style");
+            if (zip != null) {
+                return new XmlStyleSource(entry);
+            }
+            zip = in.getZipEntry("mapcss", "style");
+            if (zip != null) {
+                return new MapCSSStyleSource(entry);
+            }
+            if (entry.url.toLowerCase().endsWith(".mapcss")) {
+                return new MapCSSStyleSource(entry);
+            } else {
+                return new XmlStyleSource(entry);
+            }
+        } catch (IOException e) {
+            System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString()));
+            e.printStackTrace();
+        } finally {
             try {
-                MirroredInputStream in = new MirroredInputStream(entry.url);
-                InputStream zip = in.getZipEntry("xml","style");
-                if (zip != null) {
-                    style = new XmlStyleSource(entry);
-                    styles.add(style);
-                    continue;
-                }
-                zip = in.getZipEntry("mapcss","style");
-                if (zip != null) {
-                    style = new MapCSSStyleSource(entry);
-                    styles.add(style);
-                    continue;
-                }
-                if (entry.url.toLowerCase().endsWith(".mapcss")) {
-                    style = new MapCSSStyleSource(entry);
-                } else {
-                    style = new XmlStyleSource(entry);
-                }
-            } catch(IOException e) {
-                System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString()));
-                e.printStackTrace();
-                if (style != null) {
-                    style.hasError = true;
-                }
-            }
-            if (style != null) {
-                styles.add(style);
-            }
-        }
-        for (StyleSource s : styles.getStyleSources()) {
-            s.loadStyleSource();
-        }
-        fireMapPaintSylesUpdated();
+                in.close();
+            } catch (IOException ex) {
+            }
+        }
+        return null;
     }
 
@@ -250,4 +254,16 @@
     }
 
+    public static void addStyle(SourceEntry entry) {
+        StyleSource source = fromSourceEntry(entry);
+        if (source != null) {
+            styles.add(source);
+            source.loadStyleSource();
+            MapPaintPrefMigration.INSTANCE.put(styles.getStyleSources());
+            fireMapPaintSylesUpdated();
+            styles.clearCached();
+            Main.map.mapView.repaint();
+        }
+    }
+
     /***********************************
      * MapPaintSylesUpdateListener & related code
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java	(revision 3863)
@@ -2,11 +2,23 @@
 package org.openstreetmap.josm.gui.mappaint;
 
+import static org.openstreetmap.josm.tools.I18n.trn;
+
 import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import javax.swing.ImageIcon;
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.preferences.SourceEntry;
+import org.openstreetmap.josm.tools.ImageProvider;
 
 abstract public class StyleSource extends SourceEntry {
-    public boolean hasError = false;
+
+    private List<Throwable> errors = new ArrayList<Throwable>();
     public File zipIcons;
 
@@ -22,3 +34,41 @@
 
     abstract public void loadStyleSource();
+
+    abstract public InputStream getSourceInputStream() throws IOException;
+
+    public void logError(Throwable e) {
+        errors.add(e);
+    }
+
+    public Collection<Throwable> getErrors() {
+        return Collections.unmodifiableCollection(errors);
+    }
+
+    protected void clearErrors() {
+        errors.clear();
+    }
+
+    private ImageIcon pencil = ImageProvider.get("dialogs/mappaint", "pencil");
+
+    protected ImageIcon getSourceIcon() {
+        return pencil;
+    }
+
+    final public ImageIcon getIcon() {
+        if (getErrors().isEmpty())
+            return getSourceIcon();
+        else
+            return ImageProvider.overlay(getSourceIcon(),
+                    "dialogs/mappaint/error_small",
+                    ImageProvider.OverlayPosition.SOUTHEAST);
+    }
+
+    public String getToolTipText() {
+        if (errors.isEmpty())
+            return null;
+        else
+            return trn("There was an error when loading this style. Select ''Info'' from the right click menu for details.",
+                    "There were {0} errors when loading this style. Select ''Info'' from the right click menu for details.",
+                    errors.size(), errors.size());
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 3863)
@@ -42,17 +42,7 @@
     public void loadStyleSource() {
         rules.clear();
-        hasError = false;
+        clearErrors();
         try {
-            MirroredInputStream in = new MirroredInputStream(url);
-            InputStream zip = in.getZipEntry("mapcss", "style");
-            InputStream input;
-            if (zip != null) {
-                input = zip;
-                zipIcons = in.getFile();
-            } else {
-                input = in;
-                zipIcons = null;
-            }
-            MapCSSParser parser = new MapCSSParser(input, "UTF-8");
+            MapCSSParser parser = new MapCSSParser(getSourceInputStream(), "UTF-8");
             parser.sheet(this);
             loadMeta();
@@ -60,13 +50,25 @@
             System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
             e.printStackTrace();
-            hasError = true;
+            logError(e);
         } catch (TokenMgrError e) {
             System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
             e.printStackTrace();
-            hasError = true;
+            logError(e);
         } catch (ParseException e) {
             System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
             e.printStackTrace();
-            hasError = true;
+            logError(e);
+        }
+    }
+
+    public InputStream getSourceInputStream() throws IOException {
+        MirroredInputStream in = new MirroredInputStream(url);
+        InputStream zip = in.getZipEntry("mapcss", "style");
+        if (zip != null) {
+            zipIcons = in.getFile();
+            return zip;
+        } else {
+            zipIcons = null;
+            return in;
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.java	(revision 3863)
@@ -17,4 +17,5 @@
 
 public class MapCSSParser implements MapCSSParserConstants {
+    MapCSSStyleSource sheet;
 
 /*************
@@ -171,4 +172,5 @@
     MapCSSRule r;
     Token com = null;
+      this.sheet = sheet;
     w();
     label_3:
@@ -779,10 +781,13 @@
 
   void error_skipto(int kind) throws ParseException {
-  ParseException e = generateParseException();
-  System.err.println(e);
-  Token t;
-  do {
-    t = getNextToken();
-  } while (t.kind != kind);
+    ParseException e = generateParseException();
+    System.err.println(e);
+    if (sheet != null) {
+        sheet.logError(e);
+    }
+    Token t;
+    do {
+        t = getNextToken();
+    } while (t.kind != kind);
   }
 
@@ -813,4 +818,125 @@
     catch(LookaheadSuccess ls) { return true; }
     finally { jj_save(3, xla); }
+  }
+
+  private boolean jj_3R_20() {
+    if (jj_scan_token(COMMA)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_16() {
+    if (jj_scan_token(EXCLAMATION)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_25() {
+    if (jj_scan_token(STRING)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_12() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_16()) jj_scanpos = xsp;
+    if (jj_3R_17()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_14() {
+    if (jj_3R_19()) return true;
+    Token xsp;
+    if (jj_3R_20()) return true;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_20()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_23() {
+    if (jj_3R_25()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_15() {
+    if (jj_scan_token(IDENT)) return true;
+    if (jj_3R_21()) return true;
+    if (jj_scan_token(LPAR)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_26() {
+    if (jj_scan_token(COMMENT_START)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_19() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(3)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(2)) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3_2() {
+    if (jj_3R_13()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_24() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(7)) {
+    jj_scanpos = xsp;
+    if (jj_3R_26()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3_1() {
+    if (jj_3R_12()) return true;
+    if (jj_scan_token(RSQUARE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_21() {
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_24()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3_3() {
+    if (jj_3R_14()) return true;
+    return false;
+  }
+
+  private boolean jj_3_4() {
+    if (jj_3R_15()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_18() {
+    if (jj_scan_token(EXCLAMATION_EQUAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_17() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_22()) {
+    jj_scanpos = xsp;
+    if (jj_3R_23()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3R_22() {
+    if (jj_scan_token(IDENT)) return true;
+    return false;
   }
 
@@ -824,125 +950,4 @@
     }
     if (jj_3R_17()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_20() {
-    if (jj_scan_token(COMMA)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_16() {
-    if (jj_scan_token(EXCLAMATION)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_25() {
-    if (jj_scan_token(STRING)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_12() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_16()) jj_scanpos = xsp;
-    if (jj_3R_17()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_14() {
-    if (jj_3R_19()) return true;
-    Token xsp;
-    if (jj_3R_20()) return true;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_20()) { jj_scanpos = xsp; break; }
-    }
-    return false;
-  }
-
-  private boolean jj_3R_23() {
-    if (jj_3R_25()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_15() {
-    if (jj_scan_token(IDENT)) return true;
-    if (jj_3R_21()) return true;
-    if (jj_scan_token(LPAR)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_26() {
-    if (jj_scan_token(COMMENT_START)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_19() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(3)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(2)) return true;
-    }
-    return false;
-  }
-
-  private boolean jj_3_2() {
-    if (jj_3R_13()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_24() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(7)) {
-    jj_scanpos = xsp;
-    if (jj_3R_26()) return true;
-    }
-    return false;
-  }
-
-  private boolean jj_3R_21() {
-    Token xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_24()) { jj_scanpos = xsp; break; }
-    }
-    return false;
-  }
-
-  private boolean jj_3_1() {
-    if (jj_3R_12()) return true;
-    if (jj_scan_token(RSQUARE)) return true;
-    return false;
-  }
-
-  private boolean jj_3_3() {
-    if (jj_3R_14()) return true;
-    return false;
-  }
-
-  private boolean jj_3_4() {
-    if (jj_3R_15()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_18() {
-    if (jj_scan_token(EXCLAMATION_EQUAL)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_17() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_22()) {
-    jj_scanpos = xsp;
-    if (jj_3R_23()) return true;
-    }
-    return false;
-  }
-
-  private boolean jj_3R_22() {
-    if (jj_scan_token(IDENT)) return true;
     return false;
   }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.jj
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.jj	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.jj	(revision 3863)
@@ -22,4 +22,5 @@
 
 public class MapCSSParser {
+    MapCSSStyleSource sheet;
 }
 PARSER_END(MapCSSParser)
@@ -185,4 +186,5 @@
 }
 {
+    { this.sheet = sheet; }
     w()
     ( r=rule() { sheet.rules.add(r); } w() )*
@@ -437,10 +439,13 @@
 JAVACODE
 void error_skipto(int kind) {
-  ParseException e = generateParseException();
-  System.err.println(e);
-  Token t;
-  do {
-    t = getNextToken();
-  } while (t.kind != kind);
-}
-
+    ParseException e = generateParseException();
+    System.err.println(e);
+    if (sheet != null) {
+        sheet.logError(e);
+    }
+    Token t;
+    do {
+        t = getNextToken();
+    } while (t.kind != kind);
+}
+
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 3863)
@@ -51,5 +51,5 @@
 
     protected void init() {
-        hasError = false;
+        clearErrors();
         icons.clear();
         lines.clear();
@@ -66,15 +66,5 @@
         init();
         try {
-            MirroredInputStream in = new MirroredInputStream(url);
-            InputStream zip = in.getZipEntry("xml", "style");
-            InputStreamReader reader = null;
-            if (zip != null) {
-                reader = new InputStreamReader(zip);
-                zipIcons = in.getFile();
-            } else {
-                reader = new InputStreamReader(in);
-                zipIcons = null;
-            }
-
+            InputStreamReader reader = new InputStreamReader(getSourceInputStream());
             XmlObjectParser parser = new XmlObjectParser(new XmlStyleSourceHandler(this));
             parser.startWithValidation(reader,
@@ -87,13 +77,25 @@
             System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
             e.printStackTrace();
-            hasError = true;
+            logError(e);
         } catch(SAXParseException e) {
             System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: [{1}:{2}] {3}", url, e.getLineNumber(), e.getColumnNumber(), e.getMessage()));
             e.printStackTrace();
-            hasError = true;
+            logError(e);
         } catch(SAXException e) {
             System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
             e.printStackTrace();
-            hasError = true;
+            logError(e);
+        }
+    }
+
+    public InputStream getSourceInputStream() throws IOException {
+        MirroredInputStream in = new MirroredInputStream(url);
+        InputStream zip = in.getZipEntry("xml", "style");
+        if (zip != null) {
+            zipIcons = in.getFile();
+            return zip;
+        } else {
+            zipIcons = null;
+            return in;
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java	(revision 3863)
@@ -74,5 +74,7 @@
 
     private void error(String message) {
-        System.out.println(style.getDisplayString() + " (" + rule.cond.key + "=" + rule.cond.value + "): " + message);
+        String warning = style.getDisplayString() + " (" + rule.cond.key + "=" + rule.cond.value + "): " + message;
+        System.err.println(warning);
+        style.logError(new Exception(warning));
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 3862)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 3863)
@@ -89,8 +89,13 @@
         if (shortdescription != null)
             return shortdescription;
-        /**
-         * extract file part from url, e.g.:
-         * http://www.test.com/file.xml?format=text  --> file.xml
-         */
+        else
+            return getFileNamePart();
+    }
+
+    /**
+     * extract file part from url, e.g.:
+     * http://www.test.com/file.xml?format=text  --> file.xml
+     */
+    public String getFileNamePart() {
         Pattern p = Pattern.compile("([^/\\\\]*?)([?].*)?$");
         Matcher m = p.matcher(url);
