Preferences/ConfigurationPages/SecurityPage.py

changeset 3010
befeff46ec0f
parent 2964
84b65fb9e780
child 3025
67064c71df21
child 3057
10516539f238
equal deleted inserted replaced
3009:bf5ae5d7477d 3010:befeff46ec0f
23 """ 23 """
24 def __init__(self, configDialog): 24 def __init__(self, configDialog):
25 """ 25 """
26 Constructor 26 Constructor
27 27
28 @param configDialog reference to the configuration dialog (ConfigurationDialog) 28 @param configDialog reference to the configuration dialog
29 (ConfigurationDialog)
29 """ 30 """
30 super().__init__() 31 super().__init__()
31 self.setupUi(self) 32 self.setupUi(self)
32 self.setObjectName("SecurityPage") 33 self.setObjectName("SecurityPage")
33 34
59 self.masterPasswordCheckBox.isChecked()) 60 self.masterPasswordCheckBox.isChecked())
60 if self.dnsPrefetchCheckBox.isEnabled(): 61 if self.dnsPrefetchCheckBox.isEnabled():
61 Preferences.setHelp("DnsPrefetchEnabled", 62 Preferences.setHelp("DnsPrefetchEnabled",
62 self.dnsPrefetchCheckBox.isChecked()) 63 self.dnsPrefetchCheckBox.isChecked())
63 64
64 if self.__oldUseMasterPassword != self.masterPasswordCheckBox.isChecked(): 65 if self.__oldUseMasterPassword != \
66 self.masterPasswordCheckBox.isChecked():
65 self.__configDlg.masterPasswordChanged.emit("", self.__newPassword) 67 self.__configDlg.masterPasswordChanged.emit("", self.__newPassword)
66 68
67 @pyqtSlot(bool) 69 @pyqtSlot(bool)
68 def on_masterPasswordCheckBox_clicked(self, checked): 70 def on_masterPasswordCheckBox_clicked(self, checked):
69 """ 71 """
89 def on_masterPasswordButton_clicked(self): 91 def on_masterPasswordButton_clicked(self):
90 """ 92 """
91 Private slot to change the master password. 93 Private slot to change the master password.
92 """ 94 """
93 from .MasterPasswordEntryDialog import MasterPasswordEntryDialog 95 from .MasterPasswordEntryDialog import MasterPasswordEntryDialog
94 dlg = MasterPasswordEntryDialog(Preferences.getUser("MasterPassword"), self) 96 dlg = MasterPasswordEntryDialog(
97 Preferences.getUser("MasterPassword"), self)
95 if dlg.exec_() == QDialog.Accepted: 98 if dlg.exec_() == QDialog.Accepted:
96 Preferences.setUser("MasterPassword", 99 Preferences.setUser("MasterPassword",
97 dlg.getMasterPassword()) 100 dlg.getMasterPassword())
98 101
99 if self.__oldUseMasterPassword != self.masterPasswordCheckBox.isChecked(): 102 if self.__oldUseMasterPassword != \
103 self.masterPasswordCheckBox.isChecked():
100 # the user is about to change the use of a master password 104 # the user is about to change the use of a master password
101 # just save the changed password 105 # just save the changed password
102 self.__newPassword = dlg.getMasterPassword() 106 self.__newPassword = dlg.getMasterPassword()
103 else: 107 else:
104 self.__configDlg.masterPasswordChanged.emit( 108 self.__configDlg.masterPasswordChanged.emit(

eric ide

mercurial