24 |
24 |
25 class ShortcutsFile(QObject): |
25 class ShortcutsFile(QObject): |
26 """ |
26 """ |
27 Class representing the shortcuts JSON file. |
27 Class representing the shortcuts JSON file. |
28 """ |
28 """ |
29 def __init__(self, parent: QObject = None): |
29 def __init__(self: "ShortcutsFile", parent: QObject = None) -> None: |
30 """ |
30 """ |
31 Constructor |
31 Constructor |
32 |
32 |
33 @param parent reference to the parent object (defaults to None) |
33 @param parent reference to the parent object (defaults to None) |
34 @type QObject (optional) |
34 @type QObject (optional) |
35 """ |
35 """ |
36 super().__init__(parent) |
36 super().__init__(parent) |
37 |
37 |
38 def __addActionsToDict(self, category: str, actions: list, |
38 def __addActionsToDict(self: "ShortcutsFile", category: str, actions: list, |
39 actionsDict: dict): |
39 actionsDict: dict) -> None: |
40 """ |
40 """ |
41 Private method to add a list of actions to the actions dictionary. |
41 Private method to add a list of actions to the actions dictionary. |
42 |
42 |
43 @param category category of the actions |
43 @param category category of the actions |
44 @type str |
44 @type str |
56 actionsDict[category][act.objectName()] = ( |
56 actionsDict[category][act.objectName()] = ( |
57 act.shortcut().toString(), |
57 act.shortcut().toString(), |
58 act.alternateShortcut().toString() |
58 act.alternateShortcut().toString() |
59 ) |
59 ) |
60 |
60 |
61 def writeFile(self, filename: str, helpViewer: HelpViewer = None) -> bool: |
61 def writeFile(self: "ShortcutsFile", filename: str, |
|
62 helpViewer: HelpViewer = None) -> bool: |
62 """ |
63 """ |
63 Public method to write the shortcuts data to a shortcuts JSON file. |
64 Public method to write the shortcuts data to a shortcuts JSON file. |
64 |
65 |
65 @param filename name of the shortcuts file |
66 @param filename name of the shortcuts file |
66 @type str |
67 @type str |