Changeset 4217 in josm for trunk/src


Ignore:
Timestamp:
2011-07-09T21:00:26+02:00 (13 years ago)
Author:
stoecker
Message:

fix #6565 - patch by Don-vip - Improve progress bar for data update

File:
1 edited

Legend:

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

    r4191 r4217  
    300300        progressMonitor.subTask(tr("Downloading OSM data..."));
    301301        try {
    302             DataSet loaded = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
     302            DataSet loaded = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(pkg.size(), false));
    303303            rememberNodesOfIncompleteWaysToLoad(loaded);
    304304            merge(loaded);
     
    324324        progressMonitor.subTask(tr("Downloading OSM data..."));
    325325        try {
    326             DataSet loaded = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
     326            DataSet loaded = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(1, false));
    327327            rememberNodesOfIncompleteWaysToLoad(loaded);
    328328            merge(loaded);
     
    404404        case RELATION:  msg = tr("Fetching a package of relations from ''{0}''", OsmApi.getOsmApi().getBaseUrl()); break;
    405405        }
    406         progressMonitor.indeterminateSubTask(msg);
     406        progressMonitor.setTicksCount(ids.size());
     407        progressMonitor.setTicks(0);
    407408        Set<Long> toFetch = new HashSet<Long>(ids);
    408         toFetch.addAll(ids);
    409409        while(! toFetch.isEmpty() && !isCanceled()) {
    410410            Set<Long> pkg = extractIdPackage(toFetch);
     411            progressMonitor.subTask(msg + "... " + progressMonitor.getTicks() + "/" + progressMonitor.getTicksCount());
    411412            try {
    412413                multiGetIdPackage(type, pkg, progressMonitor);
Note: See TracChangeset for help on using the changeset viewer.