edit.js shares a global undo stack through the UndoStack API. Because the stack is globally shared, disabling the feature while create is disabled doesn't make a lot of sense because it might disabling the ability to undo/redo with another feature. Because UndoStack is only used by edit.js, UndoStack is being removed in favor of a local undo stack implemented within edit.js.
Showing the changes to interface/src/Menu.cpp (1 of 6 files). Show all
Unified · Split
| @@ -90,19 +90,6 @@ Menu::Menu() { · 89 unmodified lines | ||
| 90 | 90 | // Edit menu ---------------------------------- |
| 91 | 91 | MenuWrapper* editMenu = addMenu("Edit"); |
| 92 | 92 | |
| 93 | − // Edit > Undo | |
| 94 | − QUndoStack* undoStack = qApp->getUndoStack(); | |
| 95 | − QAction* undoAction = undoStack->createUndoAction(editMenu); | |
| 96 | − undoAction->setShortcut(Qt::CTRL | Qt::Key_Z); | |
| 97 | − addActionToQMenuAndActionHash(editMenu, undoAction); | |
| 98 | − | |
| 99 | − // Edit > Redo | |
| 100 | − QAction* redoAction = undoStack->createRedoAction(editMenu); | |
| 101 | − redoAction->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Z); | |
| 102 | − addActionToQMenuAndActionHash(editMenu, redoAction); | |
| 103 | − | |
| 104 | − editMenu->addSeparator(); | |
| 105 | − | |
| 106 | 93 | // Edit > Cut |
| 107 | 94 | auto cutAction = addActionToQMenuAndActionHash(editMenu, "Cut", QKeySequence::Cut); |
| 108 | 95 | connect(cutAction, &QAction::triggered, [] { |