eric6/Network/IRC/IrcIdentitiesEditDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/Network/IRC/IrcIdentitiesEditDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Network/IRC/IrcIdentitiesEditDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -68,7 +68,7 @@
             identityName = self.identitiesCombo.itemText(0)
         self.identitiesCombo.setCurrentIndex(index)
         
-        self.on_identitiesCombo_currentIndexChanged(identityName)
+        self.on_identitiesCombo_currentIndexChanged(index)
         
         self.nicknameEdit.installEventFilter(self)
     
@@ -80,8 +80,8 @@
         @param evt reference to the event (QEvent)
         @return flag indicating that the event should be filtered out (boolean)
         """
-        if obj == self.nicknameEdit and evt.type() == QEvent.KeyPress:
-            if evt.key() in [Qt.Key_Enter, Qt.Key_Return]:
+        if obj == self.nicknameEdit and evt.type() == QEvent.Type.KeyPress:
+            if evt.key() in [Qt.Key.Key_Enter, Qt.Key.Key_Return]:
                 self.on_nicknameAddButton_clicked()
                 return True
         
@@ -96,13 +96,15 @@
         self.renameButton.setEnabled(enable)
         self.deleteButton.setEnabled(enable)
     
-    @pyqtSlot(str)
-    def on_identitiesCombo_currentIndexChanged(self, identity):
+    @pyqtSlot(int)
+    def on_identitiesCombo_currentIndexChanged(self, index):
         """
         Private slot to handle the selection of an identity.
         
-        @param identity selected identity (string)
+        @param index index of the selected entry
+        @type int
         """
+        identity = self.identitiesCombo.itemText(index)
         if identity == IrcIdentity.DefaultIdentityDisplay:
             identity = IrcIdentity.DefaultIdentityName
         self.__updateIdentitiesButtons()
@@ -212,7 +214,7 @@
             self,
             self.tr("Add Identity"),
             self.tr("Identity Name:"),
-            QLineEdit.Normal)
+            QLineEdit.EchoMode.Normal)
         
         if ok:
             if name:
@@ -250,7 +252,7 @@
             self,
             self.tr("Copy Identity"),
             self.tr("Identity Name:"),
-            QLineEdit.Normal,
+            QLineEdit.EchoMode.Normal,
             currentIdentity)
         
         if ok:
@@ -288,7 +290,7 @@
             self,
             self.tr("Rename Identity"),
             self.tr("Identity Name:"),
-            QLineEdit.Normal,
+            QLineEdit.EchoMode.Normal,
             currentIdentity)
         
         if ok and name != currentIdentity:
@@ -419,7 +421,8 @@
         if nick not in [self.nicknamesList.item(row).text()
                         for row in range(self.nicknamesList.count())]:
             self.nicknamesList.insertItem(0, nick)
-        self.nicknamesList.setCurrentRow(0, QItemSelectionModel.Clear)
+        self.nicknamesList.setCurrentRow(
+            0, QItemSelectionModel.SelectionFlag.Clear)
         self.nicknameEdit.clear()
         self.__updateNicknameButtons()
     
@@ -465,13 +468,13 @@
         @type bool
         """
         if checked:
-            self.passwordEdit.setEchoMode(QLineEdit.Normal)
+            self.passwordEdit.setEchoMode(QLineEdit.EchoMode.Normal)
             self.showPasswordButton.setIcon(
                 UI.PixmapCache.getIcon("hidePassword"))
             self.showPasswordButton.setToolTip(
                 self.tr("Press to hide the password"))
         else:
-            self.passwordEdit.setEchoMode(QLineEdit.Password)
+            self.passwordEdit.setEchoMode(QLineEdit.EchoMode.Password)
             self.showPasswordButton.setIcon(
                 UI.PixmapCache.getIcon("showPassword"))
             self.showPasswordButton.setToolTip(

eric ide

mercurial