Ignore:
Timestamp:
2009-12-11T23:07:59+01:00 (16 years ago)
Author:
Gubaer
Message:

new: global in-memory cache for downloaded changesets
new: toggle dialog for changesets
new: downloading of changesets (currently without changeset content, will follow later)

File:
1 edited

Legend:

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

    r2599 r2613  
    1818import org.openstreetmap.josm.data.APIDataSet;
    1919import org.openstreetmap.josm.data.osm.Changeset;
     20import org.openstreetmap.josm.data.osm.ChangesetCache;
    2021import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2122import org.openstreetmap.josm.gui.DefaultNameFormatter;
     
    139140        // make sure the current changeset is removed from the upload dialog.
    140141        //
    141         UploadDialog.getUploadDialog().removeChangeset(changeset);
     142        ChangesetCache.getInstance().update(changeset);
    142143        Changeset newChangeSet = new Changeset();
    143144        newChangeSet.setKeys(this.changeset.getKeys());
     
    211212                layer.fireDataChange();
    212213                layer.onPostUploadToServer();
    213 
    214                 // make sure the upload dialog lists all known open changesets
    215                 //
    216                 if (lastException != null && lastException instanceof ChangesetClosedException) {
    217                     UploadDialog.getUploadDialog().removeChangeset(changeset);
    218                 } else {
    219                     UploadDialog.getUploadDialog().updateListOfChangesetsAfterUploadOperation(changeset);
    220                 }
     214                ChangesetCache.getInstance().update(changeset);
    221215            }
    222216        };
     
    298292        if (uploadCancelled)
    299293            return;
    300         if (lastException == null)
    301             return;
    302294
    303295        // depending on the success of the upload operation and on the policy for
     
    309301        Runnable r = new Runnable() {
    310302            public void run() {
     303                // if the changeset is still open after this upload we want it to
     304                // be selected on the next upload
     305                //
     306                ChangesetCache.getInstance().update(changeset);
     307                if (changeset != null && changeset.isOpen()) {
     308                    UploadDialog.getUploadDialog().setSelectedChangesetForNextUpload(changeset);
     309                }
     310                if (lastException == null)
     311                    return;
    311312                if (lastException instanceof ChangesetClosedException) {
    312313                    ChangesetClosedException e = (ChangesetClosedException)lastException;
     
    337338            }
    338339        };
    339         SwingUtilities.invokeLater(r);
     340        if (SwingUtilities.isEventDispatchThread()) {
     341            r.run();
     342        } else {
     343            SwingUtilities.invokeLater(r);
     344        }
    340345    }
    341346
Note: See TracChangeset for help on using the changeset viewer.