Index: src/org/openstreetmap/josm/Main.java
===================================================================
--- src/org/openstreetmap/josm/Main.java	(revision 137)
+++ src/org/openstreetmap/josm/Main.java	(revision 138)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.actions.ReverseSegmentAction;
 import org.openstreetmap.josm.actions.SaveAction;
+import org.openstreetmap.josm.actions.SaveAsAction;
 import org.openstreetmap.josm.actions.UndoAction;
 import org.openstreetmap.josm.actions.UploadAction;
@@ -164,4 +165,5 @@
 		final Action uploadAction = new UploadAction();
 		final Action saveAction = new SaveAction();
+		final Action saveAsAction = new SaveAsAction();
 		final Action gpxExportAction = new GpxExportAction(null);
 		final Action exitAction = new ExitAction();
@@ -173,4 +175,5 @@
 		fileMenu.add(openAction);
 		fileMenu.add(saveAction);
+		fileMenu.add(saveAsAction);
 		fileMenu.add(gpxExportAction);
 		fileMenu.addSeparator();
@@ -247,5 +250,5 @@
 	public final OsmDataLayer editLayer() {
 		if (map == null || map.mapView.editLayer == null)
-			addLayer(new OsmDataLayer(ds, tr("unnamed"), false));
+			addLayer(new OsmDataLayer(ds, tr("unnamed"), null));
 		return map.mapView.editLayer;
 	}
Index: src/org/openstreetmap/josm/actions/DiskAccessAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/DiskAccessAction.java	(revision 137)
+++ src/org/openstreetmap/josm/actions/DiskAccessAction.java	(revision 138)
@@ -15,4 +15,26 @@
  */
 abstract public class DiskAccessAction extends JosmAction {
+
+	/**
+	 * Checks whether it is ok to launch a save (whether we have data,
+	 * there is no conflict etc...)
+	 * @return <code>true</code>, if it is save to save.
+	 */
+	public boolean checkSaveConditions() {
+        if (Main.map == null) {
+    		JOptionPane.showMessageDialog(Main.parent, tr("No document open so nothing to save."));
+    		return false;
+    	}
+    	if (isDataSetEmpty() && JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog(Main.parent,tr("The document contains no data. Save anyway?"), tr("Empty document"), JOptionPane.YES_NO_OPTION))
+    		return false;
+    	if (!Main.map.conflictDialog.conflicts.isEmpty()) {
+    		int answer = JOptionPane.showConfirmDialog(Main.parent, 
+    				tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"),tr("Conflicts"), JOptionPane.YES_NO_OPTION);
+    		if (answer != JOptionPane.YES_OPTION)
+    			return false;
+    	}
+    	return true;
+    }
+
 
 	public DiskAccessAction(String name, String iconName, String tooltip, int shortCut, int modifiers) {
@@ -35,5 +57,5 @@
 	}
 	
-	protected JFileChooser createAndOpenFileChooser(boolean open, boolean multiple) {
+	protected static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple) {
 		String curDir = Main.pref.get("lastDirectory");
 		if (curDir.equals(""))
Index: src/org/openstreetmap/josm/actions/DownloadAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/DownloadAction.java	(revision 137)
+++ src/org/openstreetmap/josm/actions/DownloadAction.java	(revision 138)
@@ -79,5 +79,5 @@
 			if (dataSet.allPrimitives().isEmpty())
 				errorMessage = tr("No data imported.");
-			Main.main.addLayer(new OsmDataLayer(dataSet, tr("Data Layer"), false));
+			Main.main.addLayer(new OsmDataLayer(dataSet, tr("Data Layer"), null));
 		}
 
@@ -106,5 +106,5 @@
 				return;
 			String name = latlon[0].getText() + " " + latlon[1].getText() + " x " + latlon[2].getText() + " " + latlon[3].getText();
-			Main.main.addLayer(new RawGpsLayer(rawData, name));
+			Main.main.addLayer(new RawGpsLayer(rawData, name, null));
 		}
 
Index: src/org/openstreetmap/josm/actions/DownloadIncompleteAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/DownloadIncompleteAction.java	(revision 137)
+++ src/org/openstreetmap/josm/actions/DownloadIncompleteAction.java	(revision 138)
@@ -61,5 +61,5 @@
 				startDownloadNodes();
 			else if (errorMessage == null)
-				Main.main.addLayer(new OsmDataLayer(dataSet, tr("Data Layer"), false));
+				Main.main.addLayer(new OsmDataLayer(dataSet, tr("Data Layer"), null));
 		}
 
