Merge branch 'main' into release
This commit is contained in:
@@ -434,6 +434,9 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
logger.error("No project open")
|
logger.error("No project open")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if not self.hasFocus():
|
||||||
|
return False
|
||||||
|
|
||||||
if tHandle is None:
|
if tHandle is None:
|
||||||
tHandle = self.getSelectedHandle()
|
tHandle = self.getSelectedHandle()
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ from PyQt5.QtCore import Qt
|
|||||||
from PyQt5.QtGui import QTextCursor
|
from PyQt5.QtGui import QTextCursor
|
||||||
from PyQt5.QtWidgets import QAction, QMessageBox
|
from PyQt5.QtWidgets import QAction, QMessageBox
|
||||||
|
|
||||||
|
from nw.gui.projtree import GuiProjectTree
|
||||||
from nw.constants import nwItemType, nwDocAction
|
from nw.constants import nwItemType, nwDocAction
|
||||||
|
|
||||||
keyDelay = 2
|
keyDelay = 2
|
||||||
@@ -42,6 +43,7 @@ def testGuiEditor_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj, refDir, outDi
|
|||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
||||||
|
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True)
|
||||||
|
|
||||||
# Create new, save, close project
|
# Create new, save, close project
|
||||||
nwGUI.theProject.projTree.setSeed(42)
|
nwGUI.theProject.projTree.setSeed(42)
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ from tools import writeFile
|
|||||||
from PyQt5.QtCore import QItemSelectionModel
|
from PyQt5.QtCore import QItemSelectionModel
|
||||||
from PyQt5.QtWidgets import QAction, QMessageBox
|
from PyQt5.QtWidgets import QAction, QMessageBox
|
||||||
|
|
||||||
|
from nw.guimain import GuiMain
|
||||||
|
from nw.gui.projtree import GuiProjectTree
|
||||||
from nw.constants import nwItemType, nwItemClass
|
from nw.constants import nwItemType, nwItemClass
|
||||||
|
|
||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
@@ -36,7 +38,8 @@ def testGuiProjTree_TreeItems(qtbot, caplog, monkeypatch, nwGUI, nwMinimal):
|
|||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
||||||
monkeypatch.setattr("nw.guimain.GuiMain.editItem", lambda *args: None)
|
monkeypatch.setattr(GuiMain, "editItem", lambda *args: None)
|
||||||
|
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True)
|
||||||
|
|
||||||
nwGUI.theProject.projTree.setSeed(42)
|
nwGUI.theProject.projTree.setSeed(42)
|
||||||
nwTree = nwGUI.treeView
|
nwTree = nwGUI.treeView
|
||||||
|
|||||||
Reference in New Issue
Block a user