Changeset 14599 in josm for trunk/src/org


Ignore:
Timestamp:
2018-12-24T09:40:06+01:00 (6 years ago)
Author:
GerdP
Message:

fix #17035: Validator: Improve progress monitor (17035-progress-monitor-v2.patch)

  • Each test can enable a counter that shows "{0} of {1} elements done" for the tested OSM elements. The counter is increased in steps of 1000. For now this is only enabled for MapCSSTagChecker.
  • Don't show the name of the last executed test while postprocessing the results of all tests.
Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ValidateAction.java

    r14473 r14599  
    171171            tests = null;
    172172            if (ValidatorPrefHelper.PREF_USE_IGNORE.get()) {
     173                getProgressMonitor().setCustomText("");
    173174                getProgressMonitor().subTask(tr("Updating ignored errors ..."));
    174175                for (TestError error : errors) {
  • trunk/src/org/openstreetmap/josm/data/validation/Test.java

    r14473 r14599  
    7777    protected long startTime;
    7878
     79    private boolean showElementCount;
     80
    7981    /**
    8082     * Constructor
     
    203205            progressMonitor.setTicksCount(selection.size());
    204206        }
     207        long cnt = 0;
    205208        for (OsmPrimitive p : selection) {
    206209            if (isCanceled()) {
     
    212215            if (progressMonitor != null) {
    213216                progressMonitor.worked(1);
     217                cnt++;
     218                // add frequently changing info to progress monitor so that it
     219                // doesn't seem to hang when test takes long
     220                if (showElementCount && cnt % 1000 == 0) {
     221                    progressMonitor.setExtraText(tr("{0} of {1} elements done", cnt, selection.size()));
     222                }
    214223            }
    215224        }
     
    381390        errors.clear();
    382391    }
     392
     393    protected void setShowElements(boolean b) {
     394        showElementCount = b;
     395    }
    383396}
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r14540 r14599  
    10931093    public void startTest(ProgressMonitor progressMonitor) {
    10941094        super.startTest(progressMonitor);
     1095        super.setShowElements(true);
    10951096        if (indexData == null) {
    10961097            indexData = new IndexData(checks);
Note: See TracChangeset for help on using the changeset viewer.