Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.

Thu, 04 Mar 2021 17:48:09 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 04 Mar 2021 17:48:09 +0100
changeset 8151
8c1445825e7b
parent 8150
fc1ae39af8c9
child 8152
0c740fcffd34

Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.

eric6/Plugins/VcsPlugins/vcsGit/GitCommitDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsGit/GitStatusDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarkDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgCommitDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgPhaseDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditCommitEditor.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsSubversion/SvnCommitDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsSubversion/SvnOptionsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/EditorAPIsPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/EditorExportersPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/EditorKeywordsPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/EditorTypingPage.py file | annotate | diff | comparison | revisions
eric6/Project/AddDirectoryDialog.py file | annotate | diff | comparison | revisions
eric6/SqlBrowser/SqlConnectionDialog.py file | annotate | diff | comparison | revisions
eric6/Tools/TRPreviewer.py file | annotate | diff | comparison | revisions
eric6/Tools/UIPreviewer.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsGit/GitCommitDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsGit/GitCommitDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsGit/GitCommitDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -128,12 +128,14 @@
         self.close()
         self.rejected.emit()
     
-    @pyqtSlot(str)
-    def on_recentComboBox_activated(self, txt):
+    @pyqtSlot(int)
+    def on_recentComboBox_activated(self, index):
         """
         Private slot to select a commit message from recent ones.
         
-        @param txt text of the selected entry (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.recentComboBox.itemText(index)
         if txt:
             self.logEdit.setPlainText(self.recentComboBox.currentData())
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -1650,12 +1650,13 @@
         if self.__actionMode() == "filter":
             self.__filterLogs()
     
-    @pyqtSlot(str)
-    def on_fieldCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_fieldCombo_activated(self, index):
         """
         Private slot called, when a new filter field is selected.
         
-        @param txt text of the selected field (string)
+        @param index index of the selected entry
+        @type int
         """
         if self.__actionMode() == "filter":
             self.__filterLogs()
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsGit/GitStatusDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsGit/GitStatusDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsGit/GitStatusDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -589,13 +589,15 @@
         
         self.start(self.args)
     
-    @pyqtSlot(str)
-    def on_statusFilterCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_statusFilterCombo_activated(self, index):
         """
         Private slot to react to the selection of a status filter.
         
-        @param txt selected status filter (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.statusFilterCombo.itemText(index)
         if txt == "<{0}>".format(self.tr("all")):
             for topIndex in range(self.statusList.topLevelItemCount()):
                 topItem = self.statusList.topLevelItem(topIndex)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -202,12 +202,13 @@
         )
         self.vcs.getExtensionObject("gpg").hgGpgVerifySignatures(rev)
     
-    @pyqtSlot(str)
-    def on_categoryCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_categoryCombo_activated(self, index):
         """
         Private slot called, when a new filter category is selected.
         
-        @param txt text of the selected category (string)
+        @param index index of the selected entry
+        @type int
         """
         self.__filterSignatures()
     
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarkDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarkDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarkDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -93,12 +93,13 @@
                 if index > -1:
                     self.bookmarkCombo.setCurrentIndex(index)
     
-    @pyqtSlot(str)
-    def on_nameCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_nameCombo_activated(self, index):
         """
         Private slot to handle changes of the selected bookmark name.
         
-        @param txt selected combo entry (string)
+        @param index index of the selected entry
+        @type int
         """
         self.__updateOK()
         self.__updateBookmarksCombo()
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/HgCommitDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgCommitDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgCommitDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -96,13 +96,15 @@
         self.close()
         self.rejected.emit()
     
-    @pyqtSlot(str)
-    def on_recentComboBox_activated(self, txt):
+    @pyqtSlot(int)
+    def on_recentComboBox_activated(self, index):
         """
         Private slot to select a commit message from recent ones.
         
-        @param txt text of the selected entry (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.recentComboBox.itemText(index)
         if txt:
             self.logEdit.setPlainText(self.recentComboBox.currentData())
     
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -1794,22 +1794,24 @@
         if self.__actionMode() == "filter":
             self.__filterLogs()
     
-    @pyqtSlot(str)
-    def on_branchCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_branchCombo_activated(self, index):
         """
         Private slot called, when a new branch is selected.
         
