Restore some of the old spell check information in the status bar

This commit is contained in:
Veronica K. B. Olsen
2021-02-15 22:29:05 +01:00
parent ed356ba85d
commit 2e4148a9eb
6 changed files with 54 additions and 9 deletions
+3 -1
View File
@@ -603,7 +603,9 @@ class GuiDocEditor(QTextEdit):
theLang = self.theProject.projLang
self.theDict.setLanguage(theLang, self.theProject.projDict)
self.theParent.statusBar.setLanguage(theLang)
theTag, theProvider = self.theDict.describeDict()
self.theParent.statusBar.setLanguage(theLang, theProvider)
if not self.bigDoc:
self.spellCheckDocument()
+7 -3
View File
@@ -147,16 +147,20 @@ class GuiMainStatus(QStatusBar):
qApp.processEvents()
return
def setLanguage(self, theLang):
def setLanguage(self, theLang, theProvider=""):
"""Set the language code for the spell checker.
"""
if theLang is None:
self.langText.setText(self.tr("None"))
self.langText.setToolTip("")
else:
qLocal = QLocale(theLang)
spLang = qLocal.nativeLanguageName().title()
spName = qLocal.bcp47Name()
self.langText.setText("%s (%s)" % (spLang, spName))
self.langText.setText(spLang)
if theProvider:
self.langText.setToolTip("%s (%s)" % (theLang, theProvider))
else:
self.langText.setToolTip(theLang)
return