Index: /src/org/openstreetmap/josm/Main.java
===================================================================
--- /src/org/openstreetmap/josm/Main.java	(revision 168)
+++ /src/org/openstreetmap/josm/Main.java	(revision 169)
@@ -168,4 +168,5 @@
 		toolBar.add(menu.upload);
 		toolBar.addSeparator();
+		toolBar.add(menu.newAction);
 		toolBar.add(menu.open);
 		toolBar.add(menu.save);
@@ -323,4 +324,27 @@
 	}
 
+	public static boolean breakBecauseUnsavedChanges() {
+	    if (map != null) {
+	    	boolean modified = false;
+	    	boolean uploadedModified = false;
+	    	for (final Layer l : map.mapView.getAllLayers()) {
+	    		if (l instanceof OsmDataLayer && ((OsmDataLayer)l).isModified()) {
+	    			modified = true;
+	    			uploadedModified = ((OsmDataLayer)l).uploadedModified;
+	    			break;
+	    		}
+	    	}
+	    	if (modified) {
+	    		final String msg = uploadedModified ? "\n"+tr("Hint: Some changes came from uploading new data to the server.") : "";
+	    		final int answer = JOptionPane.showConfirmDialog(
+	    				parent, tr("There are unsaved changes. Discard the changes and continue?")+msg,
+	    				tr("Unsaved Changes"), JOptionPane.YES_NO_OPTION);
+	    		if (answer != JOptionPane.YES_OPTION)
+	    			return true;
+	    	}
+	    }
+	    return false;
+    }
+	
 	private static void downloadFromParamString(final boolean rawGps, String s) {
 		if (s.startsWith("http:")) {
Index: /src/org/openstreetmap/josm/actions/NewAction.java
===================================================================
--- /src/org/openstreetmap/josm/actions/NewAction.java	(revision 169)
+++ /src/org/openstreetmap/josm/actions/NewAction.java	(revision 169)
@@ -0,0 +1,24 @@
+package org.openstreetmap.josm.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import org.openstreetmap.josm.Main;
+
+public class NewAction extends JosmAction {
+
+
+	public NewAction() {
+		super(tr("New"), "new", tr("Create a new map."), KeyEvent.VK_N);
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (Main.breakBecauseUnsavedChanges())
+			return;
+		if (Main.map != null)
+			Main.main.removeLayer(Main.main.editLayer());
+		Main.main.editLayer(); // create new if empty
+	}
+}
Index: /src/org/openstreetmap/josm/actions/PreferencesAction.java
===================================================================
--- /src/org/openstreetmap/josm/actions/PreferencesAction.java	(revision 168)
+++ /src/org/openstreetmap/josm/actions/PreferencesAction.java	(revision 169)
@@ -36,7 +36,13 @@
 		JPanel prefPanel = new JPanel(new GridBagLayout());
 		prefPanel.add(prefDlg, GBC.eol().fill(GBC.BOTH));
-		
+
 		JOptionPane pane = new JOptionPane(prefPanel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
 		JDialog dlg = pane.createDialog(Main.parent, tr("Preferences"));
+		
+		if (dlg.getWidth() > 600)
+			dlg.setSize(600, dlg.getHeight());
+		if (dlg.getHeight() > 450)
+			dlg.setSize(dlg.getWidth(), 450);
+
 		dlg.setVisible(true);
 		if (pane.getValue() instanceof Integer && (Integer)pane.getValue() == JOptionPane.OK_OPTION)
Index: /src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MainApplication.java	(revision 168)
+++ /src/org/openstreetmap/josm/gui/MainApplication.java	(revision 169)
@@ -20,6 +20,4 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.plugins.PluginException;
 import org.openstreetmap.josm.plugins.PluginInformation;
@@ -42,23 +40,6 @@
 		mainFrame.addWindowListener(new WindowAdapter(){
 			@Override public void windowClosing(final WindowEvent arg0) {
-				if (Main.map != null) {
-					boolean modified = false;
-					boolean uploadedModified = false;
-					for (final Layer l : Main.map.mapView.getAllLayers()) {
-						if (l instanceof OsmDataLayer && ((OsmDataLayer)l).isModified()) {
-							modified = true;
-							uploadedModified = ((OsmDataLayer)l).uploadedModified;
-							break;
-						}
-					}
-					if (modified) {
-						final String msg = uploadedModified ? "\n"+tr("Hint: Some changes came from uploading new data to the server.") : "";
-						final int answer = JOptionPane.showConfirmDialog(
-								Main.parent, tr("There are unsaved changes. Really quit?")+msg,
-								tr("Unsaved Changes"), JOptionPane.YES_NO_OPTION);
-						if (answer != JOptionPane.YES_OPTION)
-							return;
-					}
-				}
+				if (Main.breakBecauseUnsavedChanges())
+					return;
 				System.exit(0);
 			}
Index: /src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MainMenu.java	(revision 168)
+++ /src/org/openstreetmap/josm/gui/MainMenu.java	(revision 169)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.actions.GpxExportAction;
 import org.openstreetmap.josm.actions.HelpAction;
+import org.openstreetmap.josm.actions.NewAction;
 import org.openstreetmap.josm.actions.OpenAction;
 import org.openstreetmap.josm.actions.PreferencesAction;
@@ -37,4 +38,5 @@
 	public final UndoAction undo = new UndoAction();
 	public final RedoAction redo = new RedoAction();
+	public final NewAction newAction = new NewAction();
 	public final OpenAction open = new OpenAction();
 	public final DownloadAction download = new DownloadAction();
@@ -62,4 +64,5 @@
 	public MainMenu() {
 		fileMenu.setMnemonic('F');
+		fileMenu.add(newAction);
 		fileMenu.add(open);
 		fileMenu.add(save);
Index: /src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MapView.java	(revision 168)
+++ /src/org/openstreetmap/josm/gui/MapView.java	(revision 169)
@@ -113,4 +113,6 @@
 			if (editLayer != null) {
 				editLayer.mergeFrom(layer);
+				if (autoScale)
+					recalculateCenterScale();
 				repaint();
 				return;
Index: /src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- /src/org/openstreetmap/josm/io/OsmReader.java	(revision 168)
+++ /src/org/openstreetmap/josm/io/OsmReader.java	(revision 169)
@@ -14,4 +14,5 @@
 
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -100,5 +101,5 @@
 					if (atts == null)
 						throw new SAXException(tr("Unknown version"));
-					if (!"0.3".equals(atts.getValue("version")))
+					if (!Main.pref.get("osm-server.version", "0.3").equals(atts.getValue("version")))
 						throw new SAXException(tr("Unknown version")+": "+atts.getValue("version"));
 				} else if (qName.equals("node")) {
Index: /src/org/openstreetmap/josm/io/OsmServerWriter.java
===================================================================
--- /src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 168)
+++ /src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 169)
@@ -153,7 +153,12 @@
 			OsmPrimitive osm, boolean addBody) {
 		try {
-			URL url = new URL(Main.pref.get("osm-server.url") + "/0.3/" + urlSuffix + "/" + osm.id);
+			String version = Main.pref.get("osm-server.version", "0.3");
+			URL url = new URL(
+					Main.pref.get("osm-server.url") +
+					"/" + version +
+					"/" + urlSuffix + 
+					"/" + ((version.equals("0.4") && osm.id==0) ? "create":osm.id));
 			System.out.println("upload to: "+url);
-			activeConnection = (HttpURLConnection) url.openConnection();
+			activeConnection = (HttpURLConnection)url.openConnection();
 			activeConnection.setConnectTimeout(15000);
 			activeConnection.setRequestMethod(requestMethod);
Index: /src/org/openstreetmap/josm/io/OsmWriter.java
===================================================================
--- /src/org/openstreetmap/josm/io/OsmWriter.java	(revision 168)
+++ /src/org/openstreetmap/josm/io/OsmWriter.java	(revision 169)
@@ -5,4 +5,5 @@
 import java.util.Map.Entry;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
@@ -33,5 +34,7 @@
 	public abstract static class Osm implements OsmWriterInterface {
 		public void header(PrintWriter out) {
-			out.println("<osm version='0.3' generator='JOSM'>");
+			out.print("<osm version='");
+			out.print(Main.pref.get("osm-server.version", "0.3"));
+			out.println("' generator='JOSM'>");
 		}
 		public void footer(PrintWriter out) {
Index: /src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- /src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 168)
+++ /src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 169)
@@ -48,6 +48,16 @@
 			String classPath = attr.getValue("Class-Path");
 			if (classPath != null) {
-				for (String s : classPath.split(classPath.contains(";") ? ";" : ":")) {
-					if (!s.startsWith("/") && !s.startsWith("\\") && !s.matches("^.:"))
+				String[] cp = classPath.split(" ");
+				StringBuilder entry = new StringBuilder();
+				for (String s : cp) {
+					entry.append(s);
+					if (s.endsWith("\\")) {
+						entry.setLength(entry.length()-1);
+						entry.append("%20"); // append the split character " " as html-encode
+						continue;
+					}
+					s = entry.toString();
+					entry = new StringBuilder();
+					if (!s.startsWith("/") && !s.startsWith("\\") && !s.matches("^.\\:"))
 						s = file.getParent() + File.separator + s;
 					libraries.add(new URL(getURLString(s)));
Index: /test/org/openstreetmap/josm/plugins/PluginInformationTest.java
===================================================================
--- /test/org/openstreetmap/josm/plugins/PluginInformationTest.java	(revision 169)
+++ /test/org/openstreetmap/josm/plugins/PluginInformationTest.java	(revision 169)
@@ -0,0 +1,23 @@
+package org.openstreetmap.josm.plugins;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+public class PluginInformationTest extends TestCase {
+
+	public void testConstructorExtractsAttributesFromManifest() throws Exception {
+		PluginInformation info = new PluginInformation(new File(getClass().getResource("simple.jar").getFile()));
+		String s = getClass().getResource(".").getFile();
+		
+		assertEquals(4, info.libraries.size());
+		assertEquals(s+"foo", info.libraries.get(1).getFile());
+		assertEquals(s+"bar", info.libraries.get(2).getFile());
+		assertEquals(s+"C:/Foo%20and%20Bar", info.libraries.get(3).getFile());
+		
+		assertEquals("imi", info.author);
+		assertEquals("Simple", info.className);
+		assertEquals("Simpler", info.description);
+		assertEquals(true, info.early);
+    }
+}
