Ticket #17401: 17401-v5.patch
| File 17401-v5.patch, 2.5 KB (added by , 7 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
89 89 private final SelectAction selectAction = new SelectAction(); 90 90 private final SelectAndZoomAction selectAndZoomAction = new SelectAndZoomAction(); 91 91 92 private boolean passive; 93 92 94 /** 93 95 * Constructs a new {@code CommandStackDialog}. 94 96 */ … … 550 552 add(selectAndZoomAction); 551 553 } 552 554 } 555 556 /** 557 * Allows to set the dialog into passive mode so that updates to the undo/redo tree are ignored 558 * @param b true: enable passive mode, false: disable passive mode and rebuild dialog 559 */ 560 public void setPassive(boolean b) { 561 if (passive) { 562 if (!b) { 563 passive = false; 564 UndoRedoHandler.getInstance().addCommandQueuePreciseListener(this); 565 buildTrees(); 566 } 567 } else { 568 passive = b; 569 if (passive) { 570 UndoRedoHandler.getInstance().removeCommandQueuePreciseListener(this); 571 } 572 } 573 } 553 574 } -
src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
618 618 @Override 619 619 protected void realRun() throws SAXException, IOException, OsmTransferException { 620 620 ProgressMonitor monitor = getProgressMonitor(); 621 CommandStackDialog cmdStackPanel = dialogsPanel.getToggleDialog(CommandStackDialog.class); 621 622 try { 623 if (cmdStackPanel != null && testErrors.size() > 100) { 624 cmdStackPanel.setPassive(true); 625 } 622 626 monitor.setTicksCount(testErrors.size()); 623 627 final DataSet ds = MainApplication.getLayerManager().getActiveDataSet(); 624 628 int i = 0; … … 646 650 throw new JosmRuntimeException(e); 647 651 } finally { 648 652 monitor.finishTask(); 653 if (cmdStackPanel != null) { 654 cmdStackPanel.setPassive(false); 655 } 649 656 } 650 657 } 651 658 }
