MqttMonitor/MqttConnectionProfilesDialog.py

branch
eric7
changeset 95
d830314cca87
parent 92
2fb5c08019fd
child 97
21f9c010dc42
--- a/MqttMonitor/MqttConnectionProfilesDialog.py	Mon Jun 14 19:14:23 2021 +0200
+++ b/MqttMonitor/MqttConnectionProfilesDialog.py	Sat Jun 26 15:27:44 2021 +0200
@@ -56,6 +56,7 @@
         self.plusButton.setIcon(UI.PixmapCache.getIcon("plus"))
         self.copyButton.setIcon(UI.PixmapCache.getIcon("editCopy"))
         self.minusButton.setIcon(UI.PixmapCache.getIcon("minus"))
+        self.showPasswordButton.setIcon(UI.PixmapCache.getIcon("showPassword"))
         
         self.tlsCertsFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
         self.tlsCertsFilePicker.setFilters(
@@ -371,6 +372,7 @@
             self.tlsDefaultCertsButton.setChecked(True)
         self.__populatingProfile = False
         
+        self.showPasswordButton.setChecked(False)
         self.profileFrame.setEnabled(True)
         self.__updateApplyButton()
     
@@ -401,6 +403,7 @@
         self.tlsSelfSignedClientKeyFilePicker.setText("")
         self.__populatingProfile = False
         
+        self.showPasswordButton.setChecked(False)
         self.profileFrame.setEnabled(False)
         self.__updateApplyButton()
     
@@ -549,6 +552,20 @@
         """
         self.__updateApplyButton()
     
+    @pyqtSlot(bool)
+    def on_showPasswordButton_toggled(self, checked):
+        """
+        Private slot to show or hide the password.
+        
+        @param checked flag indicating the button state
+        @type bool
+        """
+        (
+            self.passwordEdit.setEchoMode(QLineEdit.EchoMode.Normal)
+            if checked else
+            self.passwordEdit.setEchoMode(QLineEdit.EchoMode.Password)
+        )
+    
     @pyqtSlot(str)
     def on_tlsCertsFilePicker_textChanged(self, path):
         """

eric ide

mercurial