Changeset 1682 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
- Timestamp:
- 2009-06-20T09:31:00+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.