Preferences/ConfigurationPages/WebBrowserSpellCheckingPage.py

changeset 5870
82e04c70f969
parent 5868
c1a98c164cd3
child 6048
82ad8ec9548c
--- a/Preferences/ConfigurationPages/WebBrowserSpellCheckingPage.py	Sun Sep 03 12:22:51 2017 +0200
+++ b/Preferences/ConfigurationPages/WebBrowserSpellCheckingPage.py	Sun Sep 03 17:08:26 2017 +0200
@@ -61,12 +61,21 @@
             }
         self.spellCheckDictionaryDirectoriesEdit.setPlainText(
             "\n".join(self.__dictionaryDirectories))
+        # try to create these directories, if they don't exist
+        for directory in self.__dictionaryDirectories:
+            if not os.path.exists(directory):
+                try:
+                    os.makedirs(directory)
+                except os.error:
+                    # ignore it
+                    pass
         
         self.__writeableDirectories = []
         for directory in self.__dictionaryDirectories:
             if os.access(directory, os.W_OK):
                 self.__writeableDirectories.append(directory)
-        self.installButton.setEnabled(bool(self.__writeableDirectories))
+        self.manageDictionariesButton.setEnabled(
+            bool(self.__writeableDirectories))
         
         self.__populateDictionariesList()
     
@@ -109,8 +118,10 @@
             self.noLanguagesLabel.hide()
             self.spellCheckLanguagesList.show()
         else:
+            # no dictionaries available, disable spell checking
             self.noLanguagesLabel.show()
             self.spellCheckLanguagesList.hide()
+            self.spellCheckEnabledCheckBox.setChecked(False)
     
     def save(self):
         """
@@ -158,15 +169,14 @@
         return languageString
     
     @pyqtSlot()
-    def on_installButton_clicked(self):
+    def on_manageDictionariesButton_clicked(self):
         """
-        Private slot to install spell checking dictionaries.
+        Private slot to manage spell checking dictionaries.
         """
-        from WebBrowser.SpellCheck.InstallDictionariesDialog import \
-            InstallDictionariesDialog
-        dlg = InstallDictionariesDialog(self.__writeableDirectories, self)
+        from WebBrowser.SpellCheck.ManageDictionariesDialog import \
+            ManageDictionariesDialog
+        dlg = ManageDictionariesDialog(self.__writeableDirectories, self)
         dlg.exec_()
-        # TODO: Implement this dialog
         
         self.__populateDictionariesList()
 

eric ide

mercurial