Network/IRC/IrcIdentitiesEditDialog.py

changeset 6471
ecfcfc58385c
parent 6048
82ad8ec9548c
child 6645
ad476851d7e0
--- a/Network/IRC/IrcIdentitiesEditDialog.py	Tue Aug 21 11:43:00 2018 +0200
+++ b/Network/IRC/IrcIdentitiesEditDialog.py	Tue Aug 21 14:36:57 2018 +0200
@@ -49,6 +49,8 @@
         self.nicknameUpButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png"))
         self.nicknameDownButton.setIcon(
             UI.PixmapCache.getIcon("1downarrow.png"))
+        self.showPasswordButton.setIcon(
+            UI.PixmapCache.getIcon("showPassword.png"))
         
         self.__manager = manager
         
@@ -453,6 +455,27 @@
             self.nicknamesList.insertItem(row, itm)
             self.nicknamesList.setCurrentItem(itm)
     
+    @pyqtSlot(bool)
+    def on_showPasswordButton_clicked(self, checked):
+        """
+        Private slot to show or hide the password.
+        
+        @param checked state of the button
+        @type bool
+        """
+        if checked:
+            self.passwordEdit.setEchoMode(QLineEdit.Normal)
+            self.showPasswordButton.setIcon(
+                UI.PixmapCache.getIcon("hidePassword.png"))
+            self.showPasswordButton.setToolTip(
+                self.tr("Press to hide the password"))
+        else:
+            self.passwordEdit.setEchoMode(QLineEdit.Password)
+            self.showPasswordButton.setIcon(
+                UI.PixmapCache.getIcon("showPassword.png"))
+            self.showPasswordButton.setToolTip(
+                self.tr("Press to show the password"))
+    
     def accept(self):
         """
         Public slot handling the acceptance of the dialog.

eric ide

mercurial