Changeset 1682 in josm for trunk/src


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

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

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  
    2121import org.openstreetmap.josm.data.osm.DataSet;
    2222import org.openstreetmap.josm.data.osm.OsmPrimitive;
    23 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    2423import org.openstreetmap.josm.gui.download.DownloadDialog.DownloadTask;
    2524import org.openstreetmap.josm.gui.layer.Layer;
     
    136135                +  "There are {0} primitives in your local dataset which<br>"
    137136                + "might be deleted on the server. If you later try to delete or<br>"
    138                 + "update them on the server the server is likely to report a<br>"
     137                + "update them the server is likely to report a<br>"
    139138                + "conflict.<br>"
    140139                + "<br>"
     
    177176    }
    178177
    179 
    180178    public Set<Long> getDownloadedIds() {
    181179        HashSet<Long> ret = new HashSet<Long>();
  • 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    }
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r1677 r1682  
    307307     * @return list of processed primitives
    308308     * @throws OsmTransferException if something is wrong
    309      * @throws OsmTransferCancelledException  if the upload was cancelled by the user
    310309     */
    311310    public Collection<OsmPrimitive> uploadDiff(final Collection<OsmPrimitive> list) throws OsmTransferException {
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r1677 r1682  
    8484        processed = new LinkedList<OsmPrimitive>();
    8585
    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();
    9487
    9588        Main.pleaseWaitDlg.progress.setMaximum(primitives.size());
     
    125118            // upload changes individually (90% of code is for the status display...)
    126119            //
     120            api.createChangeset(getChangesetComment());
    127121            NameVisitor v = new NameVisitor();
    128122            uploadStartTime = System.currentTimeMillis();
     
    139133                Main.pleaseWaitDlg.progress.setValue(progress+1);
    140134            }
     135            api.stopChangeset();
    141136        }
    142137    }
Note: See TracChangeset for help on using the changeset viewer.