- Timestamp:
- 11/13/19 15:15:33 (4 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java
r1448 r1450 1982 1982 // the current frame as well as the overlay frame 1983 1983 Frame currentFrame = DisplayController.getCurrentFrame(); 1984 currentFrame.addToUndoDelete(new ItemsList(itemList) );1984 currentFrame.addToUndoDelete(new ItemsList(itemList), false); 1985 1985 itemList.clear(); 1986 1986 if (bReparse) { … … 3305 3305 SessionStats.DeletedItems(toUndo); 3306 3306 if (parent != null) { 3307 parent.addToUndoDelete(new ItemsList(toUndo) );3307 parent.addToUndoDelete(new ItemsList(toUndo), !canditateFilesToDelete.isEmpty()); 3308 3308 parent.removeAllItems(toUndo); // toDelete.getConnected() 3309 3309 deleteUnusedFiles(canditateFilesToDelete); -
trunk/src/org/expeditee/gui/Frame.java
r1449 r1450 1064 1064 /** 1065 1065 * Adds the given History event to the stack. 1066 *1067 * @param stack The stack to add to1068 1066 * @param items The items to put in the event 1069 1067 * @param type The type of event that occurred 1070 */ 1071 private void addToUndo(ItemsList items, History.Type type) { 1068 * @param undoDeleteAssociatedFiles TODO 1069 * @param stack The stack to add to 1070 */ 1071 private void addToUndo(ItemsList items, History.Type type, boolean undoDeleteAssociatedFiles) { 1072 1072 if (items.size() < 1) { 1073 1073 return; 1074 1074 } 1075 1075 1076 _undo.push(new History(items, type ));1077 } 1078 1079 public void addToUndoDelete(ItemsList items ) {1080 addToUndo(items, History.Type.deletion );1076 _undo.push(new History(items, type, undoDeleteAssociatedFiles)); 1077 } 1078 1079 public void addToUndoDelete(ItemsList items, boolean undoDeleteAssociatedFiles) { 1080 addToUndo(items, History.Type.deletion, undoDeleteAssociatedFiles); 1081 1081 } 1082 1082 1083 1083 public void addToUndoMove(ItemsList items) { 1084 addToUndo(items, History.Type.movement );1084 addToUndo(items, History.Type.movement, false); 1085 1085 } 1086 1086 … … 1101 1101 _redo.push(undo); 1102 1102 for(Item i : undo.items) { 1103 if (i instanceof org.expeditee.items.Picture ) {1103 if (i instanceof org.expeditee.items.Picture && undo.undoDeleteAssociatedFiles) { 1104 1104 String destination = ((Picture) i).getPath(); 1105 1105 Path destinationPath = Paths.get(destination); … … 1128 1128 ItemsList changed = new ItemsList(body); 1129 1129 changed.retainAll(undo.items); 1130 _redo.push(new History(changed, History.Type.movement ));1130 _redo.push(new History(changed, History.Type.movement, false)); 1131 1131 for(Item i : undo.items) { 1132 1132 int index; … … 1190 1190 ItemsList changed = new ItemsList(body); 1191 1191 changed.retainAll(redo.items); 1192 _undo.push(new History(changed, History.Type.movement ));1192 _undo.push(new History(changed, History.Type.movement, false)); 1193 1193 for(Item i : redo.items) { 1194 1194 int index; … … 1834 1834 1835 1835 _body.removeAll(newBody); 1836 addToUndoDelete(_body );1836 addToUndoDelete(_body, false); 1837 1837 _body = newBody; 1838 1838 change(); … … 1865 1865 } 1866 1866 1867 addToUndoDelete(deleted );1867 addToUndoDelete(deleted, false); 1868 1868 change(); 1869 1869 … … 3019 3019 3020 3020 public final Type type; 3021 3022 public History(ItemsList changed, Type type) 3021 3022 public final boolean undoDeleteAssociatedFiles; 3023 3024 public History(ItemsList changed, Type type, boolean undoDeleteAssociatedFiles) 3023 3025 { 3026 this.undoDeleteAssociatedFiles = undoDeleteAssociatedFiles; 3024 3027 this.items = new ItemsList(changed); 3025 3028 this.type = type;
Note:
See TracChangeset
for help on using the changeset viewer.