Added spelling language to config, and updated sample project

This commit is contained in:
Veronica K. B. Olsen
2019-05-04 22:25:34 +02:00
parent a728a7c42e
commit 9ea70aeeaf
4 changed files with 19 additions and 11 deletions
+6 -1
View File
@@ -70,11 +70,13 @@ class Config:
self.doReplaceDash = True
self.doReplaceDots = True
self.wordCountTimer = 5.0
self.fmtDoubleQuotes = ["",""]
self.fmtSingleQuotes = ["",""]
self.fmtApostrophe = ""
self.spellLanguage = "en_GB"
# Check if config file exists
if path.isfile(path.join(self.confPath,self.confFile)):
self.loadConfig()
@@ -140,6 +142,8 @@ class Config:
self.doReplaceDash = confParser.getboolean(cnfSec,"repdash")
if confParser.has_option(cnfSec,"repdots"):
self.doReplaceDots = confParser.getboolean(cnfSec,"repdots")
if confParser.has_option(cnfSec,"spellcheck"):
self.spellLanguage = confParser.get(cnfSec,"spellcheck")
## Path
cnfSec = "Path"
@@ -183,6 +187,7 @@ class Config:
confParser.set(cnfSec,"repdquotes", str(self.doReplaceDQuote))
confParser.set(cnfSec,"repdash", str(self.doReplaceDash))
confParser.set(cnfSec,"repdots", str(self.doReplaceDots))
confParser.set(cnfSec,"spellcheck", str(self.spellLanguage))
## Path
cnfSec = "Path"
+1 -1
View File
@@ -52,7 +52,7 @@ class GuiDocEditor(QTextEdit):
# Core Elements
self.theDoc = self.document()
self.theDict = enchant.Dict("en_GB")
self.theDict = enchant.Dict(self.mainConf.spellLanguage)
self.hLight = GuiDocHighlighter(self.theDoc, self.theDict)
# Editor State