Index: src/org/openstreetmap/josm/actions/OpenAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/OpenAction.java	(revision 137)
+++ src/org/openstreetmap/josm/actions/OpenAction.java	(revision 138)
@@ -53,29 +53,29 @@
 	 * Open the given file.
 	 */
-	public void openFile(File filename) {
-		String fn = filename.getName();
+	public void openFile(File file) {
+		String fn = file.getName();
 		try {
 			if (asRawData(fn)) {
 				Collection<Collection<GpsPoint>> data;
 				if (ExtensionFileFilter.filters[ExtensionFileFilter.GPX].acceptName(fn)) {
-					data = RawGpsReader.parse(new FileInputStream(filename));
+					data = RawGpsReader.parse(new FileInputStream(file));
 				} else if (ExtensionFileFilter.filters[ExtensionFileFilter.CSV].acceptName(fn)) {
 					data = new LinkedList<Collection<GpsPoint>>();
-					data.add(new RawCsvReader(new FileReader(filename)).parse());
+					data.add(new RawCsvReader(new FileReader(file)).parse());
 				} else
 					throw new IllegalStateException();
-				Main.main.addLayer(new RawGpsLayer(data, filename.getName()));
+				Main.main.addLayer(new RawGpsLayer(data, file.getName(), file));
 			} else {
 				DataSet dataSet;
 				if (ExtensionFileFilter.filters[ExtensionFileFilter.OSM].acceptName(fn)) {
-					dataSet = OsmReader.parseDataSet(new FileInputStream(filename), null, null);
+					dataSet = OsmReader.parseDataSet(new FileInputStream(file), null, null);
 				} else if (ExtensionFileFilter.filters[ExtensionFileFilter.CSV].acceptName(fn)) {
 					JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("CSV Data import for non-GPS data is not implemented yet."));
 					return;
 				} else {
-					JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("Unknown file extension: {0}", fn.substring(filename.getName().lastIndexOf('.')+1)));
+					JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("Unknown file extension: {0}", fn.substring(file.getName().lastIndexOf('.')+1)));
 					return;
 				}
-				Main.main.addLayer(new OsmDataLayer(dataSet, tr("Data Layer"), true));
+				Main.main.addLayer(new OsmDataLayer(dataSet, file.getName(), file));
 			}
 		} catch (SAXException x) {
Index: src/org/openstreetmap/josm/actions/RenameLayerAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 138)
+++ src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 138)
@@ -0,0 +1,88 @@
+package org.openstreetmap.josm.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+import javax.swing.AbstractAction;
+import javax.swing.Box;
+import javax.swing.JCheckBox;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+import javax.swing.JTextField;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+/**
+ * Action to rename an specific layer. Provides the option to rename the
+ * file, this layer was loaded from as well (if it was loaded from a file).
+ * 
+ * @author Imi
+ */
+public class RenameLayerAction extends AbstractAction {
+
+	private File file;
+	private Layer layer;
+
+	/**
+	 * @param file The filen of the original location of this layer.
+	 * 		If null, no possibility to "rename the file as well" is provided. 
+	 */
+	public RenameLayerAction(File file, Layer layer) {
+		super(tr("Rename layer"), ImageProvider.get("dialogs", "edit"));
+		this.file = file;
+		this.layer = layer;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		Box panel = Box.createVerticalBox();
+		final JTextField name = new JTextField(layer.name);
+		panel.add(name);
+		JCheckBox filerename = new JCheckBox(tr("Also rename the file"));
+		panel.add(filerename);
+		filerename.setEnabled(file != null);
+		if (filerename.isEnabled())
+			filerename.setSelected(Main.pref.getBoolean("layer.rename-file", true));
+
+		final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
+			@Override public void selectInitialValue() {
+				name.requestFocusInWindow();
+				name.selectAll();
+			}
+		};
+		final JDialog dlg = optionPane.createDialog(Main.parent, tr("Rename layer"));
+		dlg.setVisible(true);
+
+		Object answer = optionPane.getValue();
+		if (answer == null || answer == JOptionPane.UNINITIALIZED_VALUE ||
+				(answer instanceof Integer && (Integer)answer != JOptionPane.OK_OPTION)) {
+			return;
+		}
+
+		String nameText = name.getText();
+		if (filerename.isEnabled()) {
+			Main.pref.put("layer.rename-file", filerename.isSelected());
+			if (filerename.isSelected()) {
+				String newname = nameText;
+				if (newname.indexOf("/") == -1 && newname.indexOf("\\") == -1)
+					newname = file.getParent() + File.separator + newname;
+				String oldname = file.getName();
+				if (name.getText().indexOf('.') == -1 && oldname.indexOf('.') >= 0)
+					newname += oldname.substring(oldname.lastIndexOf('.'));
+				File newFile = new File(newname);
+				if (file.renameTo(newFile)) {
+					layer.associatedFile = newFile;
+					nameText = newFile.getName();
+				} else {
+					JOptionPane.showMessageDialog(Main.parent, tr("Could not rename the file \"{0}\".", file.getPath()));
+					return;
+				}
+			}
+		}
+		layer.name = nameText;
+		Main.parent.repaint();
+	}
+}
Index: src/org/openstreetmap/josm/actions/SaveAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/SaveAction.java	(revision 137)
+++ 	(revision )
@@ -1,84 +1,0 @@
-package org.openstreetmap.josm.actions;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import javax.swing.filechooser.FileFilter;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.io.OsmWriter;
-
-/**
- * Export the data  as OSM intern xml file.
- * 
- * @author imi
- */
-public class SaveAction extends DiskAccessAction {
-    
-	/**
-	 * Construct the action with "Save" as label.
-	 * @param layer Save only this layer. If <code>null</code>, save the whole Main 
-	 * 		data set.
-	 */
-	public SaveAction() {
-		super(tr("Save"), "save", tr("Save the current data."), KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK);
-	}
-	
-	public void actionPerformed(ActionEvent event) {
-		if (Main.map == null) {
-			JOptionPane.showMessageDialog(Main.parent, tr("No document open so nothing to save."));
-			return;
-		}
-		if (isDataSetEmpty() && JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog(Main.parent,tr("The document contains no data. Save anyway?"), tr("Empty document"), JOptionPane.YES_NO_OPTION))
-			return;
-		if (!Main.map.conflictDialog.conflicts.isEmpty()) {
-			int answer = JOptionPane.showConfirmDialog(Main.parent, 
-					tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"),tr("Conflicts"), JOptionPane.YES_NO_OPTION);
-			if (answer != JOptionPane.YES_OPTION)
-				return;
-		}
-
-		JFileChooser fc = createAndOpenFileChooser(false, false);
-		if (fc == null)
-			return;
-
-		File file = fc.getSelectedFile();
-
-		try {
-			String fn = file.getPath();
-			if (fn.indexOf('.') == -1) {
-				FileFilter ff = fc.getFileFilter();
-				if (ff instanceof ExtensionFileFilter)
-					fn = "." + ((ExtensionFileFilter)ff).defaultExtension;
-				else
-					fn += ".osm";
-				file = new File(fn);
-			}
-			if (ExtensionFileFilter.filters[ExtensionFileFilter.GPX].acceptName(fn)) {
-				GpxExportAction.exportGpx(file, Main.main.editLayer());
-				Main.main.editLayer().cleanData(null, false);
-				return;
-			} else if (ExtensionFileFilter.filters[ExtensionFileFilter.OSM].acceptName(fn)) {
-				OsmWriter.output(new FileOutputStream(file), Main.ds, false);
-				Main.main.editLayer().cleanData(null, false);
-			} else if (ExtensionFileFilter.filters[ExtensionFileFilter.CSV].acceptName(fn)) {
-				JOptionPane.showMessageDialog(Main.parent, tr("CSV output not supported yet."));
-				return;
-			} else {
-				JOptionPane.showMessageDialog(Main.parent, tr("Unknown file extension."));
-				return;
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-			JOptionPane.showMessageDialog(Main.parent, tr("An error occoured while saving.")+"\n"+e.getMessage());
-		}
-	}
-}
Index: src/org/openstreetmap/josm/actions/SaveAsAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/SaveAsAction.java	(revision 138)
+++ src/org/openstreetmap/josm/actions/SaveAsAction.java	(revision 138)
@@ -0,0 +1,63 @@
+package org.openstreetmap.josm.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.io.File;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.openstreetmap.josm.Main;
+
+/**
+ * Export the data  as OSM intern xml file.
+ * 
+ * @author imi
+ */
+public class SaveAsAction extends DiskAccessAction {
+    
+	/**
+	 * Construct the action with "Save" as label.
+	 * @param layer Save only this layer. If <code>null</code>, save the whole Main 
+	 * 		data set.
+	 */
+	public SaveAsAction() {
+		super(tr("Save as"), "save_as", tr("Save the current data to a new file."), KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
+	}
+	
+	public void actionPerformed(ActionEvent event) {
+		if (!checkSaveConditions())
+			return;
+
+		File file = openFileDialog();
+		if (file == null)
+			return;
+
+		SaveAction.save(file);
+		Main.main.editLayer().name = file.getName();
+		Main.main.editLayer().associatedFile = file;
+		Main.parent.repaint();
+	}
+
+	public static File openFileDialog() {
+	    JFileChooser fc = createAndOpenFileChooser(false, false);
+		if (fc == null)
+			return null;
+
+		File file = fc.getSelectedFile();
+
+		String fn = file.getPath();
+		if (fn.indexOf('.') == -1) {
+			FileFilter ff = fc.getFileFilter();
+			if (ff instanceof ExtensionFileFilter)
+				fn = "." + ((ExtensionFileFilter)ff).defaultExtension;
+			else
+				fn += ".osm";
+			file = new File(fn);
+		}
+	    return file;
+    }
+}
Index: src/org/openstreetmap/josm/actions/mapmode/AddSegmentAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/AddSegmentAction.java	(revision 137)
+++ src/org/openstreetmap/josm/actions/mapmode/AddSegmentAction.java	(revision 138)
@@ -145,4 +145,5 @@
 			Segment ls = new Segment(start, end);
 			Main.main.editLayer().add(new AddCommand(ls));
+			Main.ds.setSelected(ls);
 		}
 
Index: src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- src/org/openstreetmap/josm/gui/MainApplication.java	(revision 137)
+++ src/org/openstreetmap/josm/gui/MainApplication.java	(revision 138)
@@ -70,4 +70,15 @@
 	 */
 	public static void main(final String[] argArray) {
+		/////////////////////////////////////////////////////////////////////////
+		//                        TO ALL TRANSLATORS
+		/////////////////////////////////////////////////////////////////////////
+		// Do not translate the early strings below until the locale is set up.
+		// The cannot be translated. That's live. Really. Sorry.
+		//
+		// The next sending me a patch translating these strings owe me a beer!
+		//
+		//                                                                 Imi.
+		/////////////////////////////////////////////////////////////////////////
+		
 		Thread.setDefaultUncaughtExceptionHandler(new BugReportExceptionHandler());
 
@@ -104,5 +115,5 @@
 		} catch (final IOException e1) {
 			e1.printStackTrace();
-			JOptionPane.showMessageDialog(null, "Preferences could not be loaded. Write default preference file to "+pref.getPreferencesDir()+"preferences");
+			JOptionPane.showMessageDialog(null, "Preferences could not be loaded. Writing default preference file to "+pref.getPreferencesDir()+"preferences");
 			Main.pref.resetToDefault();
 		}
Index: src/org/openstreetmap/josm/gui/MapMover.java
===================================================================
--- src/org/openstreetmap/josm/gui/MapMover.java	(revision 137)
+++ src/org/openstreetmap/josm/gui/MapMover.java	(revision 138)
@@ -32,5 +32,4 @@
         }
 	    public void actionPerformed(ActionEvent e) {
-	    	System.out.println("e="+e.toString()+" action="+e.getActionCommand());
 	    	if (action.equals(".") || action.equals(",")) {
 	    		Point mouse = nc.getMousePosition();
Index: src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 137)
+++ src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 138)
@@ -96,4 +96,8 @@
 		String key = data.getValueAt(row, 0).toString();
 		Collection<OsmPrimitive> sel = Main.ds.getSelected();
+		if (sel.isEmpty()) {
+			JOptionPane.showMessageDialog(Main.parent, tr("Please select the objects you want to change properties for."));
+			return;
+		}
 		String msg = "<html>"+trn("This will change {0} object.", "This will change {0} objects.", sel.size(), sel.size())+"<br><br> "+tr("Please select a new value for \"{0}\".<br>(Empty string deletes the key.)", key)+"</html>";
 		final JComboBox combo = (JComboBox)data.getValueAt(row, 1);
@@ -144,4 +148,8 @@
 	void add() {
 		Collection<OsmPrimitive> sel = Main.ds.getSelected();
+		if (sel.isEmpty()) {
+			JOptionPane.showMessageDialog(Main.parent, tr("Please select objects for which you want to change properties."));
+			return;
+		}
 
 		JPanel p = new JPanel(new BorderLayout());
Index: src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java	(revision 137)
+++ src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java	(revision 138)
@@ -48,4 +48,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.RenameLayerAction;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -53,4 +54,5 @@
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
 import org.openstreetmap.josm.gui.dialogs.LayerList;
 import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
@@ -85,5 +87,5 @@
 		private final RawGpsLayer gpsLayer;
 		public Loader(Collection<File> files, RawGpsLayer gpsLayer) {
-			super(tr("Images"));
+			super(tr("Images for {0}", gpsLayer.name));
 			this.files = files;
 			this.gpsLayer = gpsLayer;
@@ -221,4 +223,11 @@
 		};
 		Main.map.mapView.addMouseListener(mouseAdapter);
+		Main.map.mapView.addLayerChangeListener(new LayerChangeListener(){
+			public void activeLayerChange(Layer oldLayer, Layer newLayer) {}
+			public void layerAdded(Layer newLayer) {}
+			public void layerRemoved(Layer oldLayer) {
+				Main.map.mapView.removeMouseListener(mouseAdapter);
+			}
+		});
 	}
 
@@ -353,4 +362,6 @@
 				new JSeparator(),
 				sync,
+				new JSeparator(),
+				new JMenuItem(new RenameLayerAction(null, this)),
 				new JSeparator(), 
 				new JMenuItem(new LayerListPopup.InfoAction(this))};