-        @param txt text of the selected branch (string)
+        @param index index of the selected entry
+        @type int
         """
         if self.__actionMode() == "filter":
             self.__filterLogs()
     
-    @pyqtSlot(str)
-    def on_fieldCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_fieldCombo_activated(self, index):
         """
         Private slot called, when a new filter field is selected.
         
-        @param txt text of the selected field (string)
+        @param index index of the selected entry
+        @type int
         """
         if self.__actionMode() == "filter":
             self.__filterLogs()
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/HgPhaseDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgPhaseDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgPhaseDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -50,12 +50,13 @@
         """
         self.__updateOk()
     
-    @pyqtSlot(str)
-    def on_phaseCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_phaseCombo_activated(self, index):
         """
         Private slot to react upon changes of the phase.
         
-        @param txt activated entry (string)
+        @param index index of the selected entry
+        @type int
         """
         self.__updateOk()
     
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -418,13 +418,15 @@
         
         self.start(self.args)
     
-    @pyqtSlot(str)
-    def on_statusFilterCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_statusFilterCombo_activated(self, index):
         """
         Private slot to react to the selection of a status filter.
         
-        @param txt selected status filter (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.statusFilterCombo.itemText(index)
         if txt == "<{0}>".format(self.tr("all")):
             for topIndex in range(self.statusList.topLevelItemCount()):
                 topItem = self.statusList.topLevelItem(topIndex)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditCommitEditor.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditCommitEditor.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditCommitEditor.py	Thu Mar 04 17:48:09 2021 +0100
@@ -111,12 +111,14 @@
         self.close()
         QCoreApplication.exit(1)
     
-    @pyqtSlot(str)
-    def on_recentComboBox_activated(self, txt):
+    @pyqtSlot(int)
+    def on_recentComboBox_activated(self, index):
         """
         Private slot to select a commit message from recent ones.
         
-        @param txt text of the selected entry (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.recentComboBox.itemText(index)
         if txt:
             self.messageEdit.setPlainText(txt)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -82,16 +82,18 @@
         """
         Public slot to start the list command.
         """
-        self.on_patchSelector_activated("")
+        self.on_patchSelector_activated(0)
     
-    @pyqtSlot(str)
-    def on_patchSelector_activated(self, patch):
+    @pyqtSlot(int)
+    def on_patchSelector_activated(self, index):
         """
         Private slot to get the list of guards defined for the given patch
         name.
         
-        @param patch selected patch name (empty for current patch)
+        @param index index of the selected entry
+        @type int
         """
+        patch = self.patchSelector.itemText(index)
         if self.__dirtyList:
             res = E5MessageBox.question(
                 self,
@@ -263,5 +265,7 @@
                     .format(error))
             else:
                 self.__dirtyList = False
-                self.on_patchSelector_activated(
-                    self.patchNameLabel.text())
+                index = self.patchSelector.findText(self.patchNameLabel.text())
+                if index == -1:
+                    index = 0
+                self.on_patchSelector_activated(index)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -54,15 +54,17 @@
         """
         Public slot to start the list command.
         """
-        self.on_patchSelector_activated("")
+        self.on_patchSelector_activated(0)
     
-    @pyqtSlot(str)
-    def on_patchSelector_activated(self, patch):
+    @pyqtSlot(int)
+    def on_patchSelector_activated(self, index):
         """
         Private slot to get the list of guards for the given patch name.
         
-        @param patch selected patch name (empty for current patch)
+        @param index index of the selected entry
+        @type int
         """
+        patch = self.patchSelector.itemText(index)
         self.guardsList.clear()
         self.patchNameLabel.setText("")
         
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -127,12 +127,14 @@
         self.close()
         self.rejected.emit()
     
-    @pyqtSlot(str)
-    def on_recentComboBox_activated(self, txt):
+    @pyqtSlot(int)
+    def on_recentComboBox_activated(self, index):
         """
         Private slot to select a commit message from recent ones.
         
-        @param txt selected recent commit message (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.recentComboBox.itemText(index)
         if txt:
             self.logEdit.setPlainText(txt)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -555,12 +555,13 @@
         """
         self.__filterLogs()
     
-    @pyqtSlot(str)
-    def on_fieldCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_fieldCombo_activated(self, index):
         """
         Private slot called, when a new filter field is selected.
         
-        @param txt text of the selected field (string)
+        @param index index of the selected entry
+        @type int
         """
         self.__filterLogs()
     
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -110,13 +110,15 @@
         if not checked:
             self.vcsTagEdit.clear()
         
-    @pyqtSlot(str)
-    def on_protocolCombo_activated(self, protocol):
+    @pyqtSlot(int)
+    def on_protocolCombo_activated(self, index):
         """
         Private slot to switch the status of the directory selection button.
         
-        @param protocol name of the selected protocol (string)
+        @param index index of the selected entry
+        @type int
         """
+        protocol = self.protocolCombo.itemText(index)
         if protocol == "file://":
             self.networkPath = self.vcsUrlPicker.text()
             self.vcsUrlPicker.setText(self.localPath)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -74,13 +74,15 @@
                     self.protocolCombo.findText(protocol + "://"))
                 self.vcsUrlPicker.setText(path)
         
