Ticket #17035: 17035-progress-monitor-v2.patch
File 17035-progress-monitor-v2.patch, 2.6 KB (added by , 5 years ago) |
---|
-
src/org/openstreetmap/josm/actions/ValidateAction.java
170 170 } 171 171 tests = null; 172 172 if (ValidatorPrefHelper.PREF_USE_IGNORE.get()) { 173 getProgressMonitor().setCustomText(""); 173 174 getProgressMonitor().subTask(tr("Updating ignored errors ...")); 174 175 for (TestError error : errors) { 175 176 if (canceled) return; -
src/org/openstreetmap/josm/data/validation/Test.java
76 76 /** the start time to compute elapsed time when test finishes */ 77 77 protected long startTime; 78 78 79 private boolean showElementCount; 80 79 81 /** 80 82 * Constructor 81 83 * @param name Name of the test … … 202 204 if (progressMonitor != null) { 203 205 progressMonitor.setTicksCount(selection.size()); 204 206 } 207 long cnt = 0; 205 208 for (OsmPrimitive p : selection) { 206 209 if (isCanceled()) { 207 210 break; … … 211 214 } 212 215 if (progressMonitor != null) { 213 216 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 } 214 223 } 215 224 } 216 225 } … … 380 389 public void clear() { 381 390 errors.clear(); 382 391 } 392 393 protected void setShowElements(boolean b) { 394 showElementCount = b; 395 } 383 396 } -
src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
1092 1092 @Override 1093 1093 public void startTest(ProgressMonitor progressMonitor) { 1094 1094 super.startTest(progressMonitor); 1095 super.setShowElements(true); 1095 1096 if (indexData == null) { 1096 1097 indexData = new IndexData(checks); 1097 1098 }