src/eric7/Project/SpellingPropertiesDialog.py

branch
eric7
changeset 9514
2b104ad132a4
parent 9482
a2bc06a54d9d
child 9653
e67609152c5e
--- a/src/eric7/Project/SpellingPropertiesDialog.py	Wed Nov 16 10:10:06 2022 +0100
+++ b/src/eric7/Project/SpellingPropertiesDialog.py	Wed Nov 16 10:53:40 2022 +0100
@@ -56,28 +56,35 @@
         """
         Public method to initialize the dialogs data.
         """
-        index = self.spellingComboBox.findText(self.project.pdata["SPELLLANGUAGE"])
+        index = self.spellingComboBox.findText(
+            self.project.getProjectData(dataKey="SPELLLANGUAGE")
+        )
         if index == -1:
             index = 0
         self.spellingComboBox.setCurrentIndex(index)
-        if self.project.pdata["SPELLWORDS"]:
-            self.pwlPicker.setText(self.project.pdata["SPELLWORDS"])
-        if self.project.pdata["SPELLEXCLUDES"]:
-            self.pelPicker.setText(self.project.pdata["SPELLEXCLUDES"])
+        if self.project.getProjectData(dataKey="SPELLWORDS"):
+            self.pwlPicker.setText(self.project.getProjectData(dataKey="SPELLWORDS"))
+        if self.project.getProjectData(dataKey="SPELLEXCLUDES"):
+            self.pelPicker.setText(self.project.getProjectData(dataKey="SPELLEXCLUDES"))
 
     def storeData(self):
         """
         Public method to store the entered/modified data.
         """
         if self.spellingComboBox.currentIndex() == 0:
-            self.project.pdata["SPELLLANGUAGE"] = Preferences.getEditor(
-                "SpellCheckingDefaultLanguage"
+            self.project.setProjectData(
+                Preferences.getEditor("SpellCheckingDefaultLanguage"),
+                dataKey="SPELLLANGUAGE",
             )
         else:
-            self.project.pdata["SPELLLANGUAGE"] = self.spellingComboBox.currentText()
-        self.project.pdata["SPELLWORDS"] = self.project.getRelativePath(
-            self.pwlPicker.text()
+            self.project.setProjectData(
+                self.spellingComboBox.currentText(), dataKey="SPELLLANGUAGE"
+            )
+        self.project.setProjectData(
+            self.project.getRelativePath(self.pwlPicker.text()),
+            dataKey="SPELLWORDS",
         )
-        self.project.pdata["SPELLEXCLUDES"] = self.project.getRelativePath(
-            self.pelPicker.text()
+        self.project.setProjectData(
+            self.project.getRelativePath(self.pelPicker.text()),
+            dataKey="SPELLEXCLUDES",
         )

eric ide

mercurial