-    @pyqtSlot(str)
-    def on_protocolCombo_activated(self, protocol):
+    @pyqtSlot(int)
+    def on_protocolCombo_activated(self, index):
         """
         Private slot to switch the status of the directory selection button.
         
-        @param protocol selected protocol (string)
+        @param index index of the selected entry
+        @type int
         """
+        protocol = self.protocolCombo.itemText(index)
         if protocol == "file://":
             self.networkPath = self.vcsUrlPicker.text()
             self.vcsUrlPicker.setText(self.localPath)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -551,13 +551,15 @@
         commitable = len(self.__getCommitableItems())
         self.commitButton.setEnabled(commitable)
     
-    @pyqtSlot(str)
-    def on_statusFilterCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_statusFilterCombo_activated(self, index):
         """
         Private slot to react to the selection of a status filter.
         
-        @param txt selected status filter (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.statusFilterCombo.itemText(index)
         if txt == "<{0}>".format(self.tr("all")):
             for topIndex in range(self.statusList.topLevelItemCount()):
                 topItem = self.statusList.topLevelItem(topIndex)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsSubversion/SvnCommitDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/SvnCommitDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/SvnCommitDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -122,12 +122,14 @@
         self.close()
         self.rejected.emit()
     
-    @pyqtSlot(str)
-    def on_recentComboBox_activated(self, txt):
+    @pyqtSlot(int)
+    def on_recentComboBox_activated(self, index):
         """
         Private slot to select a commit message from recent ones.
         
