Ticket #6186: do_not_ask_delete.patch
| File do_not_ask_delete.patch, 4.7 KB (added by , 15 years ago) |
|---|
-
src/org/openstreetmap/josm/actions/JoinAreasAction.java
41 41 import org.openstreetmap.josm.data.osm.RelationMember; 42 42 import org.openstreetmap.josm.data.osm.TagCollection; 43 43 import org.openstreetmap.josm.data.osm.Way; 44 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 44 45 import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog; 45 46 import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil; 46 47 import org.openstreetmap.josm.tools.Geometry; … … 330 331 331 332 allNodes.addAll(way.getNodes()); 332 333 } 333 334 334 // TODO: Only display this warning when nodes outside dataSourceArea are deleted 335 335 Area dataSourceArea = Main.main.getCurrentDataSet().getDataSourceArea(); 336 336 if (dataSourceArea != null) { 337 337 for (Node node : allNodes) { 338 338 if (!dataSourceArea.contains(node.getCoor())) { 339 int option = JOptionPane.showConfirmDialog(Main.parent, 340 trn("The selected way has nodes outside of the downloaded data region.", 339 boolean option = ConditionalOptionPaneUtil.showConfirmationDialog( 340 "delete_outside_nodes",Main.parent, 341 trn("The selected way has nodes outside of the downloaded data region.", 341 342 "The selected ways have nodes outside of the downloaded data region.", 342 343 ways.size()) + "\n" 343 344 + tr("This can lead to nodes being deleted accidentally.") + "\n" 344 345 + tr("Are you really sure to continue?"), 345 346 tr("Please abort if you are not sure"), JOptionPane.YES_NO_OPTION, 346 JOptionPane.WARNING_MESSAGE );347 JOptionPane.WARNING_MESSAGE,JOptionPane.YES_OPTION); 347 348 348 if ( option != JOptionPane.YES_OPTION) return;349 if (!option) return; 349 350 break; 350 351 } 351 352 } -
src/org/openstreetmap/josm/actions/SimplifyWayAction.java
27 27 import org.openstreetmap.josm.data.osm.Node; 28 28 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 29 import org.openstreetmap.josm.data.osm.Way; 30 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 30 31 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 31 32 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 32 33 import org.openstreetmap.josm.gui.help.HelpUtil; … … 61 62 } 62 63 63 64 protected boolean confirmWayWithNodesOutsideBoundingBox() { 64 ButtonSpec[] options = new ButtonSpec[] { 65 new ButtonSpec( 66 tr("Yes, delete nodes"), 67 ImageProvider.get("ok"), 68 tr("Delete nodes outside of downloaded data regions"), 69 null 70 ), 71 new ButtonSpec( 72 tr("No, abort"), 73 ImageProvider.get("cancel"), 74 tr("Cancel operation"), 75 null 76 ) 77 }; 78 int ret = HelpAwareOptionPane.showOptionDialog( 79 Main.parent, 65 return ConditionalOptionPaneUtil.showConfirmationDialog( 66 "delete_outside_nodes",Main.parent, 80 67 "<html>" 81 68 + trn("The selected way has nodes outside of the downloaded data region.", 82 69 "The selected ways have nodes outside of the downloaded data region.", … … 87 74 + tr("Do you want to delete them anyway?") 88 75 + "</html>", 89 76 tr("Delete nodes outside of data regions?"), 90 JOptionPane.WARNING_MESSAGE, 91 null, // no special icon 92 options, 93 options[0], 94 HelpUtil.ht("/Action/SimplifyWay#ConfirmDeleteNodesOutsideBoundingBoxes") 95 ); 96 return ret == 0; 77 JOptionPane.YES_NO_OPTION, 78 JOptionPane.WARNING_MESSAGE,JOptionPane.YES_OPTION); 97 79 } 98 80 99 81 protected void alertSelectAtLeastOneWay() {
