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
+5
View File
@@ -75,6 +75,8 @@ class Config:
self.fmtSingleQuotes = ["",""] self.fmtSingleQuotes = ["",""]
self.fmtApostrophe = "" self.fmtApostrophe = ""
self.spellLanguage = "en_GB"
# Check if config file exists # Check if config file exists
if path.isfile(path.join(self.confPath,self.confFile)): if path.isfile(path.join(self.confPath,self.confFile)):
self.loadConfig() self.loadConfig()
@@ -140,6 +142,8 @@ class Config:
self.doReplaceDash = confParser.getboolean(cnfSec,"repdash") self.doReplaceDash = confParser.getboolean(cnfSec,"repdash")
if confParser.has_option(cnfSec,"repdots"): if confParser.has_option(cnfSec,"repdots"):
self.doReplaceDots = confParser.getboolean(cnfSec,"repdots") self.doReplaceDots = confParser.getboolean(cnfSec,"repdots")
if confParser.has_option(cnfSec,"spellcheck"):
self.spellLanguage = confParser.get(cnfSec,"spellcheck")
## Path ## Path
cnfSec = "Path" cnfSec = "Path"
@@ -183,6 +187,7 @@ class Config:
confParser.set(cnfSec,"repdquotes", str(self.doReplaceDQuote)) confParser.set(cnfSec,"repdquotes", str(self.doReplaceDQuote))
confParser.set(cnfSec,"repdash", str(self.doReplaceDash)) confParser.set(cnfSec,"repdash", str(self.doReplaceDash))
confParser.set(cnfSec,"repdots", str(self.doReplaceDots)) confParser.set(cnfSec,"repdots", str(self.doReplaceDots))
confParser.set(cnfSec,"spellcheck", str(self.spellLanguage))
## Path ## Path
cnfSec = "Path" cnfSec = "Path"
+1 -1
View File
@@ -52,7 +52,7 @@ class GuiDocEditor(QTextEdit):
# Core Elements # Core Elements
self.theDoc = self.document() self.theDoc = self.document()
self.theDict = enchant.Dict("en_GB") self.theDict = enchant.Dict(self.mainConf.spellLanguage)
self.hLight = GuiDocHighlighter(self.theDoc, self.theDict) self.hLight = GuiDocHighlighter(self.theDoc, self.theDict)
# Editor State # Editor State
@@ -0,0 +1,3 @@
# This is a New File!
Although, not so new now that it has text in it an everything …
+9 -9
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.0.1" fileVersion="1.0" timeStamp="2019-05-04 17:22:40"> <novelWriterXML appVersion="0.0.1" fileVersion="1.0" timeStamp="2019-05-04 22:24:32">
<project> <project>
<name>Sample Project</name> <name>Sample Project</name>
<title>Sample Project</title> <title>Sample Project</title>
@@ -61,9 +61,9 @@
<status>0</status> <status>0</status>
<expanded>False</expanded> <expanded>False</expanded>
<layout>SCENE</layout> <layout>SCENE</layout>
<charCount>0</charCount> <charCount>69</charCount>
<wordCount>0</wordCount> <wordCount>17</wordCount>
<paraCount>0</paraCount> <paraCount>1</paraCount>
</item> </item>
<item handle="f6622b4617424" order="1" parent="None"> <item handle="f6622b4617424" order="1" parent="None">
<name>Characters</name> <name>Characters</name>
@@ -127,14 +127,14 @@
<expanded>True</expanded> <expanded>True</expanded>
</item> </item>
<item handle="4cd0bd12b087d" order="0" parent="f75dac270c2a7"> <item handle="4cd0bd12b087d" order="0" parent="f75dac270c2a7">
<name>New File</name> <name>Orphaned File 1</name>
<type>FILE</type> <type>FILE</type>
<class>NOVEL</class> <class>NO_CLASS</class>
<status>0</status> <status>0</status>
<expanded>False</expanded> <expanded>False</expanded>
<layout>SCENE</layout> <layout>NO_LAYOUT</layout>
<charCount>3</charCount> <charCount>0</charCount>
<wordCount>1</wordCount> <wordCount>0</wordCount>
<paraCount>0</paraCount> <paraCount>0</paraCount>
</item> </item>
</content> </content>