Block document action if editor does not have focus

This commit is contained in:
Veronica K. B. Olsen
2021-01-31 12:50:42 +01:00
parent f4f2feae3c
commit 013fb58267
3 changed files with 9 additions and 0 deletions
+4
View File
@@ -646,6 +646,10 @@ class GuiDocEditor(QTextEdit):
this class when calling these actions from other classes.
"""
logger.verbose("Requesting action: %s" % theAction.name)
if not self.hasFocus():
logger.verbose("Editor does not have focus")
return False
if self.theHandle is None:
logger.error("No document open")
return False