Changeset 5057 in josm for trunk


Ignore:
Timestamp:
2012-03-08T21:57:12+01:00 (8 years ago)
Author:
simon04
Message:

fix #4552 - "Object $id is already deleted" in upload dialog should be "node/way/relation $id is already ..."

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java

    r4534 r5057  
    1919import org.openstreetmap.josm.data.osm.ChangesetCache;
    2020import org.openstreetmap.josm.data.osm.IPrimitive;
     21import org.openstreetmap.josm.data.osm.Node;
    2122import org.openstreetmap.josm.data.osm.OsmPrimitive;
     23import org.openstreetmap.josm.data.osm.Relation;
     24import org.openstreetmap.josm.data.osm.Way;
    2225import org.openstreetmap.josm.gui.DefaultNameFormatter;
    2326import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     
    188191        if (p.isDeleted()) {
    189192            // we tried to delete an already deleted primitive.
    190             //
    191             System.out.println(tr("Warning: object ''{0}'' is already deleted on the server. Skipping this object and retrying to upload.", p.getDisplayName(DefaultNameFormatter.getInstance())));
    192             monitor.appendLogMessage(tr("Object ''{0}'' is already deleted. Skipping object in upload.",p.getDisplayName(DefaultNameFormatter.getInstance())));
     193            final String msg;
     194            final String displayName = p.getDisplayName(DefaultNameFormatter.getInstance());
     195            if (p instanceof Node) {
     196                msg = tr("Node ''{0}'' is already deleted. Skipping object in upload.", displayName);
     197            } else if (p instanceof Way) {
     198                msg = tr("Way ''{0}'' is already deleted. Skipping object in upload.", displayName);
     199            } else if (p instanceof Relation) {
     200                msg = tr("Relation ''{0}'' is already deleted. Skipping object in upload.", displayName);
     201            } else {
     202                msg = tr("Object ''{0}'' is already deleted. Skipping object in upload.", displayName);
     203            }
     204            monitor.appendLogMessage(msg);
     205            System.out.println(tr("Warning: {0}", msg));
    193206            processedPrimitives.addAll(writer.getProcessedPrimitives());
    194207            processedPrimitives.add(p);
Note: See TracChangeset for help on using the changeset viewer.