Fixed "issue 425" by initializing the spell checker parameters sooner in UserInterface.py (i.e. before objects potentially needing a spell checker are created). eric7

Tue, 26 Apr 2022 10:17:59 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 26 Apr 2022 10:17:59 +0200
branch
eric7
changeset 9033
866633f4fbf3
parent 9032
e858ff495c1c
child 9034
feb766f6a1c5

Fixed "issue 425" by initializing the spell checker parameters sooner in UserInterface.py (i.e. before objects potentially needing a spell checker are created).

eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
--- a/eric7/UI/UserInterface.py	Mon Apr 25 14:42:19 2022 +0200
+++ b/eric7/UI/UserInterface.py	Tue Apr 26 10:17:59 2022 +0200
@@ -304,6 +304,19 @@
         self.__webBrowserClient = None
         self.__webBrowserSAName = QUuid.createUuid().toString()[1:-1]
         
+        # set spellchecker defaults
+        from QScintilla.SpellChecker import SpellChecker
+        SpellChecker.setDefaultLanguage(
+            Preferences.getEditor("SpellCheckingDefaultLanguage"))
+        
+        with contextlib.suppress(ImportError, AttributeError):
+            from EricWidgets.EricSpellCheckedTextEdit import SpellCheckMixin
+            pwl = SpellChecker.getUserDictionaryPath(isException=False)
+            pel = SpellChecker.getUserDictionaryPath(isException=True)
+            SpellCheckMixin.setDefaultLanguage(
+                Preferences.getEditor("SpellCheckingDefaultLanguage"),
+                pwl, pel)
+        
         logging.debug("Creating Application Objects...")
         self.__createObjects()
         
@@ -741,19 +754,6 @@
             self.__networkManager.sslErrors.connect(self.__sslErrors)
         self.__replies = []
         
-        # set spellchecker defaults
-        from QScintilla.SpellChecker import SpellChecker
-        SpellChecker.setDefaultLanguage(
-            Preferences.getEditor("SpellCheckingDefaultLanguage"))
-        
-        with contextlib.suppress(ImportError, AttributeError):
-            from EricWidgets.EricSpellCheckedTextEdit import SpellCheckMixin
-            pwl = SpellChecker.getUserDictionaryPath(isException=False)
-            pel = SpellChecker.getUserDictionaryPath(isException=True)
-            SpellCheckMixin.setDefaultLanguage(
-                Preferences.getEditor("SpellCheckingDefaultLanguage"),
-                pwl, pel)
-        
         # attributes for the last shown configuration page and the
         # extended configuration entries
         self.__lastConfigurationPageName = ""

eric ide

mercurial