eric6/Preferences/ConfigurationPages/EditorAPIsPage.py

changeset 8151
8c1445825e7b
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/Preferences/ConfigurationPages/EditorAPIsPage.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/EditorAPIsPage.py	Thu Mar 04 17:48:09 2021 +0100
@@ -57,7 +57,7 @@
                 QScintilla.Lexers.getLanguageIcon(lang, False),
                 lang)
         self.__currentApiLanguage = ""
-        self.on_apiLanguageComboBox_activated(self.__currentApiLanguage)
+        self.on_apiLanguageComboBox_activated(0)
     
     def __apiKey(self, language, projectType):
         """
@@ -107,14 +107,16 @@
         self.__currentApiProjectTypeIndex = index
         self.__fillApisList()
         
-    @pyqtSlot(str)
-    def on_apiLanguageComboBox_activated(self, language):
+    @pyqtSlot(int)
+    def on_apiLanguageComboBox_activated(self, index):
         """
         Private slot to fill the api listbox of the api page.
         
-        @param language selected API language
-        @type str
+        @param index index of the selected entry
+        @type int
         """
+        language = self.apiLanguageComboBox.itemText(index)
+        
         if self.__currentApiLanguage == language:
             return
         
@@ -347,7 +349,7 @@
         """
         self.apiLanguageComboBox.setCurrentIndex(state[0])
         self.on_apiLanguageComboBox_activated(
-            self.apiLanguageComboBox.currentText())
+            self.apiLanguageComboBox.currentIndex())
         
         self.projectTypeComboBox.setCurrentIndex(state[1])
         self.on_projectTypeComboBox_activated(state[1])

eric ide

mercurial