F2 should only edit item if project tree has focus, and edit current document meta if editor has focus
This commit is contained in:
+5
-1
@@ -800,7 +800,11 @@ class GuiMain(QMainWindow):
|
||||
return False
|
||||
|
||||
if tHandle is None:
|
||||
tHandle = self.treeView.getSelectedHandle()
|
||||
if self.treeView.hasFocus():
|
||||
tHandle = self.treeView.getSelectedHandle()
|
||||
elif self.docEditor.hasFocus():
|
||||
tHandle = self.docEditor.theHandle
|
||||
|
||||
if tHandle is None:
|
||||
logger.warning("No item selected")
|
||||
return
|
||||
|
||||
@@ -28,7 +28,7 @@ from tools import cmpFiles, getGuiItem
|
||||
|
||||
from PyQt5.QtWidgets import QAction, QMessageBox
|
||||
|
||||
from nw.gui import GuiItemEditor
|
||||
from nw.gui import GuiItemEditor, GuiProjectTree
|
||||
from nw.constants import nwItemLayout
|
||||
|
||||
keyDelay = 2
|
||||
@@ -45,6 +45,7 @@ def testGuiItemEditor_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, refDir,
|
||||
|
||||
# Block message box
|
||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
||||
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True)
|
||||
|
||||
# Create new, save, open project
|
||||
nwGUI.theProject.projTree.setSeed(42)
|
||||
|
||||
Reference in New Issue
Block a user