From e216f80d64b758a6ed728069ff144fdc8455eb5f Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:27:40 +0100 Subject: [PATCH] Revert previous change of keyboard shortcut for item delete in tree made in #1590 --- docs/source/usage_shortcuts.rst | 30 +++++++++++++++--------------- novelwriter/gui/mainmenu.py | 2 +- novelwriter/guimain.py | 5 +---- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/docs/source/usage_shortcuts.rst b/docs/source/usage_shortcuts.rst index db9382cb..0eea9175 100644 --- a/docs/source/usage_shortcuts.rst +++ b/docs/source/usage_shortcuts.rst @@ -46,21 +46,21 @@ Project Tree Shortcuts .. csv-table:: :header: "Shortcut", "Description" - ":kbd:`F2`", "Edit the label of the selected item" - ":kbd:`Return`", "Open the selected document in the editor" - ":kbd:`Alt+Up`", "Jump or go to the previous item at same level in the tree" - ":kbd:`Alt+Down`", "Jump or go to the next item at same level in the tree" - ":kbd:`Alt+Left`", "Jump to the parent item in the tree" - ":kbd:`Alt+Right`", "Jump to the first child item in the project tree" - ":kbd:`Ctrl+.`", "Open the context menu on the selected item" - ":kbd:`Ctrl+L`", "Open the :guilabel:`Quick Links` menu" - ":kbd:`Ctrl+N`", "Open the :guilabel:`Create New Item` menu" - ":kbd:`Ctrl+O`", "Open selected document" - ":kbd:`Ctrl+R`", "Open the selected document in the viewer" - ":kbd:`Ctrl+Up`", "Move selected item one step up in the tree" - ":kbd:`Ctrl+Down`", "Move selected item one step down in the tree" - ":kbd:`Ctrl+Del`", "Move the selected item to Trash" - ":kbd:`Ctrl+Shift+Z`", "Undo the last move of a project item, if possible" + ":kbd:`F2`", "Edit the label of the selected item" + ":kbd:`Return`", "Open the selected document in the editor" + ":kbd:`Alt+Up`", "Jump or go to the previous item at same level in the tree" + ":kbd:`Alt+Down`", "Jump or go to the next item at same level in the tree" + ":kbd:`Alt+Left`", "Jump to the parent item in the tree" + ":kbd:`Alt+Right`", "Jump to the first child item in the project tree" + ":kbd:`Ctrl+.`", "Open the context menu on the selected item" + ":kbd:`Ctrl+L`", "Open the :guilabel:`Quick Links` menu" + ":kbd:`Ctrl+N`", "Open the :guilabel:`Create New Item` menu" + ":kbd:`Ctrl+O`", "Open selected document" + ":kbd:`Ctrl+R`", "Open the selected document in the viewer" + ":kbd:`Ctrl+Up`", "Move selected item one step up in the tree" + ":kbd:`Ctrl+Down`", "Move selected item one step down in the tree" + ":kbd:`Ctrl+Shift+Del`", "Move the selected item to Trash" + ":kbd:`Ctrl+Shift+Z`", "Undo the last move of a project item, if possible" .. _a_kb_editor: diff --git a/novelwriter/gui/mainmenu.py b/novelwriter/gui/mainmenu.py index 9238d3f1..1fee411f 100644 --- a/novelwriter/gui/mainmenu.py +++ b/novelwriter/gui/mainmenu.py @@ -171,7 +171,7 @@ class GuiMainMenu(QMenuBar): # Project > Delete self.aDeleteItem = self.projMenu.addAction(self.tr("Delete Item")) - self.aDeleteItem.setShortcuts(["Ctrl+Del", "Ctrl+Shift+Del"]) # Latter is deprecated + self.aDeleteItem.setShortcut("Ctrl+Shift+Del") # Cannot be Ctrl+Del, see #629 self.aDeleteItem.triggered.connect(lambda: self.mainGui.projView.requestDeleteItem(None)) # Project > Empty Trash diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index b7eb97ca..2006213e 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -1164,10 +1164,7 @@ class GuiMain(QMainWindow): """Capture the closing event of the GUI and call the close function to handle all the close process steps. """ - if self.closeMain(): - event.accept() - else: - event.ignore() + event.accept() if self.closeMain() else event.ignore() return ##