@@ -406,5 +417,4 @@
 			try {
 				delta = DateParser.parse(gpsText.getText()).getTime() - exifDate.getTime();
-				Main.pref.put("tagimages.delta", ""+delta);
 				String time = gpsTimezone.getText();
 				if (!time.equals("") && time.charAt(0) == '+')
@@ -412,8 +422,11 @@
 				if (time.equals(""))
 					time = "0";
-				Main.pref.put("tagimages.gpstimezone", time);
 				gpstimezone = Long.valueOf(time)*60*60*1000;
+				Main.pref.put("tagimages.delta", ""+delta);
+                Main.pref.put("tagimages.gpstimezone", time);
 				calculatePosition();
 				return;
+			} catch (NumberFormatException x) {
+				JOptionPane.showMessageDialog(Main.parent, tr("Time entered could not be parsed."));
 			} catch (ParseException x) {
 				JOptionPane.showMessageDialog(Main.parent, tr("Time entered could not be parsed."));
@@ -435,7 +448,3 @@
 		return new ImageIcon(img.getScaledInstance(w, h, Image.SCALE_SMOOTH));
 	}
-
-	@Override public void layerRemoved() {
-		Main.map.mapView.removeMouseListener(mouseAdapter);
-    }
 }
Index: src/org/openstreetmap/josm/gui/layer/Layer.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 137)
+++ src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 138)
@@ -3,4 +3,5 @@
 import java.awt.Component;
 import java.awt.Graphics;
