- Timestamp:
- 2021-10-13T11:17:10+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r17896 r18274 512 512 UndoRedoHandler.getInstance().add( 513 513 new MoveCommand(candidateNode, cursorEN.east() - nodeEN.east(), cursorEN.north() - nodeEN.north())); 514 515 SelectAction.checkCommandForLargeDistance(UndoRedoHandler.getInstance().getLastCommand()); 514 516 } 515 517 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r17896 r18274 838 838 showConfirmMoveDialog(ed); 839 839 } 840 840 841 final Command lastCommand = UndoRedoHandler.getInstance().getLastCommand(); 841 842 if (lastCommand == null) { … … 843 844 return; 844 845 } 846 847 SelectAction.checkCommandForLargeDistance(lastCommand); 848 849 final int moveCount = lastCommand.getParticipatingPrimitives().size(); 850 final int max = Config.getPref().getInt("warn.move.maxelements", 20); 851 if (moveCount > max) { 852 final ConfirmMoveDialog ed = new ConfirmMoveDialog(); 853 ed.setContent( 854 /* for correct i18n of plural forms - see #9110 */ 855 trn("You moved more than {0} element. " + "Moving a large number of elements is often an error.\n" + "Really move them?", 856 "You moved more than {0} elements. " + "Moving a large number of elements is often an error.\n" + "Really move them?", 857 max, max)); 858 ed.toggleEnable("movedManyElements"); 859 showConfirmMoveDialog(ed); 860 } else { 861 // if small number of elements were moved, 862 updateKeyModifiers(e); 863 if (ctrl) mergePrims(e.getPoint()); 864 } 865 } 866 867 static void checkCommandForLargeDistance(Command lastCommand) { 845 868 final int moveCount = lastCommand.getParticipatingPrimitives().size(); 846 869 if (lastCommand instanceof MoveCommand) { … … 858 881 } 859 882 } 860 int max = Config.getPref().getInt("warn.move.maxelements", 20); 861 if (moveCount > max) { 862 final ConfirmMoveDialog ed = new ConfirmMoveDialog(); 863 ed.setContent( 864 /* for correct i18n of plural forms - see #9110 */ 865 trn("You moved more than {0} element. " + "Moving a large number of elements is often an error.\n" + "Really move them?", 866 "You moved more than {0} elements. " + "Moving a large number of elements is often an error.\n" + "Really move them?", 867 max, max)); 868 ed.toggleEnable("movedManyElements"); 869 showConfirmMoveDialog(ed); 870 } else { 871 // if small number of elements were moved, 872 updateKeyModifiers(e); 873 if (ctrl) mergePrims(e.getPoint()); 874 } 875 } 876 877 private void showConfirmMoveDialog(ConfirmMoveDialog ed) { 883 } 884 885 private static void showConfirmMoveDialog(ConfirmMoveDialog ed) { 878 886 if (ed.showDialog().getValue() != 1) { 879 887 UndoRedoHandler.getInstance().undo();
Note:
See TracChangeset
for help on using the changeset viewer.