Changeset 2751 in josm for trunk


Ignore:
Timestamp:
2010-01-07T09:46:17+01:00 (15 years ago)
Author:
Gubaer
Message:

Improved user feedback when downloading relations

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r2711 r2751  
    1717import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    1818import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    19 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2019import org.openstreetmap.josm.io.OsmServerObjectReader;
    2120import org.openstreetmap.josm.io.OsmTransferException;
     
    7675            final DataSet allDownloads = new DataSet();
    7776            int i=0;
     77            getProgressMonitor().setTicksCount(relations.size());
    7878            for (Relation relation: relations) {
    79                 progressMonitor.subTask(tr("({0}/{1}: Downloading relation ''{2}''...", i,relations.size(),relation.getDisplayName(DefaultNameFormatter.getInstance())));
     79                i++;
     80                getProgressMonitor().setCustomText(tr("({0}/{1}): Downloading relation ''{2}''...", i,relations.size(),relation.getDisplayName(DefaultNameFormatter.getInstance())));
    8081                synchronized (this) {
    8182                    if (cancelled) return;
    8283                    objectReader = new OsmServerObjectReader(relation.getPrimitiveId(), true /* full download */);
    8384                }
    84                 DataSet dataSet = objectReader.parseOsm(progressMonitor
    85                         .createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
     85                DataSet dataSet = objectReader.parseOsm(
     86                        getProgressMonitor().createSubTaskMonitor(0, false)
     87                );
    8688                if (dataSet == null)
    8789                    return;
     
    9294                DataSetMerger merger = new DataSetMerger(allDownloads, dataSet);
    9395                merger.merge();
     96                getProgressMonitor().worked(1);
    9497            }
    9598
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r2626 r2751  
    591591        try {
    592592            progressMonitor.beginTask(tr("Prepare OSM data...", 2));
    593             progressMonitor.subTask(tr("Parsing OSM data..."));
     593            progressMonitor.indeterminateSubTask(tr("Parsing OSM data..."));
    594594            InputSource inputSource = new InputSource(new InputStreamReader(source, "UTF-8"));
    595595            SAXParserFactory.newInstance().newSAXParser().parse(inputSource, reader.new Parser());
    596596            progressMonitor.worked(1);
    597597
    598             progressMonitor.subTask(tr("Preparing data set..."));
     598            progressMonitor.indeterminateSubTask(tr("Preparing data set..."));
    599599            reader.ds.beginUpdate();
    600600            try {
Note: See TracChangeset for help on using the changeset viewer.