src/eric7/Preferences/ConfigurationPages/SecurityPage.py

branch
eric7
changeset 9971
773ad1f1ed22
parent 9653
e67609152c5e
child 9972
68ac01294544
equal deleted inserted replaced
9970:c3686b43f76b 9971:773ad1f1ed22
35 self.__configDlg = configDialog 35 self.__configDlg = configDialog
36 self.__displayMode = None 36 self.__displayMode = None
37 37
38 # set initial values 38 # set initial values
39 self.savePasswordsCheckBox.setChecked(Preferences.getUser("SavePasswords")) 39 self.savePasswordsCheckBox.setChecked(Preferences.getUser("SavePasswords"))
40 self.masterPasswordCheckBox.setChecked(Preferences.getUser("UseMasterPassword")) 40 self.mainPasswordCheckBox.setChecked(Preferences.getUser("UseMasterPassword"))
41 self.masterPasswordButton.setEnabled(Preferences.getUser("UseMasterPassword")) 41 self.mainPasswordButton.setEnabled(Preferences.getUser("UseMasterPassword"))
42 42
43 self.__newPassword = "" 43 self.__newPassword = ""
44 self.__oldUseMasterPassword = Preferences.getUser("UseMasterPassword") 44 self.__oldUseMainPassword = Preferences.getUser("UseMasterPassword")
45 45
46 self.alwaysRejectCheckBox.setChecked( 46 self.alwaysRejectCheckBox.setChecked(
47 Preferences.getWebBrowser("AlwaysRejectFaultyCertificates") 47 Preferences.getWebBrowser("AlwaysRejectFaultyCertificates")
48 ) 48 )
49 49
71 """ 71 """
72 Public slot to save the Help Viewers configuration. 72 Public slot to save the Help Viewers configuration.
73 """ 73 """
74 Preferences.setUser("SavePasswords", self.savePasswordsCheckBox.isChecked()) 74 Preferences.setUser("SavePasswords", self.savePasswordsCheckBox.isChecked())
75 Preferences.setUser( 75 Preferences.setUser(
76 "UseMasterPassword", self.masterPasswordCheckBox.isChecked() 76 "UseMasterPassword", self.mainPasswordCheckBox.isChecked()
77 ) 77 )
78 78
79 if self.__oldUseMasterPassword != self.masterPasswordCheckBox.isChecked(): 79 if self.__oldUseMainPassword != self.mainPasswordCheckBox.isChecked():
80 self.__configDlg.masterPasswordChanged.emit("", self.__newPassword) 80 self.__configDlg.mainPasswordChanged.emit("", self.__newPassword)
81 81
82 Preferences.setWebBrowser( 82 Preferences.setWebBrowser(
83 "AlwaysRejectFaultyCertificates", self.alwaysRejectCheckBox.isChecked() 83 "AlwaysRejectFaultyCertificates", self.alwaysRejectCheckBox.isChecked()
84 ) 84 )
85 85
86 @pyqtSlot(bool) 86 @pyqtSlot(bool)
87 def on_masterPasswordCheckBox_clicked(self, checked): 87 def on_mainPasswordCheckBox_clicked(self, checked):
88 """ 88 """
89 Private slot to handle the use of a master password. 89 Private slot to handle the use of a main password.
90 90
91 @param checked flag indicating the state of the check box (boolean) 91 @param checked flag indicating the state of the check box (boolean)
92 """ 92 """
93 from .MasterPasswordEntryDialog import MasterPasswordEntryDialog 93 from .MainPasswordEntryDialog import MainPasswordEntryDialog
94 94
95 if checked: 95 if checked:
96 dlg = MasterPasswordEntryDialog("", self) 96 dlg = MainPasswordEntryDialog("", self)
97 if dlg.exec() == QDialog.DialogCode.Accepted: 97 if dlg.exec() == QDialog.DialogCode.Accepted:
98 Preferences.setUser("MasterPassword", dlg.getMasterPassword()) 98 Preferences.setUser("MasterPassword", dlg.getMainPassword())
99 self.masterPasswordButton.setEnabled(True) 99 self.mainPasswordButton.setEnabled(True)
100 self.__newPassword = dlg.getMasterPassword() 100 self.__newPassword = dlg.getMainPassword()
101 else: 101 else:
102 self.masterPasswordCheckBox.setChecked(False) 102 self.mainPasswordCheckBox.setChecked(False)
103 else: 103 else:
104 self.masterPasswordButton.setEnabled(False) 104 self.mainPasswordButton.setEnabled(False)
105 self.__newPassword = "" 105 self.__newPassword = ""
106 106
107 @pyqtSlot() 107 @pyqtSlot()
108 def on_masterPasswordButton_clicked(self): 108 def on_mainPasswordButton_clicked(self):
109 """ 109 """
110 Private slot to change the master password. 110 Private slot to change the main password.
111 """ 111 """
112 from .MasterPasswordEntryDialog import MasterPasswordEntryDialog 112 from .MainPasswordEntryDialog import MainPasswordEntryDialog
113 113
114 dlg = MasterPasswordEntryDialog(Preferences.getUser("MasterPassword"), self) 114 dlg = MainPasswordEntryDialog(Preferences.getUser("MasterPassword"), self)
115 if dlg.exec() == QDialog.DialogCode.Accepted: 115 if dlg.exec() == QDialog.DialogCode.Accepted:
116 Preferences.setUser("MasterPassword", dlg.getMasterPassword()) 116 Preferences.setUser("MasterPassword", dlg.getMainPassword())
117 117
118 if self.__oldUseMasterPassword != self.masterPasswordCheckBox.isChecked(): 118 if self.__oldUseMainPassword != self.mainPasswordCheckBox.isChecked():
119 # the user is about to change the use of a master password 119 # the user is about to change the use of a main password
120 # just save the changed password 120 # just save the changed password
121 self.__newPassword = dlg.getMasterPassword() 121 self.__newPassword = dlg.getMainPassword()
122 else: 122 else:
123 self.__configDlg.masterPasswordChanged.emit( 123 self.__configDlg.mainPasswordChanged.emit(
124 dlg.getCurrentPassword(), dlg.getMasterPassword() 124 dlg.getCurrentPassword(), dlg.getMainPassword()
125 ) 125 )
126 126
127 127
128 def create(dlg): 128 def create(dlg):
129 """ 129 """

eric ide

mercurial