Preferences/ConfigurationPages/SecurityPage.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3010
befeff46ec0f
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
25 """ 25 """
26 def __init__(self, configDialog): 26 def __init__(self, configDialog):
27 """ 27 """
28 Constructor 28 Constructor
29 29
30 @param configDialog reference to the configuration dialog (ConfigurationDialog) 30 @param configDialog reference to the configuration dialog
31 (ConfigurationDialog)
31 """ 32 """
32 super(SecurityPage, self).__init__() 33 super(SecurityPage, self).__init__()
33 self.setupUi(self) 34 self.setupUi(self)
34 self.setObjectName("SecurityPage") 35 self.setObjectName("SecurityPage")
35 36
61 self.masterPasswordCheckBox.isChecked()) 62 self.masterPasswordCheckBox.isChecked())
62 if self.dnsPrefetchCheckBox.isEnabled(): 63 if self.dnsPrefetchCheckBox.isEnabled():
63 Preferences.setHelp("DnsPrefetchEnabled", 64 Preferences.setHelp("DnsPrefetchEnabled",
64 self.dnsPrefetchCheckBox.isChecked()) 65 self.dnsPrefetchCheckBox.isChecked())
65 66
66 if self.__oldUseMasterPassword != self.masterPasswordCheckBox.isChecked(): 67 if self.__oldUseMasterPassword != \
68 self.masterPasswordCheckBox.isChecked():
67 self.__configDlg.masterPasswordChanged.emit("", self.__newPassword) 69 self.__configDlg.masterPasswordChanged.emit("", self.__newPassword)
68 70
69 @pyqtSlot(bool) 71 @pyqtSlot(bool)
70 def on_masterPasswordCheckBox_clicked(self, checked): 72 def on_masterPasswordCheckBox_clicked(self, checked):
71 """ 73 """
91 def on_masterPasswordButton_clicked(self): 93 def on_masterPasswordButton_clicked(self):
92 """ 94 """
93 Private slot to change the master password. 95 Private slot to change the master password.
94 """ 96 """
95 from .MasterPasswordEntryDialog import MasterPasswordEntryDialog 97 from .MasterPasswordEntryDialog import MasterPasswordEntryDialog
96 dlg = MasterPasswordEntryDialog(Preferences.getUser("MasterPassword"), self) 98 dlg = MasterPasswordEntryDialog(
99 Preferences.getUser("MasterPassword"), self)
97 if dlg.exec_() == QDialog.Accepted: 100 if dlg.exec_() == QDialog.Accepted:
98 Preferences.setUser("MasterPassword", 101 Preferences.setUser("MasterPassword",
99 dlg.getMasterPassword()) 102 dlg.getMasterPassword())
100 103
101 if self.__oldUseMasterPassword != self.masterPasswordCheckBox.isChecked(): 104 if self.__oldUseMasterPassword != \
105 self.masterPasswordCheckBox.isChecked():
102 # the user is about to change the use of a master password 106 # the user is about to change the use of a master password
103 # just save the changed password 107 # just save the changed password
104 self.__newPassword = dlg.getMasterPassword() 108 self.__newPassword = dlg.getMasterPassword()
105 else: 109 else:
106 self.__configDlg.masterPasswordChanged.emit( 110 self.__configDlg.masterPasswordChanged.emit(
110 def create(dlg): 114 def create(dlg):
111 """ 115 """
112 Module function to create the configuration page. 116 Module function to create the configuration page.
113 117
114 @param dlg reference to the configuration dialog 118 @param dlg reference to the configuration dialog
119 @return reference to the instantiated page (ConfigurationPageBase)
115 """ 120 """
116 page = SecurityPage(dlg) 121 page = SecurityPage(dlg)
117 return page 122 return page

eric ide

mercurial