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( |