|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Preferences.ShortcutsFile</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.Preferences.ShortcutsFile</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a class representing the shortcuts JSON file. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>HelpViewer</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#ShortcutsFile">ShortcutsFile</a></td> |
|
25 <td>Class representing the shortcuts JSON file.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="ShortcutsFile" ID="ShortcutsFile"></a> |
|
36 <h2>ShortcutsFile</h2> |
|
37 |
|
38 <p> |
|
39 Class representing the shortcuts JSON file. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 QObject |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#ShortcutsFile.__init__">ShortcutsFile</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#ShortcutsFile.__addActionsToDict">__addActionsToDict</a></td> |
|
63 <td>Private method to add a list of actions to the actions dictionary.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#ShortcutsFile.readFile">readFile</a></td> |
|
67 <td>Public method to read the shortcuts data from a shortcuts JSON file.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#ShortcutsFile.writeFile">writeFile</a></td> |
|
71 <td>Public method to write the shortcuts data to a shortcuts JSON file.</td> |
|
72 </tr> |
|
73 </table> |
|
74 <h3>Static Methods</h3> |
|
75 |
|
76 <table> |
|
77 <tr><td>None</td></tr> |
|
78 </table> |
|
79 |
|
80 <a NAME="ShortcutsFile.__init__" ID="ShortcutsFile.__init__"></a> |
|
81 <h4>ShortcutsFile (Constructor)</h4> |
|
82 <b>ShortcutsFile</b>(<i>parent: QObject = None</i>) |
|
83 |
|
84 <p> |
|
85 Constructor |
|
86 </p> |
|
87 <dl> |
|
88 |
|
89 <dt><i>parent</i> (QObject (optional))</dt> |
|
90 <dd> |
|
91 reference to the parent object (defaults to None) |
|
92 </dd> |
|
93 </dl> |
|
94 <a NAME="ShortcutsFile.__addActionsToDict" ID="ShortcutsFile.__addActionsToDict"></a> |
|
95 <h4>ShortcutsFile.__addActionsToDict</h4> |
|
96 <b>__addActionsToDict</b>(<i>category: str, actions: list, actionsDict: dict</i>) |
|
97 |
|
98 <p> |
|
99 Private method to add a list of actions to the actions dictionary. |
|
100 </p> |
|
101 <dl> |
|
102 |
|
103 <dt><i>category</i> (str)</dt> |
|
104 <dd> |
|
105 category of the actions |
|
106 </dd> |
|
107 <dt><i>actions</i> (list of QAction)</dt> |
|
108 <dd> |
|
109 list of actions |
|
110 </dd> |
|
111 <dt><i>actionsDict</i> (dict)</dt> |
|
112 <dd> |
|
113 reference to the actions dictionary to be modified |
|
114 </dd> |
|
115 </dl> |
|
116 <a NAME="ShortcutsFile.readFile" ID="ShortcutsFile.readFile"></a> |
|
117 <h4>ShortcutsFile.readFile</h4> |
|
118 <b>readFile</b>(<i>filename: str</i>) |
|
119 |
|
120 <p> |
|
121 Public method to read the shortcuts data from a shortcuts JSON file. |
|
122 </p> |
|
123 <dl> |
|
124 |
|
125 <dt><i>filename</i> (str)</dt> |
|
126 <dd> |
|
127 name of the shortcuts file |
|
128 </dd> |
|
129 </dl> |
|
130 <dl> |
|
131 <dt>Return:</dt> |
|
132 <dd> |
|
133 Dictionary of dictionaries of shortcuts. The keys of the |
|
134 dictionary are the shortcuts categories, the values are |
|
135 dictionaries. These dictionaries have the shortcut name as their |
|
136 key and a tuple of accelerators as their value. |
|
137 </dd> |
|
138 </dl> |
|
139 <dl> |
|
140 <dt>Return Type:</dt> |
|
141 <dd> |
|
142 dict |
|
143 </dd> |
|
144 </dl> |
|
145 <a NAME="ShortcutsFile.writeFile" ID="ShortcutsFile.writeFile"></a> |
|
146 <h4>ShortcutsFile.writeFile</h4> |
|
147 <b>writeFile</b>(<i>filename: str, helpViewer: HelpViewer = None</i>) |
|
148 |
|
149 <p> |
|
150 Public method to write the shortcuts data to a shortcuts JSON file. |
|
151 </p> |
|
152 <dl> |
|
153 |
|
154 <dt><i>filename</i> (str)</dt> |
|
155 <dd> |
|
156 name of the shortcuts file |
|
157 </dd> |
|
158 <dt><i>helpViewer</i> (WebBrowserWindow)</dt> |
|
159 <dd> |
|
160 reference to the help window object |
|
161 </dd> |
|
162 </dl> |
|
163 <dl> |
|
164 <dt>Return:</dt> |
|
165 <dd> |
|
166 flag indicating a successful write |
|
167 </dd> |
|
168 </dl> |
|
169 <dl> |
|
170 <dt>Return Type:</dt> |
|
171 <dd> |
|
172 bool |
|
173 </dd> |
|
174 </dl> |
|
175 <div align="right"><a href="#top">Up</a></div> |
|
176 <hr /> |
|
177 </body></html> |