-        @param txt text of the combo (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.recentComboBox.itemText(index)
         if txt:
             self.logEdit.setPlainText(txt)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -647,12 +647,13 @@
         """
         self.__filterLogs()
     
-    @pyqtSlot(str)
-    def on_fieldCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_fieldCombo_activated(self, index):
         """
         Private slot called, when a new filter field is selected.
         
-        @param txt text of the selected field (string)
+        @param index index of the selected entry
+        @type int
         """
         self.__filterLogs()
     
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -109,13 +109,15 @@
         if not checked:
             self.vcsTagEdit.clear()
         
-    @pyqtSlot(str)
-    def on_protocolCombo_activated(self, protocol):
+    @pyqtSlot(int)
+    def on_protocolCombo_activated(self, index):
         """
         Private slot to switch the status of the directory selection button.
         
-        @param protocol selected protocol (string)
+        @param index index of the selected entry
+        @type int
         """
+        protocol = self.protocolCombo.itemText(index)
         if protocol == "file://":
             self.networkPath = self.vcsUrlPicker.text()
             self.vcsUrlPicker.setText(self.localPath)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsSubversion/SvnOptionsDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/SvnOptionsDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/SvnOptionsDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -74,13 +74,15 @@
                     self.protocolCombo.findText(protocol + "://"))
                 self.vcsUrlPicker.setText(path)
         
-    @pyqtSlot(str)
-    def on_protocolCombo_activated(self, protocol):
+    @pyqtSlot(int)
+    def on_protocolCombo_activated(self, index):
         """
         Private slot to switch the status of the directory selection button.
         
-        @param protocol selected protocol (string)
+        @param index index of the selected entry
+        @type int
         """
+        protocol = self.protocolCombo.itemText(index)
         if protocol == "file://":
             self.networkPath = self.vcsUrlPicker.text()
             self.vcsUrlPicker.setText(self.localPath)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -644,13 +644,15 @@
         commitable = len(self.__getCommitableItems())
         self.commitButton.setEnabled(commitable)
     
-    @pyqtSlot(str)
-    def on_statusFilterCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_statusFilterCombo_activated(self, index):
         """
         Private slot to react to the selection of a status filter.
         
-        @param txt selected status filter (string)
+        @param index index of the selected entry
+        @type int
         """
+        txt = self.statusFilterCombo.itemText(index)
         if txt == "<{0}>".format(self.tr("all")):
             for topIndex in range(self.statusList.topLevelItemCount()):
                 topItem = self.statusList.topLevelItem(topIndex)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Preferences/ConfigurationPages/EditorAPIsPage.py
--- 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])
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Preferences/ConfigurationPages/EditorExportersPage.py
--- a/eric6/Preferences/ConfigurationPages/EditorExportersPage.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/EditorExportersPage.py	Thu Mar 04 17:48:09 2021 +0100
@@ -99,7 +99,7 @@
         self.texTitleCheckBox.setChecked(
             Preferences.getEditorExporter("TeX/FullPathAsTitle"))
         
-        self.on_exportersCombo_activated(' ')
+        self.on_exportersCombo_activated(0)
     
     def save(self):
         """
@@ -174,13 +174,15 @@
             "TeX/FullPathAsTitle",
             self.texTitleCheckBox.isChecked())
     
-    @pyqtSlot(str)
-    def on_exportersCombo_activated(self, exporter):
+    @pyqtSlot(int)
+    def on_exportersCombo_activated(self, index):
         """
         Private slot to select the page related to the selected exporter.
         
-        @param exporter name of the selected exporter (string)
+        @param index index of the selected entry
+        @type int
         """
+        exporter = self.exportersCombo.itemText(index)
         try:
             index = self.pageIds[exporter]
         except KeyError:
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py
--- a/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py	Thu Mar 04 17:48:09 2021 +0100
@@ -98,7 +98,7 @@
             self.lexerLanguageComboBox.addItem(
                 QScintilla.Lexers.getLanguageIcon(language, False),
                 language)
-        self.on_lexerLanguageComboBox_activated("")
+        self.on_lexerLanguageComboBox_activated(0)
     
     def save(self):
         """
@@ -107,13 +107,16 @@
         for lexer in list(self.lexers.values()):
             lexer.writeSettings()
     
-    @pyqtSlot(str)
-    def on_lexerLanguageComboBox_activated(self, language):
+    @pyqtSlot(int)
+    def on_lexerLanguageComboBox_activated(self, index):
         """
         Private slot to fill the style combo of the source page.
         
-        @param language The lexer language (string)
+        @param index index of the selected entry
+        @type int
         """
+        language = self.lexerLanguageComboBox.itemText(index)
+        
         self.styleElementList.clear()
         self.styleGroup.setEnabled(False)
         self.lexer = None
@@ -652,7 +655,7 @@
         
         self.__applyStyles(styles, importAll=importAll)
         self.on_lexerLanguageComboBox_activated(
-            self.lexerLanguageComboBox.currentText())
+            self.lexerLanguageComboBox.currentIndex())
     
     def __applyStyles(self, stylesList, importAll=False):
         """
