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.mainPasswordCheckBox.setChecked(Preferences.getUser("UseMasterPassword")) |
40 self.mainPasswordCheckBox.setChecked(Preferences.getUser("UseMainPassword")) |
41 self.mainPasswordButton.setEnabled(Preferences.getUser("UseMasterPassword")) |
41 self.mainPasswordButton.setEnabled(Preferences.getUser("UseMainPassword")) |
42 |
42 |
43 self.__newPassword = "" |
43 self.__newPassword = "" |
44 self.__oldUseMainPassword = Preferences.getUser("UseMasterPassword") |
44 self.__oldUseMainPassword = Preferences.getUser("UseMainPassword") |
45 |
45 |
46 self.alwaysRejectCheckBox.setChecked( |
46 self.alwaysRejectCheckBox.setChecked( |
47 Preferences.getWebBrowser("AlwaysRejectFaultyCertificates") |
47 Preferences.getWebBrowser("AlwaysRejectFaultyCertificates") |
48 ) |
48 ) |
49 |
49 |
69 def save(self): |
69 def save(self): |
70 """ |
70 """ |
71 Public slot to save the Help Viewers configuration. |
71 Public slot to save the Help Viewers configuration. |
72 """ |
72 """ |
73 Preferences.setUser("SavePasswords", self.savePasswordsCheckBox.isChecked()) |
73 Preferences.setUser("SavePasswords", self.savePasswordsCheckBox.isChecked()) |
74 Preferences.setUser("UseMasterPassword", self.mainPasswordCheckBox.isChecked()) |
74 Preferences.setUser("UseMainPassword", self.mainPasswordCheckBox.isChecked()) |
75 |
75 |
76 if self.__oldUseMainPassword != self.mainPasswordCheckBox.isChecked(): |
76 if self.__oldUseMainPassword != self.mainPasswordCheckBox.isChecked(): |
77 self.__configDlg.mainPasswordChanged.emit("", self.__newPassword) |
77 self.__configDlg.mainPasswordChanged.emit("", self.__newPassword) |
78 |
78 |
79 Preferences.setWebBrowser( |
79 Preferences.setWebBrowser( |
91 from .MainPasswordEntryDialog import MainPasswordEntryDialog |
91 from .MainPasswordEntryDialog import MainPasswordEntryDialog |
92 |
92 |
93 if checked: |
93 if checked: |
94 dlg = MainPasswordEntryDialog("", self) |
94 dlg = MainPasswordEntryDialog("", self) |
95 if dlg.exec() == QDialog.DialogCode.Accepted: |
95 if dlg.exec() == QDialog.DialogCode.Accepted: |
96 Preferences.setUser("MasterPassword", dlg.getMainPassword()) |
96 Preferences.setUser("MainPassword", dlg.getMainPassword()) |
97 self.mainPasswordButton.setEnabled(True) |
97 self.mainPasswordButton.setEnabled(True) |
98 self.__newPassword = dlg.getMainPassword() |
98 self.__newPassword = dlg.getMainPassword() |
99 else: |
99 else: |
100 self.mainPasswordCheckBox.setChecked(False) |
100 self.mainPasswordCheckBox.setChecked(False) |
101 else: |
101 else: |
107 """ |
107 """ |
108 Private slot to change the main password. |
108 Private slot to change the main password. |
109 """ |
109 """ |
110 from .MainPasswordEntryDialog import MainPasswordEntryDialog |
110 from .MainPasswordEntryDialog import MainPasswordEntryDialog |
111 |
111 |
112 dlg = MainPasswordEntryDialog(Preferences.getUser("MasterPassword"), self) |
112 dlg = MainPasswordEntryDialog(Preferences.getUser("MainPassword"), self) |
113 if dlg.exec() == QDialog.DialogCode.Accepted: |
113 if dlg.exec() == QDialog.DialogCode.Accepted: |
114 Preferences.setUser("MasterPassword", dlg.getMainPassword()) |
114 Preferences.setUser("MainPassword", dlg.getMainPassword()) |
115 |
115 |
116 if self.__oldUseMainPassword != self.mainPasswordCheckBox.isChecked(): |
116 if self.__oldUseMainPassword != self.mainPasswordCheckBox.isChecked(): |
117 # the user is about to change the use of a main password |
117 # the user is about to change the use of a main password |
118 # just save the changed password |
118 # just save the changed password |
119 self.__newPassword = dlg.getMainPassword() |
119 self.__newPassword = dlg.getMainPassword() |