Index: trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 9509)
+++ trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 9510)
@@ -86,5 +86,7 @@
                 if (Main.platform.rename(file, newFile)) {
                     layer.setAssociatedFile(newFile);
-                    nameText = newFile.getName();
+                    if (!layer.isRenamed()) {
+                        nameText = newFile.getName();
+                    }
                 } else {
                     JOptionPane.showMessageDialog(
@@ -98,5 +100,5 @@
             }
         }
-        layer.setName(nameText);
+        layer.rename(nameText);
         Main.parent.repaint();
     }
Index: trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 9509)
+++ trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 9510)
@@ -93,5 +93,7 @@
                 return false;
             }
-            layer.setName(file.getName());
+            if (!layer.isRenamed()) {
+                layer.setName(file.getName());
+            }
             layer.setAssociatedFile(file);
             if (layer instanceof OsmDataLayer) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 9509)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 9510)
@@ -1601,5 +1601,5 @@
                     break;
                 case 2:
-                    l.setName((String) value);
+                    l.rename((String) value);
                     break;
                 default: throw new RuntimeException();
Index: trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 9509)
+++ trunk/src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 9510)
@@ -62,5 +62,4 @@
     /**
      * Special class that can be returned by getMenuEntries when JSeparator needs to be created
-     *
      */
     public static class SeparatorLayerAction extends AbstractAction implements LayerAction {
@@ -90,10 +89,11 @@
     public static final int ICON_SIZE = 16;
 
-    /** keeps track of property change listeners */
+    /**
+     * keeps track of property change listeners
+     */
     protected PropertyChangeSupport propertyChangeSupport;
 
     /**
      * The visibility state of the layer.
-     *
      */
     private boolean visible = true;
@@ -101,5 +101,4 @@
     /**
      * The opacity of the layer.
-     *
      */
     private double opacity = 1;
@@ -107,5 +106,4 @@
     /**
      * The layer should be handled as a background layer in automatic handling
-     *
      */
     private boolean background;
@@ -113,7 +111,11 @@
     /**
      * The name of this layer.
-     *
-     */
-    private  String name;
+     */
+    private String name;
+
+    /**
+     * This is set if user renamed this layer.
+     */
+    private boolean renamed = false;
 
     /**
@@ -264,6 +266,5 @@
      * Sets the name of the layer
      *
-     *@param name the name. If null, the name is set to the empty string.
-     *
+     * @param name the name. If null, the name is set to the empty string.
      */
     public final void setName(String name) {
@@ -276,4 +277,23 @@
             propertyChangeSupport.firePropertyChange(NAME_PROP, oldValue, this.name);
         }
+    }
+
+    /**
+     * Rename layer and set renamed flag to mark it as renamed (has user given name).
+     *
+     * @param name the name. If null, the name is set to the empty string.
+     */
+    public final void rename(String name) {
+        renamed = true;
+        setName(name);
+    }
+
+    /**
+     * Replies true if this layer was renamed by user
+     *
+     * @return true if this layer was renamed by user
+     */
+    public boolean isRenamed() {
+        return renamed;
     }
 
@@ -427,5 +447,4 @@
     /**
      * The action to save a layer
-     *
      */
     public static class LayerSaveAction extends AbstractAction {