@@ -739,7 +742,7 @@
         if state:
             self.lexerLanguageComboBox.setCurrentIndex(state[0])
             self.on_lexerLanguageComboBox_activated(
-                self.lexerLanguageComboBox.currentText())
+                self.lexerLanguageComboBox.currentIndex())
             
             parentIndex, index = state[1]
             if parentIndex is None:
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Preferences/ConfigurationPages/EditorKeywordsPage.py
--- a/eric6/Preferences/ConfigurationPages/EditorKeywordsPage.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/EditorKeywordsPage.py	Thu Mar 04 17:48:09 2021 +0100
@@ -89,7 +89,7 @@
         
         self.currentLanguage = ''
         self.currentSet = 1
-        self.on_languageCombo_activated(self.currentLanguage)
+        self.on_languageCombo_activated(0)
     
     def save(self):
         """
@@ -102,14 +102,16 @@
         for lang, keywords in self.__keywords.items():
             Preferences.setEditorKeywords(lang, keywords["Sets"])
         
-    @pyqtSlot(str)
-    def on_languageCombo_activated(self, language):
+    @pyqtSlot(int)
+    def on_languageCombo_activated(self, index):
         """
         Private slot to fill the keywords edit.
         
-        @param language selected language
-        @type str
+        @param index index of the selected entry
+        @type int
         """
+        language = self.languageCombo.itemText(index)
+        
         self.defaultButton.setEnabled(bool(language))
         self.allDefaultButton.setEnabled(bool(language))
         
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Preferences/ConfigurationPages/EditorTypingPage.py
--- a/eric6/Preferences/ConfigurationPages/EditorTypingPage.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/EditorTypingPage.py	Thu Mar 04 17:48:09 2021 +0100
@@ -106,7 +106,7 @@
         self.yamlInsertBlankCommaCheckBox.setChecked(
             Preferences.getEditorTyping("Yaml/InsertBlankComma"))
         
-        self.on_languageCombo_activated(' ')
+        self.on_languageCombo_activated(0)
     
     def save(self):
         """
@@ -211,13 +211,15 @@
             "Yaml/InsertBlankComma",
             self.yamlInsertBlankCommaCheckBox.isChecked())
     
-    @pyqtSlot(str)
-    def on_languageCombo_activated(self, language):
+    @pyqtSlot(int)
+    def on_languageCombo_activated(self, index):
         """
         Private slot to select the page related to the selected language.
         
-        @param language name of the selected language (string)
+        @param index index of the selected entry
+        @type int
         """
+        language = self.languageCombo.itemText(index)
         try:
             index = self.pageIds[language]
         except KeyError:
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Project/AddDirectoryDialog.py
--- a/eric6/Project/AddDirectoryDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Project/AddDirectoryDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -42,7 +42,7 @@
         
         self.ppath = pro.ppath
         self.targetDirPicker.setText(self.ppath)
