Changeset 58 in josm for src/org/openstreetmap/josm/actions/UploadAction.java
- Timestamp:
- 2006-03-14T01:47:55+01:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/UploadAction.java
r52 r58 17 17 import org.jdom.JDOMException; 18 18 import org.openstreetmap.josm.Main; 19 import org.openstreetmap.josm.data.Preferences.PreferencesException; 19 20 import org.openstreetmap.josm.data.osm.OsmPrimitive; 20 import org.openstreetmap.josm.data.osm.Track;21 21 import org.openstreetmap.josm.gui.GBC; 22 22 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; … … 39 39 40 40 public void actionPerformed(ActionEvent e) { 41 42 //TODO: Remove this in later versions (temporary only) 43 if (Main.pref.osmDataServer.endsWith("/0.2") || Main.pref.osmDataServer.endsWith("/0.2/")) { 44 int answer = JOptionPane.showConfirmDialog(Main.main, 45 "You seem to have an outdated server entry in your preferences.\n" + 46 "\n" + 47 "As of JOSM Release 1.2, you must no longer specify the API version in\n" + 48 "the osm url. For the OSM standard server, use http://www.openstreetmap.org/api" + 49 "\n" + 50 "Fix settings and continue?", "Outdated server url detected.", JOptionPane.YES_NO_OPTION); 51 if (answer != JOptionPane.YES_OPTION) 52 return; 53 int cutPos = Main.pref.osmDataServer.endsWith("/0.2") ? 4 : 5; 54 Main.pref.osmDataServer = Main.pref.osmDataServer.substring(0, Main.pref.osmDataServer.length()-cutPos); 55 try { 56 Main.pref.save(); 57 } catch (PreferencesException x) { 58 x.printStackTrace(); 59 JOptionPane.showMessageDialog(Main.main, "Could not save the preferences chane:\n" + 60 x.getMessage()); 61 } 62 } 63 41 64 final Collection<OsmPrimitive> add = new LinkedList<OsmPrimitive>(); 42 65 final Collection<OsmPrimitive> update = new LinkedList<OsmPrimitive>(); 43 66 final Collection<OsmPrimitive> delete = new LinkedList<OsmPrimitive>(); 44 boolean acceptedTracks = false;45 67 for (OsmPrimitive osm : Main.main.ds.allPrimitives()) { 46 boolean doSomething = true;47 68 if (osm.id == 0 && !osm.isDeleted()) 48 69 add.add(osm); … … 51 72 else if (osm.isDeleted() && osm.id != 0) 52 73 delete.add(osm); 53 else54 doSomething = false;55 56 if (osm instanceof Track && doSomething && !acceptedTracks) {57 int answer = JOptionPane.showConfirmDialog(Main.main,58 "The server currently does not understand the concept of Tracks.\n" +59 "All tracks will be ignored on upload. Continue anyway?",60 "No Track support", JOptionPane.YES_NO_OPTION);61 if (answer != JOptionPane.YES_OPTION)62 return;63 acceptedTracks = true;64 }65 74 } 66 75 … … 88 97 }).start(); 89 98 } 90 99 91 100 /** 92 101 * Displays a screen where the actions that would be taken are displayed and
Note:
See TracChangeset
for help on using the changeset viewer.