- Timestamp:
- 2009-06-20T09:31:00+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskList.java
r1676 r1682 21 21 import org.openstreetmap.josm.data.osm.DataSet; 22 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;24 23 import org.openstreetmap.josm.gui.download.DownloadDialog.DownloadTask; 25 24 import org.openstreetmap.josm.gui.layer.Layer; … … 136 135 + "There are {0} primitives in your local dataset which<br>" 137 136 + "might be deleted on the server. If you later try to delete or<br>" 138 + "update them on the serverthe server is likely to report a<br>"137 + "update them the server is likely to report a<br>" 139 138 + "conflict.<br>" 140 139 + "<br>" … … 177 176 } 178 177 179 180 178 public Set<Long> getDownloadedIds() { 181 179 HashSet<Long> ret = new HashSet<Long>(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r1677 r1682 29 29 30 30 import org.openstreetmap.josm.Main; 31 import org.openstreetmap.josm.command.ConflictResolveCommand;32 31 import org.openstreetmap.josm.data.SelectionChangedListener; 33 32 import org.openstreetmap.josm.data.osm.DataSet; … … 39 38 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 40 39 import org.openstreetmap.josm.data.osm.visitor.Visitor; 41 import org.openstreetmap.josm.gui.ConflictResolver;42 import org.openstreetmap.josm.gui.ExtendedDialog;43 40 import org.openstreetmap.josm.gui.NavigatableComponent; 44 41 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; … … 109 106 110 107 private final void resolve() { 111 String method = Main.pref.get("conflict.resolution", "extended");112 method = method.trim().toLowerCase();113 if (method.equals("traditional")) {114 resolveTraditional();115 } else if (method.equals("extended")) {116 resolveExtended();117 } else {118 System.out.println(tr("WARNING: unexpected value for preference conflict.resolution, got " + method));119 resolveTraditional();120 }121 }122 123 124 private final void resolveExtended() {125 108 if(model.size() == 1) { 126 109 displaylist.setSelectedIndex(0); … … 139 122 dialog.getConflictResolver().populate(my, their); 140 123 dialog.setVisible(true); 141 Main.map.mapView.repaint();142 }143 144 145 private final void resolveTraditional() {146 if(model.size() == 1) {147 displaylist.setSelectedIndex(0);148 }149 150 if (displaylist.getSelectedIndex() == -1)151 return;152 Map<OsmPrimitive, OsmPrimitive> sel = new HashMap<OsmPrimitive, OsmPrimitive>();153 for (int i : displaylist.getSelectedIndices()) {154 OsmPrimitive s = (OsmPrimitive)model.get(i);155 sel.put(s, conflicts.get(s));156 }157 ConflictResolver resolver = new ConflictResolver(sel);158 int answer = new ExtendedDialog(Main.parent,159 tr("Resolve Conflicts"),160 resolver,161 new String[] { tr("Solve Conflict"), tr("Cancel") },162 new String[] { "dialogs/conflict.png", "cancel.png"}163 ).getValue();164 165 if (answer != 1)166 return;167 Main.main.undoRedo.add(new ConflictResolveCommand(resolver.conflicts, sel));168 124 Main.map.mapView.repaint(); 169 125 } -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r1677 r1682 307 307 * @return list of processed primitives 308 308 * @throws OsmTransferException if something is wrong 309 * @throws OsmTransferCancelledException if the upload was cancelled by the user310 309 */ 311 310 public Collection<OsmPrimitive> uploadDiff(final Collection<OsmPrimitive> list) throws OsmTransferException { -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r1677 r1682 84 84 processed = new LinkedList<OsmPrimitive>(); 85 85 86 // initialize API. Abort upload in case of configuration or network 87 // errors 88 // 89 try { 90 api.initialize(); 91 } catch(Exception e) { 92 throw new OsmApiInitializationException(e); 93 } 86 api.initialize(); 94 87 95 88 Main.pleaseWaitDlg.progress.setMaximum(primitives.size()); … … 125 118 // upload changes individually (90% of code is for the status display...) 126 119 // 120 api.createChangeset(getChangesetComment()); 127 121 NameVisitor v = new NameVisitor(); 128 122 uploadStartTime = System.currentTimeMillis(); … … 139 133 Main.pleaseWaitDlg.progress.setValue(progress+1); 140 134 } 135 api.stopChangeset(); 141 136 } 142 137 }
Note:
See TracChangeset
for help on using the changeset viewer.