|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric5.Project.ProjectResourcesBrowser</title> |
|
6 <style> |
|
7 b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' |
|
8 </style> |
|
9 </head> |
|
10 <body><a NAME="top" ID="top"></a> |
|
11 <h1>eric5.Project.ProjectResourcesBrowser</h1> |
|
12 <p> |
|
13 Module implementing a class used to display the resources part of the project. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#ProjectResourcesBrowser">ProjectResourcesBrowser</a></td> |
|
23 <td>A class used to display the resources part of the project.</td> |
|
24 </tr> |
|
25 </table> |
|
26 <h3>Functions</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <hr /><hr /> |
|
31 <a NAME="ProjectResourcesBrowser" ID="ProjectResourcesBrowser"></a> |
|
32 <h2>ProjectResourcesBrowser</h2> |
|
33 <p> |
|
34 A class used to display the resources part of the project. |
|
35 </p><h4>Signals</h4> |
|
36 <dl> |
|
37 <dt>appendStderr(string)</dt> |
|
38 <dd> |
|
39 emitted after something was received from |
|
40 a QProcess on stderr |
|
41 </dd><dt>closeSourceWindow(string)</dt> |
|
42 <dd> |
|
43 emitted after a file has been removed/deleted |
|
44 from the project |
|
45 </dd><dt>showMenu(string, QMenu)</dt> |
|
46 <dd> |
|
47 emitted when a menu is about to be shown. The name |
|
48 of the menu and a reference to the menu are given. |
|
49 </dd><dt>sourceFile(string)</dt> |
|
50 <dd> |
|
51 emitted to open a resources file in an editor |
|
52 </dd> |
|
53 </dl> |
|
54 <h3>Derived from</h3> |
|
55 ProjectBaseBrowser |
|
56 <h3>Class Attributes</h3> |
|
57 <table> |
|
58 <tr><td>RCFilenameFormatPython</td></tr><tr><td>RCFilenameFormatRuby</td></tr> |
|
59 </table> |
|
60 <h3>Methods</h3> |
|
61 <table> |
|
62 <tr> |
|
63 <td><a href="#ProjectResourcesBrowser.__init__">ProjectResourcesBrowser</a></td> |
|
64 <td>Constructor</td> |
|
65 </tr><tr> |
|
66 <td><a href="#ProjectResourcesBrowser.__addResourceFiles">__addResourceFiles</a></td> |
|
67 <td>Private method to add resource files to the project.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#ProjectResourcesBrowser.__addResourcesDirectory">__addResourcesDirectory</a></td> |
|
70 <td>Private method to add resource files of a directory to the project.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#ProjectResourcesBrowser.__checkResourcesNewer">__checkResourcesNewer</a></td> |
|
73 <td>Private method to check, if any file referenced in a resource file is newer than a given time.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#ProjectResourcesBrowser.__compileAllResources">__compileAllResources</a></td> |
|
76 <td>Private method to compile all resources to source files.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#ProjectResourcesBrowser.__compileQRC">__compileQRC</a></td> |
|
79 <td>Privat method to compile a .qrc file to a .py file.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#ProjectResourcesBrowser.__compileQRCDone">__compileQRCDone</a></td> |
|
82 <td>Private slot to handle the finished signal of the compile process.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#ProjectResourcesBrowser.__compileResource">__compileResource</a></td> |
|
85 <td>Private method to compile a resource to a source file.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#ProjectResourcesBrowser.__compileSelectedResources">__compileSelectedResources</a></td> |
|
88 <td>Private method to compile selected resources to source files.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#ProjectResourcesBrowser.__deleteFile">__deleteFile</a></td> |
|
91 <td>Private method to delete a resource file from the project.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#ProjectResourcesBrowser.__newResource">__newResource</a></td> |
|
94 <td>Private slot to handle the New Resource menu action.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#ProjectResourcesBrowser.__openFile">__openFile</a></td> |
|
97 <td>Private slot to handle the Open menu action.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#ProjectResourcesBrowser.__readStderr">__readStderr</a></td> |
|
100 <td>Private slot to handle the readyReadStandardError signal of the pyrcc4/rbrcc process.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#ProjectResourcesBrowser.__readStdout">__readStdout</a></td> |
|
103 <td>Private slot to handle the readyReadStandardOutput signal of the pyrcc4/rbrcc process.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#ProjectResourcesBrowser.__showContextMenu">__showContextMenu</a></td> |
|
106 <td>Private slot called by the menu aboutToShow signal.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#ProjectResourcesBrowser.__showContextMenuBack">__showContextMenuBack</a></td> |
|
109 <td>Private slot called by the backMenu aboutToShow signal.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#ProjectResourcesBrowser.__showContextMenuDir">__showContextMenuDir</a></td> |
|
112 <td>Private slot called by the dirMenu aboutToShow signal.</td> |
|
113 </tr><tr> |
|
114 <td><a href="#ProjectResourcesBrowser.__showContextMenuDirMulti">__showContextMenuDirMulti</a></td> |
|
115 <td>Private slot called by the dirMultiMenu aboutToShow signal.</td> |
|
116 </tr><tr> |
|
117 <td><a href="#ProjectResourcesBrowser.__showContextMenuMulti">__showContextMenuMulti</a></td> |
|
118 <td>Private slot called by the multiMenu aboutToShow signal.</td> |
|
119 </tr><tr> |
|
120 <td><a href="#ProjectResourcesBrowser._contextMenuRequested">_contextMenuRequested</a></td> |
|
121 <td>Protected slot to show the context menu.</td> |
|
122 </tr><tr> |
|
123 <td><a href="#ProjectResourcesBrowser._createPopupMenus">_createPopupMenus</a></td> |
|
124 <td>Protected overloaded method to generate the popup menu.</td> |
|
125 </tr><tr> |
|
126 <td><a href="#ProjectResourcesBrowser._initHookMethods">_initHookMethods</a></td> |
|
127 <td>Protected method to initialize the hooks dictionary.</td> |
|
128 </tr><tr> |
|
129 <td><a href="#ProjectResourcesBrowser._openItem">_openItem</a></td> |
|
130 <td>Protected slot to handle the open popup menu entry.</td> |
|
131 </tr><tr> |
|
132 <td><a href="#ProjectResourcesBrowser.compileChangedResources">compileChangedResources</a></td> |
|
133 <td>Public method to compile all changed resources to source files.</td> |
|
134 </tr><tr> |
|
135 <td><a href="#ProjectResourcesBrowser.handlePreferencesChanged">handlePreferencesChanged</a></td> |
|
136 <td>Public slot used to handle the preferencesChanged signal.</td> |
|
137 </tr> |
|
138 </table> |
|
139 <a NAME="ProjectResourcesBrowser.__init__" ID="ProjectResourcesBrowser.__init__"></a> |
|
140 <h4>ProjectResourcesBrowser (Constructor)</h4> |
|
141 <b>ProjectResourcesBrowser</b>(<i>project, parent = None</i>) |
|
142 <p> |
|
143 Constructor |
|
144 </p><dl> |
|
145 <dt><i>project</i></dt> |
|
146 <dd> |
|
147 reference to the project object |
|
148 </dd><dt><i>parent</i></dt> |
|
149 <dd> |
|
150 parent widget of this browser (QWidget) |
|
151 </dd> |
|
152 </dl><a NAME="ProjectResourcesBrowser.__addResourceFiles" ID="ProjectResourcesBrowser.__addResourceFiles"></a> |
|
153 <h4>ProjectResourcesBrowser.__addResourceFiles</h4> |
|
154 <b>__addResourceFiles</b>(<i></i>) |
|
155 <p> |
|
156 Private method to add resource files to the project. |
|
157 </p><a NAME="ProjectResourcesBrowser.__addResourcesDirectory" ID="ProjectResourcesBrowser.__addResourcesDirectory"></a> |
|
158 <h4>ProjectResourcesBrowser.__addResourcesDirectory</h4> |
|
159 <b>__addResourcesDirectory</b>(<i></i>) |
|
160 <p> |
|
161 Private method to add resource files of a directory to the project. |
|
162 </p><a NAME="ProjectResourcesBrowser.__checkResourcesNewer" ID="ProjectResourcesBrowser.__checkResourcesNewer"></a> |
|
163 <h4>ProjectResourcesBrowser.__checkResourcesNewer</h4> |
|
164 <b>__checkResourcesNewer</b>(<i>filename, mtime</i>) |
|
165 <p> |
|
166 Private method to check, if any file referenced in a resource |
|
167 file is newer than a given time. |
|
168 </p><dl> |
|
169 <dt><i>filename</i></dt> |
|
170 <dd> |
|
171 filename of the resource file (string) |
|
172 </dd><dt><i>mtime</i></dt> |
|
173 <dd> |
|
174 modification time to check against |
|
175 </dd> |
|
176 </dl><dl> |
|
177 <dt>Returns:</dt> |
|
178 <dd> |
|
179 flag indicating some file is newer (boolean) |
|
180 </dd> |
|
181 </dl><a NAME="ProjectResourcesBrowser.__compileAllResources" ID="ProjectResourcesBrowser.__compileAllResources"></a> |
|
182 <h4>ProjectResourcesBrowser.__compileAllResources</h4> |
|
183 <b>__compileAllResources</b>(<i></i>) |
|
184 <p> |
|
185 Private method to compile all resources to source files. |
|
186 </p><a NAME="ProjectResourcesBrowser.__compileQRC" ID="ProjectResourcesBrowser.__compileQRC"></a> |
|
187 <h4>ProjectResourcesBrowser.__compileQRC</h4> |
|
188 <b>__compileQRC</b>(<i>fn, noDialog = False, progress = None</i>) |
|
189 <p> |
|
190 Privat method to compile a .qrc file to a .py file. |
|
191 </p><dl> |
|
192 <dt><i>fn</i></dt> |
|
193 <dd> |
|
194 filename of the .ui file to be compiled |
|
195 </dd><dt><i>noDialog</i></dt> |
|
196 <dd> |
|
197 flag indicating silent operations |
|
198 </dd><dt><i>progress</i></dt> |
|
199 <dd> |
|
200 reference to the progress dialog |
|
201 </dd> |
|
202 </dl><dl> |
|
203 <dt>Returns:</dt> |
|
204 <dd> |
|
205 reference to the compile process (QProcess) |
|
206 </dd> |
|
207 </dl><a NAME="ProjectResourcesBrowser.__compileQRCDone" ID="ProjectResourcesBrowser.__compileQRCDone"></a> |
|
208 <h4>ProjectResourcesBrowser.__compileQRCDone</h4> |
|
209 <b>__compileQRCDone</b>(<i>exitCode, exitStatus</i>) |
|
210 <p> |
|
211 Private slot to handle the finished signal of the compile process. |
|
212 </p><dl> |
|
213 <dt><i>exitCode</i></dt> |
|
214 <dd> |
|
215 exit code of the process (integer) |
|
216 </dd><dt><i>exitStatus</i></dt> |
|
217 <dd> |
|
218 exit status of the process (QProcess.ExitStatus) |
|
219 </dd> |
|
220 </dl><a NAME="ProjectResourcesBrowser.__compileResource" ID="ProjectResourcesBrowser.__compileResource"></a> |
|
221 <h4>ProjectResourcesBrowser.__compileResource</h4> |
|
222 <b>__compileResource</b>(<i></i>) |
|
223 <p> |
|
224 Private method to compile a resource to a source file. |
|
225 </p><a NAME="ProjectResourcesBrowser.__compileSelectedResources" ID="ProjectResourcesBrowser.__compileSelectedResources"></a> |
|
226 <h4>ProjectResourcesBrowser.__compileSelectedResources</h4> |
|
227 <b>__compileSelectedResources</b>(<i></i>) |
|
228 <p> |
|
229 Private method to compile selected resources to source files. |
|
230 </p><a NAME="ProjectResourcesBrowser.__deleteFile" ID="ProjectResourcesBrowser.__deleteFile"></a> |
|
231 <h4>ProjectResourcesBrowser.__deleteFile</h4> |
|
232 <b>__deleteFile</b>(<i></i>) |
|
233 <p> |
|
234 Private method to delete a resource file from the project. |
|
235 </p><a NAME="ProjectResourcesBrowser.__newResource" ID="ProjectResourcesBrowser.__newResource"></a> |
|
236 <h4>ProjectResourcesBrowser.__newResource</h4> |
|
237 <b>__newResource</b>(<i></i>) |
|
238 <p> |
|
239 Private slot to handle the New Resource menu action. |
|
240 </p><a NAME="ProjectResourcesBrowser.__openFile" ID="ProjectResourcesBrowser.__openFile"></a> |
|
241 <h4>ProjectResourcesBrowser.__openFile</h4> |
|
242 <b>__openFile</b>(<i></i>) |
|
243 <p> |
|
244 Private slot to handle the Open menu action. |
|
245 </p><a NAME="ProjectResourcesBrowser.__readStderr" ID="ProjectResourcesBrowser.__readStderr"></a> |
|
246 <h4>ProjectResourcesBrowser.__readStderr</h4> |
|
247 <b>__readStderr</b>(<i></i>) |
|
248 <p> |
|
249 Private slot to handle the readyReadStandardError signal of the |
|
250 pyrcc4/rbrcc process. |
|
251 </p><a NAME="ProjectResourcesBrowser.__readStdout" ID="ProjectResourcesBrowser.__readStdout"></a> |
|
252 <h4>ProjectResourcesBrowser.__readStdout</h4> |
|
253 <b>__readStdout</b>(<i></i>) |
|
254 <p> |
|
255 Private slot to handle the readyReadStandardOutput signal of the |
|
256 pyrcc4/rbrcc process. |
|
257 </p><a NAME="ProjectResourcesBrowser.__showContextMenu" ID="ProjectResourcesBrowser.__showContextMenu"></a> |
|
258 <h4>ProjectResourcesBrowser.__showContextMenu</h4> |
|
259 <b>__showContextMenu</b>(<i></i>) |
|
260 <p> |
|
261 Private slot called by the menu aboutToShow signal. |
|
262 </p><a NAME="ProjectResourcesBrowser.__showContextMenuBack" ID="ProjectResourcesBrowser.__showContextMenuBack"></a> |
|
263 <h4>ProjectResourcesBrowser.__showContextMenuBack</h4> |
|
264 <b>__showContextMenuBack</b>(<i></i>) |
|
265 <p> |
|
266 Private slot called by the backMenu aboutToShow signal. |
|
267 </p><a NAME="ProjectResourcesBrowser.__showContextMenuDir" ID="ProjectResourcesBrowser.__showContextMenuDir"></a> |
|
268 <h4>ProjectResourcesBrowser.__showContextMenuDir</h4> |
|
269 <b>__showContextMenuDir</b>(<i></i>) |
|
270 <p> |
|
271 Private slot called by the dirMenu aboutToShow signal. |
|
272 </p><a NAME="ProjectResourcesBrowser.__showContextMenuDirMulti" ID="ProjectResourcesBrowser.__showContextMenuDirMulti"></a> |
|
273 <h4>ProjectResourcesBrowser.__showContextMenuDirMulti</h4> |
|
274 <b>__showContextMenuDirMulti</b>(<i></i>) |
|
275 <p> |
|
276 Private slot called by the dirMultiMenu aboutToShow signal. |
|
277 </p><a NAME="ProjectResourcesBrowser.__showContextMenuMulti" ID="ProjectResourcesBrowser.__showContextMenuMulti"></a> |
|
278 <h4>ProjectResourcesBrowser.__showContextMenuMulti</h4> |
|
279 <b>__showContextMenuMulti</b>(<i></i>) |
|
280 <p> |
|
281 Private slot called by the multiMenu aboutToShow signal. |
|
282 </p><a NAME="ProjectResourcesBrowser._contextMenuRequested" ID="ProjectResourcesBrowser._contextMenuRequested"></a> |
|
283 <h4>ProjectResourcesBrowser._contextMenuRequested</h4> |
|
284 <b>_contextMenuRequested</b>(<i>coord</i>) |
|
285 <p> |
|
286 Protected slot to show the context menu. |
|
287 </p><dl> |
|
288 <dt><i>coord</i></dt> |
|
289 <dd> |
|
290 the position of the mouse pointer (QPoint) |
|
291 </dd> |
|
292 </dl><a NAME="ProjectResourcesBrowser._createPopupMenus" ID="ProjectResourcesBrowser._createPopupMenus"></a> |
|
293 <h4>ProjectResourcesBrowser._createPopupMenus</h4> |
|
294 <b>_createPopupMenus</b>(<i></i>) |
|
295 <p> |
|
296 Protected overloaded method to generate the popup menu. |
|
297 </p><a NAME="ProjectResourcesBrowser._initHookMethods" ID="ProjectResourcesBrowser._initHookMethods"></a> |
|
298 <h4>ProjectResourcesBrowser._initHookMethods</h4> |
|
299 <b>_initHookMethods</b>(<i></i>) |
|
300 <p> |
|
301 Protected method to initialize the hooks dictionary. |
|
302 </p><p> |
|
303 Supported hook methods are: |
|
304 <ul> |
|
305 <li>compileResource: takes filename as parameter</li> |
|
306 <li>compileAllResources: takes list of filenames as parameter</li> |
|
307 <li>compileChangedResources: takes list of filenames as parameter</li> |
|
308 <li>compileSelectedResources: takes list of all form filenames as parameter</li> |
|
309 <li>newResource: takes full directory path of new file as parameter</li> |
|
310 </ul> |
|
311 </p><p> |
|
312 <b>Note</b>: Filenames are relative to the project directory, if not |
|
313 specified differently. |
|
314 </p><a NAME="ProjectResourcesBrowser._openItem" ID="ProjectResourcesBrowser._openItem"></a> |
|
315 <h4>ProjectResourcesBrowser._openItem</h4> |
|
316 <b>_openItem</b>(<i></i>) |
|
317 <p> |
|
318 Protected slot to handle the open popup menu entry. |
|
319 </p><a NAME="ProjectResourcesBrowser.compileChangedResources" ID="ProjectResourcesBrowser.compileChangedResources"></a> |
|
320 <h4>ProjectResourcesBrowser.compileChangedResources</h4> |
|
321 <b>compileChangedResources</b>(<i></i>) |
|
322 <p> |
|
323 Public method to compile all changed resources to source files. |
|
324 </p><a NAME="ProjectResourcesBrowser.handlePreferencesChanged" ID="ProjectResourcesBrowser.handlePreferencesChanged"></a> |
|
325 <h4>ProjectResourcesBrowser.handlePreferencesChanged</h4> |
|
326 <b>handlePreferencesChanged</b>(<i></i>) |
|
327 <p> |
|
328 Public slot used to handle the preferencesChanged signal. |
|
329 </p> |
|
330 <div align="right"><a href="#top">Up</a></div> |
|
331 <hr /> |
|
332 </body></html> |