|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Project.ProjectResourcesBrowser</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.Project.ProjectResourcesBrowser</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a class used to display the resources part of the project. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#ProjectResourcesBrowser">ProjectResourcesBrowser</a></td> |
|
25 <td>A class used to display the resources part of the project.</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="ProjectResourcesBrowser" ID="ProjectResourcesBrowser"></a> |
|
36 <h2>ProjectResourcesBrowser</h2> |
|
37 |
|
38 <p> |
|
39 A class used to display the resources part of the project. |
|
40 </p> |
|
41 <h3>Signals</h3> |
|
42 <dl> |
|
43 |
|
44 <dt>appendStderr(str)</dt> |
|
45 <dd> |
|
46 emitted after something was received from |
|
47 a QProcess on stderr |
|
48 </dd> |
|
49 <dt>showMenu(str, QMenu)</dt> |
|
50 <dd> |
|
51 emitted when a menu is about to be shown. |
|
52 The name of the menu and a reference to the menu are given. |
|
53 </dd> |
|
54 </dl> |
|
55 <h3>Derived from</h3> |
|
56 ProjectBaseBrowser |
|
57 <h3>Class Attributes</h3> |
|
58 |
|
59 <table> |
|
60 <tr><td>RCFilenameFormatPython</td></tr><tr><td>RCFilenameFormatRuby</td></tr> |
|
61 </table> |
|
62 <h3>Class Methods</h3> |
|
63 |
|
64 <table> |
|
65 <tr><td>None</td></tr> |
|
66 </table> |
|
67 <h3>Methods</h3> |
|
68 |
|
69 <table> |
|
70 |
|
71 <tr> |
|
72 <td><a href="#ProjectResourcesBrowser.__init__">ProjectResourcesBrowser</a></td> |
|
73 <td>Constructor</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#ProjectResourcesBrowser.__addResourceFiles">__addResourceFiles</a></td> |
|
77 <td>Private method to add resource files to the project.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#ProjectResourcesBrowser.__addResourcesDirectory">__addResourcesDirectory</a></td> |
|
81 <td>Private method to add resource files of a directory to the project.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#ProjectResourcesBrowser.__checkResourcesNewer">__checkResourcesNewer</a></td> |
|
85 <td>Private method to check, if any file referenced in a resource file is newer than a given time.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#ProjectResourcesBrowser.__compileAllResources">__compileAllResources</a></td> |
|
89 <td>Private method to compile all resources to source files.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#ProjectResourcesBrowser.__compileQRC">__compileQRC</a></td> |
|
93 <td>Private method to compile a .qrc file to a .py file.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#ProjectResourcesBrowser.__compileQRCDone">__compileQRCDone</a></td> |
|
97 <td>Private slot to handle the finished signal of the compile process.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#ProjectResourcesBrowser.__compileResource">__compileResource</a></td> |
|
101 <td>Private method to compile a resource to a source file.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#ProjectResourcesBrowser.__compileSelectedResources">__compileSelectedResources</a></td> |
|
105 <td>Private method to compile selected resources to source files.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#ProjectResourcesBrowser.__configureRccCompiler">__configureRccCompiler</a></td> |
|
109 <td>Private slot to configure some non-common rcc compiler options.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#ProjectResourcesBrowser.__deleteFile">__deleteFile</a></td> |
|
113 <td>Private method to delete a resource file from the project.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#ProjectResourcesBrowser.__newResource">__newResource</a></td> |
|
117 <td>Private slot to handle the New Resource menu action.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#ProjectResourcesBrowser.__openFile">__openFile</a></td> |
|
121 <td>Private slot to handle the Open menu action.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#ProjectResourcesBrowser.__readStderr">__readStderr</a></td> |
|
125 <td>Private slot to handle the readyReadStandardError signal of the pyrcc5/pyside2-rcc/pyside6-rcc process.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#ProjectResourcesBrowser.__readStdout">__readStdout</a></td> |
|
129 <td>Private slot to handle the readyReadStandardOutput signal of the pyrcc5/pyside2-rcc/pyside6-rcc process.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#ProjectResourcesBrowser.__showContextMenu">__showContextMenu</a></td> |
|
133 <td>Private slot called by the menu aboutToShow signal.</td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td><a href="#ProjectResourcesBrowser.__showContextMenuBack">__showContextMenuBack</a></td> |
|
137 <td>Private slot called by the backMenu aboutToShow signal.</td> |
|
138 </tr> |
|
139 <tr> |
|
140 <td><a href="#ProjectResourcesBrowser.__showContextMenuDir">__showContextMenuDir</a></td> |
|
141 <td>Private slot called by the dirMenu aboutToShow signal.</td> |
|
142 </tr> |
|
143 <tr> |
|
144 <td><a href="#ProjectResourcesBrowser.__showContextMenuDirMulti">__showContextMenuDirMulti</a></td> |
|
145 <td>Private slot called by the dirMultiMenu aboutToShow signal.</td> |
|
146 </tr> |
|
147 <tr> |
|
148 <td><a href="#ProjectResourcesBrowser.__showContextMenuMulti">__showContextMenuMulti</a></td> |
|
149 <td>Private slot called by the multiMenu aboutToShow signal.</td> |
|
150 </tr> |
|
151 <tr> |
|
152 <td><a href="#ProjectResourcesBrowser._contextMenuRequested">_contextMenuRequested</a></td> |
|
153 <td>Protected slot to show the context menu.</td> |
|
154 </tr> |
|
155 <tr> |
|
156 <td><a href="#ProjectResourcesBrowser._createPopupMenus">_createPopupMenus</a></td> |
|
157 <td>Protected overloaded method to generate the popup menu.</td> |
|
158 </tr> |
|
159 <tr> |
|
160 <td><a href="#ProjectResourcesBrowser._initHookMethods">_initHookMethods</a></td> |
|
161 <td>Protected method to initialize the hooks dictionary.</td> |
|
162 </tr> |
|
163 <tr> |
|
164 <td><a href="#ProjectResourcesBrowser._openItem">_openItem</a></td> |
|
165 <td>Protected slot to handle the open popup menu entry.</td> |
|
166 </tr> |
|
167 <tr> |
|
168 <td><a href="#ProjectResourcesBrowser.compileChangedResources">compileChangedResources</a></td> |
|
169 <td>Public method to compile all changed resources to source files.</td> |
|
170 </tr> |
|
171 <tr> |
|
172 <td><a href="#ProjectResourcesBrowser.handlePreferencesChanged">handlePreferencesChanged</a></td> |
|
173 <td>Public slot used to handle the preferencesChanged signal.</td> |
|
174 </tr> |
|
175 </table> |
|
176 <h3>Static Methods</h3> |
|
177 |
|
178 <table> |
|
179 <tr><td>None</td></tr> |
|
180 </table> |
|
181 |
|
182 <a NAME="ProjectResourcesBrowser.__init__" ID="ProjectResourcesBrowser.__init__"></a> |
|
183 <h4>ProjectResourcesBrowser (Constructor)</h4> |
|
184 <b>ProjectResourcesBrowser</b>(<i>project, parent=None</i>) |
|
185 |
|
186 <p> |
|
187 Constructor |
|
188 </p> |
|
189 <dl> |
|
190 |
|
191 <dt><i>project</i></dt> |
|
192 <dd> |
|
193 reference to the project object |
|
194 </dd> |
|
195 <dt><i>parent</i></dt> |
|
196 <dd> |
|
197 parent widget of this browser (QWidget) |
|
198 </dd> |
|
199 </dl> |
|
200 <a NAME="ProjectResourcesBrowser.__addResourceFiles" ID="ProjectResourcesBrowser.__addResourceFiles"></a> |
|
201 <h4>ProjectResourcesBrowser.__addResourceFiles</h4> |
|
202 <b>__addResourceFiles</b>(<i></i>) |
|
203 |
|
204 <p> |
|
205 Private method to add resource files to the project. |
|
206 </p> |
|
207 <a NAME="ProjectResourcesBrowser.__addResourcesDirectory" ID="ProjectResourcesBrowser.__addResourcesDirectory"></a> |
|
208 <h4>ProjectResourcesBrowser.__addResourcesDirectory</h4> |
|
209 <b>__addResourcesDirectory</b>(<i></i>) |
|
210 |
|
211 <p> |
|
212 Private method to add resource files of a directory to the project. |
|
213 </p> |
|
214 <a NAME="ProjectResourcesBrowser.__checkResourcesNewer" ID="ProjectResourcesBrowser.__checkResourcesNewer"></a> |
|
215 <h4>ProjectResourcesBrowser.__checkResourcesNewer</h4> |
|
216 <b>__checkResourcesNewer</b>(<i>filename, mtime</i>) |
|
217 |
|
218 <p> |
|
219 Private method to check, if any file referenced in a resource |
|
220 file is newer than a given time. |
|
221 </p> |
|
222 <dl> |
|
223 |
|
224 <dt><i>filename</i></dt> |
|
225 <dd> |
|
226 filename of the resource file (string) |
|
227 </dd> |
|
228 <dt><i>mtime</i></dt> |
|
229 <dd> |
|
230 modification time to check against |
|
231 </dd> |
|
232 </dl> |
|
233 <dl> |
|
234 <dt>Return:</dt> |
|
235 <dd> |
|
236 flag indicating some file is newer (boolean) |
|
237 </dd> |
|
238 </dl> |
|
239 <a NAME="ProjectResourcesBrowser.__compileAllResources" ID="ProjectResourcesBrowser.__compileAllResources"></a> |
|
240 <h4>ProjectResourcesBrowser.__compileAllResources</h4> |
|
241 <b>__compileAllResources</b>(<i></i>) |
|
242 |
|
243 <p> |
|
244 Private method to compile all resources to source files. |
|
245 </p> |
|
246 <a NAME="ProjectResourcesBrowser.__compileQRC" ID="ProjectResourcesBrowser.__compileQRC"></a> |
|
247 <h4>ProjectResourcesBrowser.__compileQRC</h4> |
|
248 <b>__compileQRC</b>(<i>fn, noDialog=False, progress=None</i>) |
|
249 |
|
250 <p> |
|
251 Private method to compile a .qrc file to a .py file. |
|
252 </p> |
|
253 <dl> |
|
254 |
|
255 <dt><i>fn</i></dt> |
|
256 <dd> |
|
257 filename of the .ui file to be compiled |
|
258 </dd> |
|
259 <dt><i>noDialog</i></dt> |
|
260 <dd> |
|
261 flag indicating silent operations |
|
262 </dd> |
|
263 <dt><i>progress</i></dt> |
|
264 <dd> |
|
265 reference to the progress dialog |
|
266 </dd> |
|
267 </dl> |
|
268 <dl> |
|
269 <dt>Return:</dt> |
|
270 <dd> |
|
271 reference to the compile process (QProcess) |
|
272 </dd> |
|
273 </dl> |
|
274 <a NAME="ProjectResourcesBrowser.__compileQRCDone" ID="ProjectResourcesBrowser.__compileQRCDone"></a> |
|
275 <h4>ProjectResourcesBrowser.__compileQRCDone</h4> |
|
276 <b>__compileQRCDone</b>(<i>exitCode, exitStatus</i>) |
|
277 |
|
278 <p> |
|
279 Private slot to handle the finished signal of the compile process. |
|
280 </p> |
|
281 <dl> |
|
282 |
|
283 <dt><i>exitCode</i></dt> |
|
284 <dd> |
|
285 exit code of the process (integer) |
|
286 </dd> |
|
287 <dt><i>exitStatus</i></dt> |
|
288 <dd> |
|
289 exit status of the process (QProcess.ExitStatus) |
|
290 </dd> |
|
291 </dl> |
|
292 <a NAME="ProjectResourcesBrowser.__compileResource" ID="ProjectResourcesBrowser.__compileResource"></a> |
|
293 <h4>ProjectResourcesBrowser.__compileResource</h4> |
|
294 <b>__compileResource</b>(<i></i>) |
|
295 |
|
296 <p> |
|
297 Private method to compile a resource to a source file. |
|
298 </p> |
|
299 <a NAME="ProjectResourcesBrowser.__compileSelectedResources" ID="ProjectResourcesBrowser.__compileSelectedResources"></a> |
|
300 <h4>ProjectResourcesBrowser.__compileSelectedResources</h4> |
|
301 <b>__compileSelectedResources</b>(<i></i>) |
|
302 |
|
303 <p> |
|
304 Private method to compile selected resources to source files. |
|
305 </p> |
|
306 <a NAME="ProjectResourcesBrowser.__configureRccCompiler" ID="ProjectResourcesBrowser.__configureRccCompiler"></a> |
|
307 <h4>ProjectResourcesBrowser.__configureRccCompiler</h4> |
|
308 <b>__configureRccCompiler</b>(<i></i>) |
|
309 |
|
310 <p> |
|
311 Private slot to configure some non-common rcc compiler options. |
|
312 </p> |
|
313 <a NAME="ProjectResourcesBrowser.__deleteFile" ID="ProjectResourcesBrowser.__deleteFile"></a> |
|
314 <h4>ProjectResourcesBrowser.__deleteFile</h4> |
|
315 <b>__deleteFile</b>(<i></i>) |
|
316 |
|
317 <p> |
|
318 Private method to delete a resource file from the project. |
|
319 </p> |
|
320 <a NAME="ProjectResourcesBrowser.__newResource" ID="ProjectResourcesBrowser.__newResource"></a> |
|
321 <h4>ProjectResourcesBrowser.__newResource</h4> |
|
322 <b>__newResource</b>(<i></i>) |
|
323 |
|
324 <p> |
|
325 Private slot to handle the New Resource menu action. |
|
326 </p> |
|
327 <a NAME="ProjectResourcesBrowser.__openFile" ID="ProjectResourcesBrowser.__openFile"></a> |
|
328 <h4>ProjectResourcesBrowser.__openFile</h4> |
|
329 <b>__openFile</b>(<i></i>) |
|
330 |
|
331 <p> |
|
332 Private slot to handle the Open menu action. |
|
333 </p> |
|
334 <a NAME="ProjectResourcesBrowser.__readStderr" ID="ProjectResourcesBrowser.__readStderr"></a> |
|
335 <h4>ProjectResourcesBrowser.__readStderr</h4> |
|
336 <b>__readStderr</b>(<i></i>) |
|
337 |
|
338 <p> |
|
339 Private slot to handle the readyReadStandardError signal of the |
|
340 pyrcc5/pyside2-rcc/pyside6-rcc process. |
|
341 </p> |
|
342 <a NAME="ProjectResourcesBrowser.__readStdout" ID="ProjectResourcesBrowser.__readStdout"></a> |
|
343 <h4>ProjectResourcesBrowser.__readStdout</h4> |
|
344 <b>__readStdout</b>(<i></i>) |
|
345 |
|
346 <p> |
|
347 Private slot to handle the readyReadStandardOutput signal of the |
|
348 pyrcc5/pyside2-rcc/pyside6-rcc process. |
|
349 </p> |
|
350 <a NAME="ProjectResourcesBrowser.__showContextMenu" ID="ProjectResourcesBrowser.__showContextMenu"></a> |
|
351 <h4>ProjectResourcesBrowser.__showContextMenu</h4> |
|
352 <b>__showContextMenu</b>(<i></i>) |
|
353 |
|
354 <p> |
|
355 Private slot called by the menu aboutToShow signal. |
|
356 </p> |
|
357 <a NAME="ProjectResourcesBrowser.__showContextMenuBack" ID="ProjectResourcesBrowser.__showContextMenuBack"></a> |
|
358 <h4>ProjectResourcesBrowser.__showContextMenuBack</h4> |
|
359 <b>__showContextMenuBack</b>(<i></i>) |
|
360 |
|
361 <p> |
|
362 Private slot called by the backMenu aboutToShow signal. |
|
363 </p> |
|
364 <a NAME="ProjectResourcesBrowser.__showContextMenuDir" ID="ProjectResourcesBrowser.__showContextMenuDir"></a> |
|
365 <h4>ProjectResourcesBrowser.__showContextMenuDir</h4> |
|
366 <b>__showContextMenuDir</b>(<i></i>) |
|
367 |
|
368 <p> |
|
369 Private slot called by the dirMenu aboutToShow signal. |
|
370 </p> |
|
371 <a NAME="ProjectResourcesBrowser.__showContextMenuDirMulti" ID="ProjectResourcesBrowser.__showContextMenuDirMulti"></a> |
|
372 <h4>ProjectResourcesBrowser.__showContextMenuDirMulti</h4> |
|
373 <b>__showContextMenuDirMulti</b>(<i></i>) |
|
374 |
|
375 <p> |
|
376 Private slot called by the dirMultiMenu aboutToShow signal. |
|
377 </p> |
|
378 <a NAME="ProjectResourcesBrowser.__showContextMenuMulti" ID="ProjectResourcesBrowser.__showContextMenuMulti"></a> |
|
379 <h4>ProjectResourcesBrowser.__showContextMenuMulti</h4> |
|
380 <b>__showContextMenuMulti</b>(<i></i>) |
|
381 |
|
382 <p> |
|
383 Private slot called by the multiMenu aboutToShow signal. |
|
384 </p> |
|
385 <a NAME="ProjectResourcesBrowser._contextMenuRequested" ID="ProjectResourcesBrowser._contextMenuRequested"></a> |
|
386 <h4>ProjectResourcesBrowser._contextMenuRequested</h4> |
|
387 <b>_contextMenuRequested</b>(<i>coord</i>) |
|
388 |
|
389 <p> |
|
390 Protected slot to show the context menu. |
|
391 </p> |
|
392 <dl> |
|
393 |
|
394 <dt><i>coord</i></dt> |
|
395 <dd> |
|
396 the position of the mouse pointer (QPoint) |
|
397 </dd> |
|
398 </dl> |
|
399 <a NAME="ProjectResourcesBrowser._createPopupMenus" ID="ProjectResourcesBrowser._createPopupMenus"></a> |
|
400 <h4>ProjectResourcesBrowser._createPopupMenus</h4> |
|
401 <b>_createPopupMenus</b>(<i></i>) |
|
402 |
|
403 <p> |
|
404 Protected overloaded method to generate the popup menu. |
|
405 </p> |
|
406 <a NAME="ProjectResourcesBrowser._initHookMethods" ID="ProjectResourcesBrowser._initHookMethods"></a> |
|
407 <h4>ProjectResourcesBrowser._initHookMethods</h4> |
|
408 <b>_initHookMethods</b>(<i></i>) |
|
409 |
|
410 <p> |
|
411 Protected method to initialize the hooks dictionary. |
|
412 </p> |
|
413 <p> |
|
414 Supported hook methods are: |
|
415 <ul> |
|
416 <li>compileResource: takes filename as parameter</li> |
|
417 <li>compileAllResources: takes list of filenames as parameter</li> |
|
418 <li>compileChangedResources: takes list of filenames as parameter</li> |
|
419 <li>compileSelectedResources: takes list of all form filenames as |
|
420 parameter</li> |
|
421 <li>newResource: takes full directory path of new file as |
|
422 parameter</li> |
|
423 </ul> |
|
424 </p> |
|
425 <p> |
|
426 <b>Note</b>: Filenames are relative to the project directory, if not |
|
427 specified differently. |
|
428 </p> |
|
429 <a NAME="ProjectResourcesBrowser._openItem" ID="ProjectResourcesBrowser._openItem"></a> |
|
430 <h4>ProjectResourcesBrowser._openItem</h4> |
|
431 <b>_openItem</b>(<i></i>) |
|
432 |
|
433 <p> |
|
434 Protected slot to handle the open popup menu entry. |
|
435 </p> |
|
436 <a NAME="ProjectResourcesBrowser.compileChangedResources" ID="ProjectResourcesBrowser.compileChangedResources"></a> |
|
437 <h4>ProjectResourcesBrowser.compileChangedResources</h4> |
|
438 <b>compileChangedResources</b>(<i></i>) |
|
439 |
|
440 <p> |
|
441 Public method to compile all changed resources to source files. |
|
442 </p> |
|
443 <a NAME="ProjectResourcesBrowser.handlePreferencesChanged" ID="ProjectResourcesBrowser.handlePreferencesChanged"></a> |
|
444 <h4>ProjectResourcesBrowser.handlePreferencesChanged</h4> |
|
445 <b>handlePreferencesChanged</b>(<i></i>) |
|
446 |
|
447 <p> |
|
448 Public slot used to handle the preferencesChanged signal. |
|
449 </p> |
|
450 <div align="right"><a href="#top">Up</a></div> |
|
451 <hr /> |
|
452 </body></html> |