Ignore:
Timestamp:
2009-06-20T09:31:00+02:00 (15 years ago)
Author:
Gubaer
Message:

removed old conflict resolution code
fixed bug in OsmApi (missing changeset initialization)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r1677 r1682  
    2929
    3030import org.openstreetmap.josm.Main;
    31 import org.openstreetmap.josm.command.ConflictResolveCommand;
    3231import org.openstreetmap.josm.data.SelectionChangedListener;
    3332import org.openstreetmap.josm.data.osm.DataSet;
     
    3938import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    4039import org.openstreetmap.josm.data.osm.visitor.Visitor;
    41 import org.openstreetmap.josm.gui.ConflictResolver;
    42 import org.openstreetmap.josm.gui.ExtendedDialog;
    4340import org.openstreetmap.josm.gui.NavigatableComponent;
    4441import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     
    109106
    110107    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() {
    125108        if(model.size() == 1) {
    126109            displaylist.setSelectedIndex(0);
     
    139122        dialog.getConflictResolver().populate(my, their);
    140123        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));
    168124        Main.map.mapView.repaint();
    169125    }
Note: See TracChangeset for help on using the changeset viewer.