-        self.on_filterComboBox_highlighted('(*.py)')
+        self.on_filterComboBox_highlighted(0)
         # enable all dialog elements
         if fileTypeFilter == 'source':  # it is a source file
             self.filterComboBox.addItem(
@@ -62,7 +62,8 @@
         elif fileTypeFilter == 'others':
             self.filterComboBox.addItem(
                 self.tr("Other Files (*)"), "OTHERS")
-            self.on_filterComboBox_highlighted('(*)')
+            self.on_filterComboBox_highlighted(
+                self.filterComboBox.count() - 1)
         else:
             self.filterComboBox.addItem(
                 self.tr("Source Files"), "SOURCES")
@@ -81,14 +82,17 @@
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
         
-    @pyqtSlot(str)
-    def on_filterComboBox_highlighted(self, fileType):
+    @pyqtSlot(int)
+    def on_filterComboBox_highlighted(self, index):
         """
         Private slot to handle the selection of a file type.
         
-        @param fileType the selected file type (string)
+        @param index index of the selected entry
+        @type int
         """
-        if fileType.endswith('(*)'):
+        fileType = self.filterComboBox.itemData(index)
+        
+        if fileType == "OTHERS":
             self.targetDirLabel.setEnabled(False)
             self.targetDirPicker.setEnabled(False)
             self.recursiveCheckBox.setEnabled(False)
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/SqlBrowser/SqlConnectionDialog.py
--- a/eric6/SqlBrowser/SqlConnectionDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/SqlBrowser/SqlConnectionDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -70,12 +70,13 @@
         else:
             self.okButton.setEnabled(True)
     
-    @pyqtSlot(str)
-    def on_driverCombo_activated(self, txt):
+    @pyqtSlot(int)
+    def on_driverCombo_activated(self, index):
         """
         Private slot handling the selection of a database driver.
         
-        @param txt text of the driver combo (string)
+        @param index index of the selected entry
+        @type int
         """
         self.__updateDialog()
     
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Tools/TRPreviewer.py
--- a/eric6/Tools/TRPreviewer.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Tools/TRPreviewer.py	Thu Mar 04 17:48:09 2021 +0100
@@ -103,7 +103,7 @@
 
         self.setCentralWidget(self.cw)
         
-        self.languageCombo.activated[str].connect(self.setTranslation)
+        self.languageCombo.activated[int].connect(self.__setTranslation)
         
         self.translations = TranslationsDict(self.languageCombo, self)
         self.translations.translationChanged.connect(
@@ -403,12 +403,14 @@
         
         self.__updateActions()
     
-    def setTranslation(self, name):
+    def __setTranslation(self, index):
         """
-        Public slot to activate a translation.
+        Private slot to activate a translation.
         
-        @param name name (language) of the translation (string)
+        @param index index of the selected entry
+        @type int
         """
+        name = self.languageCombo.itemText(index)
         self.translations.set(name)
     
     def __showWindowMenu(self):
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/Tools/UIPreviewer.py
--- a/eric6/Tools/UIPreviewer.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Tools/UIPreviewer.py	Thu Mar 04 17:48:09 2021 +0100
@@ -100,7 +100,7 @@
 
         self.setCentralWidget(self.cw)
         
-        self.styleCombo.activated[str].connect(self.__guiStyleSelected)
+        self.styleCombo.activated[int].connect(self.__guiStyleSelected)
         
         self.__initActions()
         self.__initMenus()
@@ -289,12 +289,14 @@
         """
         QWhatsThis.enterWhatsThisMode()
         
-    def __guiStyleSelected(self, selectedStyle):
+    def __guiStyleSelected(self, index):
         """
         Private slot to handle the selection of a GUI style.
         
-        @param selectedStyle name of the selected style (string)
+        @param index index of the selected entry
+        @type int
         """
+        selectedStyle = self.styleCombo.itemText(index)
         if self.mainWidget:
             self.__updateChildren(selectedStyle)
     
diff -r fc1ae39af8c9 -r 8c1445825e7b eric6/WebBrowser/WebBrowserWindow.py
--- a/eric6/WebBrowser/WebBrowserWindow.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/WebBrowser/WebBrowserWindow.py	Thu Mar 04 17:48:09 2021 +0100
@@ -2308,7 +2308,7 @@
             filtertb.addWidget(QLabel(self.tr("Filtered by: ")))
             filtertb.addWidget(self.filterCombo)
             self.__helpEngine.setupFinished.connect(self.__setupFilterCombo)
-            self.filterCombo.activated[str].connect(
+            self.filterCombo.activated[int].connect(
                 self.__filterQtHelpDocumentation)
             self.__setupFilterCombo()
             self.__toolbars["filter"] = (filtertb.windowTitle(), filtertb)
@@ -3445,12 +3445,14 @@
                 idx = 0
             self.filterCombo.setCurrentIndex(idx)
         
-    def __filterQtHelpDocumentation(self, customFilter):
+    def __filterQtHelpDocumentation(self, index):
         """
         Private slot to filter the QtHelp documentation.
         
-        @param customFilter name of filter to be applied (string)
-        """
+        @param index index of the selected entry
+        @type int
+        """
+        customFilter = self.filterCombo.itemText(index)
         if self.__helpEngine:
             self.__helpEngine.setCurrentFilter(customFilter)
         

eric ide

mercurial