36 from QScintilla.SpellChecker import SpellChecker |
36 from QScintilla.SpellChecker import SpellChecker |
37 |
37 |
38 from PyUnit.UnittestDialog import UnittestDialog |
38 from PyUnit.UnittestDialog import UnittestDialog |
39 |
39 |
40 from Helpviewer.HelpWindow import HelpWindow |
40 from Helpviewer.HelpWindow import HelpWindow |
|
41 from Helpviewer.Passwords.PasswordManager import PasswordManager |
41 |
42 |
42 from Preferences.ConfigurationDialog import ConfigurationDialog |
43 from Preferences.ConfigurationDialog import ConfigurationDialog |
43 from Preferences.ViewProfileDialog import ViewProfileDialog |
44 from Preferences.ViewProfileDialog import ViewProfileDialog |
44 from Preferences.ShortcutsDialog import ShortcutsDialog |
45 from Preferences.ShortcutsDialog import ShortcutsDialog |
45 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog |
46 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog |
177 @signal appendStdout(str) emitted to write data to stdout logger |
178 @signal appendStdout(str) emitted to write data to stdout logger |
178 @signal preferencesChanged() emitted after the preferences were changed |
179 @signal preferencesChanged() emitted after the preferences were changed |
179 @signal reloadAPIs() emitted to reload the api information |
180 @signal reloadAPIs() emitted to reload the api information |
180 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The name |
181 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The name |
181 of the menu and a reference to the menu are given. |
182 of the menu and a reference to the menu are given. |
|
183 @signal masterPasswordChanged(str, str) emitted after the master |
|
184 password has been changed with the old and the new password |
182 """ |
185 """ |
183 appendStderr = pyqtSignal(str) |
186 appendStderr = pyqtSignal(str) |
184 appendStdout = pyqtSignal(str) |
187 appendStdout = pyqtSignal(str) |
185 preferencesChanged = pyqtSignal() |
188 preferencesChanged = pyqtSignal() |
186 reloadAPIs = pyqtSignal() |
189 reloadAPIs = pyqtSignal() |
187 showMenu = pyqtSignal(str, QMenu) |
190 showMenu = pyqtSignal(str, QMenu) |
|
191 masterPasswordChanged = pyqtSignal(str, str) |
188 |
192 |
189 maxFilePathLen = 100 |
193 maxFilePathLen = 100 |
190 maxSbFilePathLen = 150 |
194 maxSbFilePathLen = 150 |
191 maxMenuFilePathLen = 75 |
195 maxMenuFilePathLen = 75 |
192 |
196 |
4848 |
4852 |
4849 if Preferences.getHelp("SingleHelpWindow"): |
4853 if Preferences.getHelp("SingleHelpWindow"): |
4850 self.helpWindow = help |
4854 self.helpWindow = help |
4851 self.helpWindow.helpClosed.connect(self.__helpClosed) |
4855 self.helpWindow.helpClosed.connect(self.__helpClosed) |
4852 self.preferencesChanged.connect(self.helpWindow.preferencesChanged) |
4856 self.preferencesChanged.connect(self.helpWindow.preferencesChanged) |
|
4857 self.masterPasswordChanged.connect(self.helpWindow.masterPasswordChanged) |
4853 elif searchWord is not None: |
4858 elif searchWord is not None: |
4854 self.helpWindow.search(searchWord) |
4859 self.helpWindow.search(searchWord) |
4855 self.helpWindow.raise_() |
4860 self.helpWindow.raise_() |
4856 else: |
4861 else: |
4857 self.helpWindow.newTab(home) |
4862 self.helpWindow.newTab(home) |
4861 """ |
4866 """ |
4862 Private slot to handle the helpClosed signal of the help window. |
4867 Private slot to handle the helpClosed signal of the help window. |
4863 """ |
4868 """ |
4864 if Preferences.getHelp("SingleHelpWindow"): |
4869 if Preferences.getHelp("SingleHelpWindow"): |
4865 self.preferencesChanged.disconnect(self.helpWindow.preferencesChanged) |
4870 self.preferencesChanged.disconnect(self.helpWindow.preferencesChanged) |
|
4871 self.masterPasswordChanged.disconnect(self.helpWindow.masterPasswordChanged) |
4866 self.helpWindow = None |
4872 self.helpWindow = None |
4867 |
4873 |
4868 def __helpViewer(self): |
4874 def __helpViewer(self): |
4869 """ |
4875 """ |
4870 Private slot to start an empty help viewer. |
4876 Private slot to start an empty help viewer. |
4887 |
4893 |
4888 @param pageName name of the configuration page to show (string) |
4894 @param pageName name of the configuration page to show (string) |
4889 """ |
4895 """ |
4890 dlg = ConfigurationDialog(self, 'Configuration', True) |
4896 dlg = ConfigurationDialog(self, 'Configuration', True) |
4891 dlg.preferencesChanged.connect(self.__preferencesChanged) |
4897 dlg.preferencesChanged.connect(self.__preferencesChanged) |
|
4898 dlg.masterPasswordChanged.connect(self.__masterPasswordChanged) |
4892 dlg.show() |
4899 dlg.show() |
4893 if pageName is not None: |
4900 if pageName is not None: |
4894 dlg.showConfigurationPageByName(pageName) |
4901 dlg.showConfigurationPageByName(pageName) |
4895 elif self.__lastConfigurationPageName: |
4902 elif self.__lastConfigurationPageName: |
4896 dlg.showConfigurationPageByName(self.__lastConfigurationPageName) |
4903 dlg.showConfigurationPageByName(self.__lastConfigurationPageName) |
4950 |
4957 |
4951 SpellChecker.setDefaultLanguage( |
4958 SpellChecker.setDefaultLanguage( |
4952 Preferences.getEditor("SpellCheckingDefaultLanguage")) |
4959 Preferences.getEditor("SpellCheckingDefaultLanguage")) |
4953 |
4960 |
4954 self.preferencesChanged.emit() |
4961 self.preferencesChanged.emit() |
|
4962 |
|
4963 |
|
4964 def __masterPasswordChanged(self, oldPassword, newPassword): |
|
4965 """ |
|
4966 Private slot to handle the change of the master password. |
|
4967 |
|
4968 @param oldPassword current master password (string) |
|
4969 @param newPassword new master password (string) |
|
4970 """ |
|
4971 self.masterPasswordChanged.emit(oldPassword, newPassword) |
|
4972 Preferences.convertPasswords(oldPassword, newPassword) |
|
4973 if self.helpWindow is None: |
|
4974 pwManager = PasswordManager() |
|
4975 pwManager.masterPasswordChanged(oldPassword, newPassword) |
|
4976 Utilities.crypto.changeRememberedMaster(newPassword) |
4955 |
4977 |
4956 def __reloadAPIs(self): |
4978 def __reloadAPIs(self): |
4957 """ |
4979 """ |
4958 Private slot to reload the api information. |
4980 Private slot to reload the api information. |
4959 """ |
4981 """ |