Changeset 35400 in osm for applications/editors/josm/plugins/reverter
- Timestamp:
- 2020-03-27T15:56:08+01:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/reverter/src/reverter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetCommand.java
r34953 r35400 19 19 * Create the command by specifying the list of commands to execute. 20 20 * @param name The description text 21 * @param sequenz The sequence that should beexecuted.21 * @param sequenz The sequence that was already executed. 22 22 */ 23 23 public RevertChangesetCommand(String name, Collection<Command> sequenz) { 24 24 super(name, sequenz); 25 25 ReverterPlugin.reverterUsed = true; 26 setSequenceComplete(true); 26 27 } 27 28 … … 36 37 } 37 38 39 @Override 40 public void undoCommand() { 41 getAffectedDataSet().update(super::undoCommand); 42 } 43 44 @Override 45 public boolean executeCommand() { 46 return getAffectedDataSet().update(super::executeCommand); 47 } 48 38 49 } -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetTask.java
r35310 r35400 15 15 16 16 import org.openstreetmap.josm.command.Command; 17 import org.openstreetmap.josm.command.SequenceCommand;18 17 import org.openstreetmap.josm.command.conflict.ConflictAddCommand; 19 18 import org.openstreetmap.josm.data.UndoRedoHandler; … … 99 98 newLayer = false; // reuse layer for subsequent reverts 100 99 } catch (OsmTransferException e) { 101 Logging.error(e); 100 if (!allcmds.isEmpty()) { 101 GuiHelper.runInEDT(() -> UndoRedoHandler.getInstance().undo(allcmds.size())); 102 } 103 Logging.error(e); 102 104 throw e; 103 105 } catch (UserCancelException e) { 106 if (!allcmds.isEmpty()) { 107 GuiHelper.runInEDT(() -> UndoRedoHandler.getInstance().undo(allcmds.size())); 108 } 104 109 Logging.warn("Revert canceled"); 105 110 Logging.trace(e); … … 108 113 } 109 114 if (!allcmds.isEmpty()) { 110 Command cmd = allcmds.size() == 1 ? allcmds.get(0) : new SequenceCommand(tr("Revert changesets"), allcmds);115 Command cmd = allcmds.size() == 1 ? allcmds.get(0) : new RevertChangesetCommand(tr("Revert changesets"), allcmds); 111 116 GuiHelper.runInEDT(() -> { 112 UndoRedoHandler.getInstance().add(cmd );117 UndoRedoHandler.getInstance().add(cmd, false); 113 118 if (numberOfConflicts > 0) { 114 119 MainApplication.getMap().conflictDialog.warnNumNewConflicts(numberOfConflicts); … … 169 174 numberOfConflicts++; 170 175 } 176 c.executeCommand(); 171 177 } 172 178 final String desc;
Note:
See TracChangeset
for help on using the changeset viewer.