+import java.io.File;
 
 import javax.swing.Icon;
@@ -33,5 +34,9 @@
 	 * The name of this layer.
 	 */
-	public final String name;
+	public String name;
+	/**
+	 * If a file is associated with this layer, this variable should be set to it.
+	 */
+	public File associatedFile;
 
 	/**
@@ -83,8 +88,3 @@
 	
 	abstract public Component[] getMenuEntries();
-	
-	/**
-	 * Called, when the layer is removed from the list. (See it as an destructor)
-	 */
-	public void layerRemoved() {}
 }
Index: src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 137)
+++ src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 138)
@@ -8,4 +8,5 @@
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
+import java.io.File;
 import java.util.Collection;
 import java.util.HashSet;
@@ -24,5 +25,7 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.GpxExportAction;
+import org.openstreetmap.josm.actions.RenameLayerAction;
 import org.openstreetmap.josm.actions.SaveAction;
+import org.openstreetmap.josm.actions.SaveAsAction;
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -114,8 +117,9 @@
 	 * Construct a OsmDataLayer.
 	 */
-	public OsmDataLayer(final DataSet data, final String name, final boolean fromDisk) {
+	public OsmDataLayer(final DataSet data, final String name, final File associatedFile) {
 		super(name);
 		this.data = data;
-		this.fromDisk = fromDisk;
+		this.fromDisk = associatedFile != null;
+		this.associatedFile = associatedFile;
 	}
 
@@ -151,7 +155,11 @@
 
 	@Override public String getToolTipText() {
-		return undeletedSize(data.nodes)+" "+trn("node", "nodes", undeletedSize(data.nodes))+
-		undeletedSize(data.segments)+" "+trn("segment", "segments", undeletedSize(data.segments))+
-		undeletedSize(data.ways)+" "+trn("way", "ways", undeletedSize(data.ways));
+		String tool = "";
+		tool += undeletedSize(data.nodes)+" "+trn("node", "nodes", undeletedSize(data.nodes))+", ";
+		tool += undeletedSize(data.segments)+" "+trn("segment", "segments", undeletedSize(data.segments))+", ";
+		tool += undeletedSize(data.ways)+" "+trn("way", "ways", undeletedSize(data.ways));
+		if (associatedFile != null)
+			tool = "<html>"+tool+"<br>"+associatedFile.getPath()+"</html>";
+		return tool;
 	}
 
@@ -320,6 +328,9 @@
 				new JSeparator(),
 				new JMenuItem(new SaveAction()),
+				new JMenuItem(new SaveAsAction()),
 				new JMenuItem(new GpxExportAction(this)),
 				new JSeparator(),
+				new JMenuItem(new RenameLayerAction(associatedFile, this)),
+				new JSeparator(),
 				new JMenuItem(new LayerListPopup.InfoAction(this))};
 	}
