Allow Ctrl+Del to be propagated to the document editor
This commit is contained in:
+11
-1
@@ -172,6 +172,16 @@ class GuiMainMenu(QMenuBar):
|
||||
QDesktopServices.openUrl(QUrl(theUrl))
|
||||
return True
|
||||
|
||||
def _handleCtrlDel(self):
|
||||
"""Direct the Ctrl+Del key press to the correct widget.
|
||||
"""
|
||||
if self.theParent.treeView.hasFocus():
|
||||
self.theParent.treeView.deleteItem(None)
|
||||
elif self.theParent.docEditor.hasFocus():
|
||||
self.theParent.docEditor.docAction(nwDocAction.DEL_WORD)
|
||||
|
||||
return
|
||||
|
||||
##
|
||||
# Menu Builders
|
||||
##
|
||||
@@ -270,7 +280,7 @@ class GuiMainMenu(QMenuBar):
|
||||
self.aDeleteItem = QAction("Delete Item", self)
|
||||
self.aDeleteItem.setStatusTip("Delete selected project item")
|
||||
self.aDeleteItem.setShortcut("Ctrl+Del")
|
||||
self.aDeleteItem.triggered.connect(lambda: self.theParent.treeView.deleteItem(None))
|
||||
self.aDeleteItem.triggered.connect(self._handleCtrlDel)
|
||||
self.projMenu.addAction(self.aDeleteItem)
|
||||
|
||||
# Project > Move Up
|
||||
|
||||
Reference in New Issue
Block a user