Changeset 14381 in josm for trunk


Ignore:
Timestamp:
2018-10-28T21:04:34+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #16875 - command stack dialog was not updated after fixing errors from validator dialog

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r14282 r14381  
    55import java.util.Iterator;
    66import java.util.LinkedList;
     7import java.util.List;
    78import java.util.Objects;
    89
     
    305306        if (cmd != null) {
    306307            fireEvent(new CommandAddedEvent(this, cmd));
     308        }
     309        fireCommandsChanged();
     310    }
     311
     312    /**
     313     * Fires a commands change event after adding a list of commands.
     314     * @param cmds commands added
     315     * @since 14381
     316     */
     317    public void afterAdd(List<? extends Command> cmds) {
     318        if (cmds != null) {
     319            for (Command cmd : cmds) {
     320                fireEvent(new CommandAddedEvent(this, cmd));
     321            }
    307322        }
    308323        fireCommandsChanged();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r14153 r14381  
    534534    /**
    535535     * Task for fixing a collection of {@link TestError}s. Can be run asynchronously.
    536      *
    537      *
    538536     */
    539537    class FixTask extends PleaseWaitRunnable {
    540538        private final Collection<TestError> testErrors;
     539        private final List<Command> fixCommands = new ArrayList<>();
    541540        private boolean canceled;
    542541
     
    561560                if (fixCommand != null) {
    562561                    SwingUtilities.invokeAndWait(() -> UndoRedoHandler.getInstance().addNoRedraw(fixCommand));
     562                    fixCommands.add(fixCommand);
    563563                }
    564564                // It is wanted to ignore an error if it said fixable, even if fixCommand was null
     
    591591                monitor.subTask(tr("Updating map ..."));
    592592                SwingUtilities.invokeAndWait(() -> {
    593                     UndoRedoHandler.getInstance().afterAdd(null);
     593                    UndoRedoHandler.getInstance().afterAdd(fixCommands);
    594594                    invalidateValidatorLayers();
    595595                    tree.resetErrors();
Note: See TracChangeset for help on using the changeset viewer.