Index: src/org/openstreetmap/josm/gui/layer/RawGpsLayer.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/RawGpsLayer.java	(revision 137)
+++ src/org/openstreetmap/josm/gui/layer/RawGpsLayer.java	(revision 138)
@@ -24,8 +24,10 @@
 import javax.swing.JRadioButton;
 import javax.swing.JSeparator;
+import javax.swing.SwingUtilities;
 import javax.swing.filechooser.FileFilter;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.GpxExportAction;
+import org.openstreetmap.josm.actions.RenameLayerAction;
 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -37,4 +39,5 @@
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
 import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
 import org.openstreetmap.josm.gui.dialogs.LayerList;
 import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
@@ -71,5 +74,5 @@
 				ds.ways.add(w);
 			}
-			Main.main.addLayer(new OsmDataLayer(ds, tr("Data Layer"), true));
+			Main.main.addLayer(new OsmDataLayer(ds, tr("Data Layer"), null));
 			Main.main.removeLayer(RawGpsLayer.this);
         }
@@ -92,8 +95,20 @@
 	public final Collection<Collection<GpsPoint>> data;
 
-	public RawGpsLayer(Collection<Collection<GpsPoint>> data, String name) {
+	public RawGpsLayer(Collection<Collection<GpsPoint>> data, String name, File associatedFile) {
 		super(name);
+		this.associatedFile = associatedFile;
 		this.data = data;
 		Main.pref.listener.add(this);
+		SwingUtilities.invokeLater(new Runnable(){
+			public void run() {
+				Main.map.mapView.addLayerChangeListener(new LayerChangeListener(){
+					public void activeLayerChange(Layer oldLayer, Layer newLayer) {}
+					public void layerAdded(Layer newLayer) {}
+					public void layerRemoved(Layer oldLayer) {
+						Main.pref.listener.remove(RawGpsLayer.this);
+					}
+				});
+            }
+		});
 	}
 
@@ -142,6 +157,9 @@
 		for (Collection<GpsPoint> c : data)
 			points += c.size();
-		return data.size()+" "+trn("track", "tracks", data.size())
+		String tool = data.size()+" "+trn("track", "tracks", data.size())
 		+" "+points+" "+trn("point", "points", points);
+		if (associatedFile != null)
+			tool = "<html>"+tool+"<br>"+associatedFile.getPath()+"</html>";
+		return tool;
 	}
 
@@ -169,5 +187,5 @@
 		}
 		b.append("</html>");
-		return "<html>"+tr("{0} consists of {1} track", "{0} consists of {1} tracks", data.size(), name, data.size())+" ("+trn("{0} point", "{0} points", points, points)+")<br>"+b.toString();
+		return "<html>"+trn("{0} consists of {1} track", "{0} consists of {1} tracks", data.size(), name, data.size())+" ("+trn("{0} point", "{0} points", points, points)+")<br>"+b.toString();
 	}
 
@@ -257,4 +275,5 @@
             }
 		});
+		
 		return new Component[]{
 				new JMenuItem(new LayerList.ShowHideLayerAction(this)),
@@ -267,4 +286,6 @@
 				new JMenuItem(new ConvertToDataLayerAction()),
 				new JSeparator(),
+				new JMenuItem(new RenameLayerAction(associatedFile, this)),
+				new JSeparator(),
 				new JMenuItem(new LayerListPopup.InfoAction(this))};
     }
@@ -274,7 +295,3 @@
 			Main.map.repaint();
 	}
-
-	@Override public void layerRemoved() {
-		Main.pref.listener.remove(this);
-    }
 }
