Let the document editor handle the status of spell checking, and let it set all other classes from there

This commit is contained in:
Veronica K. B. Olsen
2019-11-15 22:16:58 +01:00
parent e841e0211a
commit ec0f4880fa
2 changed files with 29 additions and 6 deletions
+5 -6
View File
@@ -91,6 +91,10 @@ class GuiMainMenu(QMenuBar):
return
def setSpellCheck(self, theMode):
self.aSpellCheck.setChecked(theMode)
return
def updateSpellCheck(self):
if self.theParent.hasProject:
self.aSpellCheck.setChecked(self.theProject.spellCheck)
@@ -106,12 +110,7 @@ class GuiMainMenu(QMenuBar):
return
def _toggleSpellCheck(self):
if self.theParent.hasProject:
self.theProject.setSpellCheck(self.aSpellCheck.isChecked())
self.theParent.docEditor.setSpellCheck(self.aSpellCheck.isChecked())
logger.verbose("Spell check is set to %s" % str(self.theProject.spellCheck))
else:
self.aSpellCheck.setChecked(False)
self.theParent.docEditor.setSpellCheck(None)
return True
def _toggleViewComments(self):