Changeset 16558 in josm
- Timestamp:
- 2020-06-07T15:56:16+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r15152 r16558 23 23 import org.openstreetmap.josm.data.osm.Relation; 24 24 import org.openstreetmap.josm.data.osm.WaySegment; 25 import org.openstreetmap.josm.gui.ExtendedDialog; 25 26 import org.openstreetmap.josm.gui.MainApplication; 26 27 import org.openstreetmap.josm.gui.MapFrame; … … 161 162 if (c != null) { 162 163 UndoRedoHandler.getInstance().add(c); 164 if (changesHiddenWay(c)) { 165 final ConfirmDeleteDialog ed = new ConfirmDeleteDialog(); 166 ed.setContent(tr("Are you sure that you want to delete elements with attached ways that are hidden by filters?")); 167 ed.toggleEnable("deletedHiddenElements"); 168 if (ed.showDialog().getValue() != 1) { 169 UndoRedoHandler.getInstance().undo(1); 170 return; 171 } 172 } 173 163 174 //FIXME: This should not be required, DeleteCommand should update the selection, otherwise undo/redo won't work. 164 175 lm.getEditDataSet().setSelected(); … … 426 437 giveUserFeedback(oldEvent, modifiers); 427 438 } 439 440 private boolean changesHiddenWay(Command c) { 441 return c.getParticipatingPrimitives().stream().anyMatch(OsmPrimitive::isDisabledAndHidden); 442 } 443 444 static class ConfirmDeleteDialog extends ExtendedDialog { 445 ConfirmDeleteDialog() { 446 super(MainApplication.getMainFrame(), 447 tr("Delete elements"), 448 tr("Delete them"), tr("Undo delete")); 449 setButtonIcons("dialogs/delete", "cancel"); 450 setCancelButton(2); 451 } 452 } 453 428 454 }
Note:
See TracChangeset
for help on using the changeset viewer.