--- a/eric7/Preferences/Shortcuts.py Sat May 22 17:01:51 2021 +0200 +++ b/eric7/Preferences/Shortcuts.py Sat May 22 18:51:46 2021 +0200 @@ -12,8 +12,8 @@ from PyQt6.QtCore import QFile, QIODevice, QCoreApplication from PyQt6.QtGui import QKeySequence -from E5Gui.E5Application import e5App -from E5Gui import E5MessageBox +from E5Gui.EricApplication import ericApp +from E5Gui import EricMessageBox from Preferences import Prefs, syncPreferences @@ -22,7 +22,7 @@ """ Private function to read a single keyboard shortcut from the settings. - @param act reference to the action object (E5Action) + @param act reference to the action object (EricAction) @param category category the action belongs to (string) @param prefClass preferences class used as the storage area """ @@ -47,45 +47,45 @@ (string) """ if helpViewer is None and pluginName is None: - for act in e5App().getObject("Project").getActions(): + for act in ericApp().getObject("Project").getActions(): __readShortcut(act, "Project", prefClass) - for act in e5App().getObject("UserInterface").getActions('ui'): + for act in ericApp().getObject("UserInterface").getActions('ui'): __readShortcut(act, "General", prefClass) - for act in e5App().getObject("UserInterface").getActions('wizards'): + for act in ericApp().getObject("UserInterface").getActions('wizards'): __readShortcut(act, "Wizards", prefClass) - for act in e5App().getObject("DebugUI").getActions(): + for act in ericApp().getObject("DebugUI").getActions(): __readShortcut(act, "Debug", prefClass) - for act in e5App().getObject("ViewManager").getActions('edit'): + for act in ericApp().getObject("ViewManager").getActions('edit'): __readShortcut(act, "Edit", prefClass) - for act in e5App().getObject("ViewManager").getActions('file'): + for act in ericApp().getObject("ViewManager").getActions('file'): __readShortcut(act, "File", prefClass) - for act in e5App().getObject("ViewManager").getActions('search'): + for act in ericApp().getObject("ViewManager").getActions('search'): __readShortcut(act, "Search", prefClass) - for act in e5App().getObject("ViewManager").getActions('view'): + for act in ericApp().getObject("ViewManager").getActions('view'): __readShortcut(act, "View", prefClass) - for act in e5App().getObject("ViewManager").getActions('macro'): + for act in ericApp().getObject("ViewManager").getActions('macro'): __readShortcut(act, "Macro", prefClass) - for act in e5App().getObject("ViewManager").getActions('bookmark'): + for act in ericApp().getObject("ViewManager").getActions('bookmark'): __readShortcut(act, "Bookmarks", prefClass) - for act in e5App().getObject("ViewManager").getActions('spelling'): + for act in ericApp().getObject("ViewManager").getActions('spelling'): __readShortcut(act, "Spelling", prefClass) - actions = e5App().getObject("ViewManager").getActions('window') + actions = ericApp().getObject("ViewManager").getActions('window') if actions: for act in actions: __readShortcut(act, "Window", prefClass) - for category, ref in e5App().getPluginObjects(): + for category, ref in ericApp().getPluginObjects(): if hasattr(ref, "getActions"): actions = ref.getActions() for act in actions: @@ -98,7 +98,7 @@ if pluginName is not None: with contextlib.suppress(KeyError): - ref = e5App().getPluginObject(pluginName) + ref = ericApp().getPluginObject(pluginName) if hasattr(ref, "getActions"): actions = ref.getActions() for act in actions: @@ -109,7 +109,7 @@ """ Private function to write a single keyboard shortcut to the settings. - @param act reference to the action object (E5Action) + @param act reference to the action object (EricAction) @param category category the action belongs to (string) @param prefClass preferences class used as the storage area """ @@ -136,45 +136,45 @@ prefClass.settings.endGroup() # step 2: save the various shortcuts - for act in e5App().getObject("Project").getActions(): + for act in ericApp().getObject("Project").getActions(): __saveShortcut(act, "Project", prefClass) - for act in e5App().getObject("UserInterface").getActions('ui'): + for act in ericApp().getObject("UserInterface").getActions('ui'): __saveShortcut(act, "General", prefClass) - for act in e5App().getObject("UserInterface").getActions('wizards'): + for act in ericApp().getObject("UserInterface").getActions('wizards'): __saveShortcut(act, "Wizards", prefClass) - for act in e5App().getObject("DebugUI").getActions(): + for act in ericApp().getObject("DebugUI").getActions(): __saveShortcut(act, "Debug", prefClass) - for act in e5App().getObject("ViewManager").getActions('edit'): + for act in ericApp().getObject("ViewManager").getActions('edit'): __saveShortcut(act, "Edit", prefClass) - for act in e5App().getObject("ViewManager").getActions('file'): + for act in ericApp().getObject("ViewManager").getActions('file'): __saveShortcut(act, "File", prefClass) - for act in e5App().getObject("ViewManager").getActions('search'): + for act in ericApp().getObject("ViewManager").getActions('search'): __saveShortcut(act, "Search", prefClass) - for act in e5App().getObject("ViewManager").getActions('view'): + for act in ericApp().getObject("ViewManager").getActions('view'): __saveShortcut(act, "View", prefClass) - for act in e5App().getObject("ViewManager").getActions('macro'): + for act in ericApp().getObject("ViewManager").getActions('macro'): __saveShortcut(act, "Macro", prefClass) - for act in e5App().getObject("ViewManager").getActions('bookmark'): + for act in ericApp().getObject("ViewManager").getActions('bookmark'): __saveShortcut(act, "Bookmarks", prefClass) - for act in e5App().getObject("ViewManager").getActions('spelling'): + for act in ericApp().getObject("ViewManager").getActions('spelling'): __saveShortcut(act, "Spelling", prefClass) - actions = e5App().getObject("ViewManager").getActions('window') + actions = ericApp().getObject("ViewManager").getActions('window') if actions: for act in actions: __saveShortcut(act, "Window", prefClass) - for category, ref in e5App().getPluginObjects(): + for category, ref in ericApp().getPluginObjects(): if hasattr(ref, "getActions"): actions = ref.getActions() for act in actions: @@ -205,7 +205,7 @@ @type WebBrowserWindow """ # let the plugin manager create on demand plugin objects - pm = e5App().getObject("PluginManager") + pm = ericApp().getObject("PluginManager") pm.initOnDemandPlugins() from .ShortcutsFile import ShortcutsFile @@ -223,7 +223,7 @@ @type WebBrowserWindow """ # let the plugin manager create on demand plugin objects - pm = e5App().getObject("PluginManager") + pm = ericApp().getObject("PluginManager") pm.initOnDemandPlugins() if fn.endswith(".ekj"): @@ -249,7 +249,7 @@ saveShortcuts() syncPreferences() else: - E5MessageBox.critical( + EricMessageBox.critical( None, QCoreApplication.translate( "Shortcuts", "Import Keyboard Shortcuts"), @@ -265,7 +265,7 @@ Private function to set a single keyboard shortcut category shortcuts. @param actions list of actions to set - @type list of E5Action + @type list of EricAction @param shortcutsDict dictionary containing accelerator information for one category @type dict @@ -292,65 +292,65 @@ if helpViewer is None: if "Project" in shortcuts: __setAction( - e5App().getObject("Project").getActions(), + ericApp().getObject("Project").getActions(), shortcuts["Project"]) if "General" in shortcuts: __setAction( - e5App().getObject("UserInterface").getActions('ui'), + ericApp().getObject("UserInterface").getActions('ui'), shortcuts["General"]) if "Wizards" in shortcuts: __setAction( - e5App().getObject("UserInterface").getActions('wizards'), + ericApp().getObject("UserInterface").getActions('wizards'), shortcuts["Wizards"]) if "Debug" in shortcuts: __setAction( - e5App().getObject("DebugUI").getActions(), + ericApp().getObject("DebugUI").getActions(), shortcuts["Debug"]) if "Edit" in shortcuts: __setAction( - e5App().getObject("ViewManager").getActions('edit'), + ericApp().getObject("ViewManager").getActions('edit'), shortcuts["Edit"]) if "File" in shortcuts: __setAction( - e5App().getObject("ViewManager").getActions('file'), + ericApp().getObject("ViewManager").getActions('file'), shortcuts["File"]) if "Search" in shortcuts: __setAction( - e5App().getObject("ViewManager").getActions('search'), + ericApp().getObject("ViewManager").getActions('search'), shortcuts["Search"]) if "View" in shortcuts: __setAction( - e5App().getObject("ViewManager").getActions('view'), + ericApp().getObject("ViewManager").getActions('view'), shortcuts["View"]) if "Macro" in shortcuts: __setAction( - e5App().getObject("ViewManager").getActions('macro'), + ericApp().getObject("ViewManager").getActions('macro'), shortcuts["Macro"]) if "Bookmarks" in shortcuts: __setAction( - e5App().getObject("ViewManager").getActions('bookmark'), + ericApp().getObject("ViewManager").getActions('bookmark'), shortcuts["Bookmarks"]) if "Spelling" in shortcuts: __setAction( - e5App().getObject("ViewManager").getActions('spelling'), + ericApp().getObject("ViewManager").getActions('spelling'), shortcuts["Spelling"]) if "Window" in shortcuts: - actions = e5App().getObject("ViewManager").getActions('window') + actions = ericApp().getObject("ViewManager").getActions('window') if actions: __setAction(actions, shortcuts["Window"]) - for category, ref in e5App().getPluginObjects(): + for category, ref in ericApp().getPluginObjects(): if category in shortcuts and hasattr(ref, "getActions"): actions = ref.getActions() __setAction(actions, shortcuts[category])