From ba4bc54c9f23ba8101caaf9ce6739665ca780813 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 5 Sep 2020 17:30:50 +0200 Subject: [PATCH] Added the handling of project dictionary in the editor as well --- nw/gui/doceditor.py | 13 ++++++++++++- nw/guimain.py | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 470f04ca..dc2b632f 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -448,8 +448,17 @@ class GuiDocEditor(QTextEdit): status bar to show the one actually loaded by the spell checker class. """ - self.theDict.setLanguage(self.mainConf.spellLanguage, self.theProject.projDict) + if self.theProject.projLang is None: + theLang = self.mainConf.spellLanguage + else: + theLang = self.theProject.projLang + + self.theDict.setLanguage(theLang, self.theProject.projDict) self.theParent.statusBar.setLanguage(self.theDict.spellLanguage) + + if not self.bigDoc: + self.spellCheckDocument() + return True def setSpellCheck(self, theMode): @@ -495,6 +504,8 @@ class GuiDocEditor(QTextEdit): "Document re-highlighted in %.3f milliseconds" % (1000*(afTime-bfTime)) ) + self.theParent.statusBar.showMessage("Spell check complete") + return True ## diff --git a/nw/guimain.py b/nw/guimain.py index 66bcc7cb..86401a5b 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -803,6 +803,7 @@ class GuiMain(QMainWindow): if self.hasProject: dlgProj = GuiProjectSettings(self, self.theProject) dlgProj.exec_() + self.docEditor.setDictionaries() self._setWindowTitle(self.theProject.projName) return True