Changeset 13736 in josm for trunk/src/org
- Timestamp:
- 2018-05-13T01:32:56+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r13729 r13736 63 63 private DataSet ds; 64 64 private final transient List<Relation> addedRelations = new LinkedList<>(); 65 private final boolean addUndoRedo; 65 66 66 67 /** … … 457 458 /** 458 459 * Constructs a new {@code JoinAreasAction} with optional shortcut and adapters. 459 * @param addShortcutToolbarAdapters controls whether the shortcut should be registered or not, as for toolbar registration and adapters 460 * @param addShortcutToolbarAdapters controls whether the shortcut should be registered or not, 461 * as for toolbar registration, adapters creation and undo/redo integration 460 462 * @since 11611 461 463 */ … … 464 466 Shortcut.registerShortcut("tools:joinareas", tr("Tool: {0}", tr("Join overlapping Areas")), KeyEvent.VK_J, Shortcut.SHIFT) 465 467 : null, addShortcutToolbarAdapters, null, addShortcutToolbarAdapters); 468 addUndoRedo = addShortcutToolbarAdapters; 466 469 } 467 470 … … 566 569 //FIXME: this is dirty hack 567 570 makeCommitsOneAction(tr("Reverting changes")); 568 MainApplication.undoRedo.undo(); 569 MainApplication.undoRedo.redoCommands.clear(); 571 if (addUndoRedo) { 572 MainApplication.undoRedo.undo(); 573 MainApplication.undoRedo.redoCommands.clear(); 574 } 570 575 } 571 576 } … … 828 833 } 829 834 830 private staticvoid commitCommand(Command c) {831 if (Main.main != null ) {835 private void commitCommand(Command c) { 836 if (Main.main != null && addUndoRedo) { 832 837 MainApplication.undoRedo.add(c); 833 838 } else { … … 1596 1601 private void makeCommitsOneAction(String message) { 1597 1602 cmds.clear(); 1598 if (Main.main != null ) {1603 if (Main.main != null && addUndoRedo) { 1599 1604 UndoRedoHandler ur = MainApplication.undoRedo; 1600 1605 int i = Math.max(ur.commands.size() - cmdsCount, 0); -
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r13729 r13736 107 107 /** 108 108 * Event fired after a command has been added to the command queue. 109 * @since xxx109 * @since 13729 110 110 */ 111 111 public static final class CommandAddedEvent extends CommandQueueEvent { … … 134 134 /** 135 135 * Event fired after the command queue has been cleaned. 136 * @since xxx136 * @since 13729 137 137 */ 138 138 public static final class CommandQueueCleanedEvent extends CommandQueueEvent { … … 161 161 /** 162 162 * Event fired after a command has been undone. 163 * @since xxx163 * @since 13729 164 164 */ 165 165 public static final class CommandUndoneEvent extends CommandQueueEvent { … … 188 188 /** 189 189 * Event fired after a command has been redone. 190 * @since xxx190 * @since 13729 191 191 */ 192 192 public static final class CommandRedoneEvent extends CommandQueueEvent { -
trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java
r13729 r13736 30 30 import org.openstreetmap.josm.data.osm.UploadPolicy; 31 31 import org.openstreetmap.josm.data.osm.Way; 32 import org.openstreetmap.josm.gui.MainApplication;33 32 import org.openstreetmap.josm.io.IllegalDataException; 34 33 import org.openstreetmap.josm.io.OsmReader; … … 136 135 optimizedWays.addAll(ways); 137 136 } 138 // Clean command stack139 MainApplication.undoRedo.clean(data);140 137 return optimizedWays; 141 138 }
Note:
See TracChangeset
for help on using the changeset viewer.