|
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>eric4.Project.ProjectFormsBrowser</title> |
|
6 <style> |
|
7 body { |
|
8 background:white; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #4FA4FF; } |
|
14 h2 { color: white; background: #4FA4FF; } |
|
15 h3 { color: white; background: #00557F; } |
|
16 h4 { color: white; background: #00557F; } |
|
17 |
|
18 a { color: #AA5500; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric4.Project.ProjectFormsBrowser</h1> |
|
24 <p> |
|
25 Module implementing a class used to display the forms part of the project. |
|
26 </p> |
|
27 <h3>Global Attributes</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 <h3>Classes</h3> |
|
32 <table> |
|
33 <tr> |
|
34 <td><a href="#ProjectFormsBrowser">ProjectFormsBrowser</a></td> |
|
35 <td>A class used to display the forms part of the project.</td> |
|
36 </tr> |
|
37 </table> |
|
38 <h3>Functions</h3> |
|
39 <table> |
|
40 <tr><td>None</td></tr> |
|
41 </table> |
|
42 <hr /><hr /> |
|
43 <a NAME="ProjectFormsBrowser" ID="ProjectFormsBrowser"></a> |
|
44 <h2>ProjectFormsBrowser</h2> |
|
45 <p> |
|
46 A class used to display the forms part of the project. |
|
47 </p><h4>Signals</h4> |
|
48 <dl> |
|
49 <dt>appendStderr(string)</dt> |
|
50 <dd> |
|
51 emitted after something was received from |
|
52 a QProcess on stderr |
|
53 </dd><dt>closeSourceWindow(string)</dt> |
|
54 <dd> |
|
55 emitted after a file has been removed/deleted |
|
56 from the project |
|
57 </dd><dt>menusAboutToBeCreated</dt> |
|
58 <dd> |
|
59 emitted when the context menu are about to |
|
60 be created. This is the right moment to add or remove hook methods. |
|
61 </dd><dt>showMenu(string, QMenu)</dt> |
|
62 <dd> |
|
63 emitted when a menu is about to be shown. The name |
|
64 of the menu and a reference to the menu are given. |
|
65 </dd><dt>sourceFile(string)</dt> |
|
66 <dd> |
|
67 emitted to open a forms file in an editor |
|
68 </dd><dt>trpreview(string list)</dt> |
|
69 <dd> |
|
70 emitted to preview form files in the |
|
71 translations previewer |
|
72 </dd><dt>uipreview(string)</dt> |
|
73 <dd> |
|
74 emitted to preview a forms file |
|
75 </dd> |
|
76 </dl> |
|
77 <h3>Derived from</h3> |
|
78 ProjectBaseBrowser |
|
79 <h3>Class Attributes</h3> |
|
80 <table> |
|
81 <tr><td>None</td></tr> |
|
82 </table> |
|
83 <h3>Methods</h3> |
|
84 <table> |
|
85 <tr> |
|
86 <td><a href="#ProjectFormsBrowser.__init__">ProjectFormsBrowser</a></td> |
|
87 <td>Constructor</td> |
|
88 </tr><tr> |
|
89 <td><a href="#ProjectFormsBrowser.__TRPreview">__TRPreview</a></td> |
|
90 <td>Private slot to handle the Preview translations action.</td> |
|
91 </tr><tr> |
|
92 <td><a href="#ProjectFormsBrowser.__UIPreview">__UIPreview</a></td> |
|
93 <td>Private slot to handle the Preview menu action.</td> |
|
94 </tr><tr> |
|
95 <td><a href="#ProjectFormsBrowser.__addFormFiles">__addFormFiles</a></td> |
|
96 <td>Private method to add form files to the project.</td> |
|
97 </tr><tr> |
|
98 <td><a href="#ProjectFormsBrowser.__addFormsDirectory">__addFormsDirectory</a></td> |
|
99 <td>Private method to add form files of a directory to the project.</td> |
|
100 </tr><tr> |
|
101 <td><a href="#ProjectFormsBrowser.__compileAllForms">__compileAllForms</a></td> |
|
102 <td>Private method to compile all forms to source files.</td> |
|
103 </tr><tr> |
|
104 <td><a href="#ProjectFormsBrowser.__compileForm">__compileForm</a></td> |
|
105 <td>Private method to compile a form to a source file.</td> |
|
106 </tr><tr> |
|
107 <td><a href="#ProjectFormsBrowser.__compileSelectedForms">__compileSelectedForms</a></td> |
|
108 <td>Private method to compile selected forms to source files.</td> |
|
109 </tr><tr> |
|
110 <td><a href="#ProjectFormsBrowser.__compileUI">__compileUI</a></td> |
|
111 <td>Privat method to compile a .ui file to a .py/.rb file.</td> |
|
112 </tr><tr> |
|
113 <td><a href="#ProjectFormsBrowser.__compileUIDone">__compileUIDone</a></td> |
|
114 <td>Private slot to handle the finished signal of the pyuic/rbuic process.</td> |
|
115 </tr><tr> |
|
116 <td><a href="#ProjectFormsBrowser.__deleteFile">__deleteFile</a></td> |
|
117 <td>Private method to delete a form file from the project.</td> |
|
118 </tr><tr> |
|
119 <td><a href="#ProjectFormsBrowser.__generateDialogCode">__generateDialogCode</a></td> |
|
120 <td>Private method to generate dialog code for the form (Qt4 only)</td> |
|
121 </tr><tr> |
|
122 <td><a href="#ProjectFormsBrowser.__newForm">__newForm</a></td> |
|
123 <td>Private slot to handle the New Form menu action.</td> |
|
124 </tr><tr> |
|
125 <td><a href="#ProjectFormsBrowser.__newUiForm">__newUiForm</a></td> |
|
126 <td>Private slot to handle the New Form menu action for Qt-related projects.</td> |
|
127 </tr><tr> |
|
128 <td><a href="#ProjectFormsBrowser.__openFile">__openFile</a></td> |
|
129 <td>Private slot to handle the Open menu action.</td> |
|
130 </tr><tr> |
|
131 <td><a href="#ProjectFormsBrowser.__openFileInEditor">__openFileInEditor</a></td> |
|
132 <td>Private slot to handle the Open in Editor menu action.</td> |
|
133 </tr><tr> |
|
134 <td><a href="#ProjectFormsBrowser.__readStderr">__readStderr</a></td> |
|
135 <td>Private slot to handle the readyReadStandardError signal of the pyuic/rbuic process.</td> |
|
136 </tr><tr> |
|
137 <td><a href="#ProjectFormsBrowser.__readStdout">__readStdout</a></td> |
|
138 <td>Private slot to handle the readyReadStandardOutput signal of the pyuic/rbuic process.</td> |
|
139 </tr><tr> |
|
140 <td><a href="#ProjectFormsBrowser.__showContextMenu">__showContextMenu</a></td> |
|
141 <td>Private slot called by the menu aboutToShow signal.</td> |
|
142 </tr><tr> |
|
143 <td><a href="#ProjectFormsBrowser.__showContextMenuBack">__showContextMenuBack</a></td> |
|
144 <td>Private slot called by the backMenu aboutToShow signal.</td> |
|
145 </tr><tr> |
|
146 <td><a href="#ProjectFormsBrowser.__showContextMenuDir">__showContextMenuDir</a></td> |
|
147 <td>Private slot called by the dirMenu aboutToShow signal.</td> |
|
148 </tr><tr> |
|
149 <td><a href="#ProjectFormsBrowser.__showContextMenuDirMulti">__showContextMenuDirMulti</a></td> |
|
150 <td>Private slot called by the dirMultiMenu aboutToShow signal.</td> |
|
151 </tr><tr> |
|
152 <td><a href="#ProjectFormsBrowser.__showContextMenuMulti">__showContextMenuMulti</a></td> |
|
153 <td>Private slot called by the multiMenu aboutToShow signal.</td> |
|
154 </tr><tr> |
|
155 <td><a href="#ProjectFormsBrowser._contextMenuRequested">_contextMenuRequested</a></td> |
|
156 <td>Protected slot to show the context menu.</td> |
|
157 </tr><tr> |
|
158 <td><a href="#ProjectFormsBrowser._createPopupMenus">_createPopupMenus</a></td> |
|
159 <td>Protected overloaded method to generate the popup menu.</td> |
|
160 </tr><tr> |
|
161 <td><a href="#ProjectFormsBrowser._initHookMethods">_initHookMethods</a></td> |
|
162 <td>Protected method to initialize the hooks dictionary.</td> |
|
163 </tr><tr> |
|
164 <td><a href="#ProjectFormsBrowser._openItem">_openItem</a></td> |
|
165 <td>Protected slot to handle the open popup menu entry.</td> |
|
166 </tr><tr> |
|
167 <td><a href="#ProjectFormsBrowser.compileChangedForms">compileChangedForms</a></td> |
|
168 <td>Public method to compile all changed forms to source files.</td> |
|
169 </tr><tr> |
|
170 <td><a href="#ProjectFormsBrowser.handlePreferencesChanged">handlePreferencesChanged</a></td> |
|
171 <td>Public slot used to handle the preferencesChanged signal.</td> |
|
172 </tr> |
|
173 </table> |
|
174 <a NAME="ProjectFormsBrowser.__init__" ID="ProjectFormsBrowser.__init__"></a> |
|
175 <h4>ProjectFormsBrowser (Constructor)</h4> |
|
176 <b>ProjectFormsBrowser</b>(<i>project, parent = None</i>) |
|
177 <p> |
|
178 Constructor |
|
179 </p><dl> |
|
180 <dt><i>project</i></dt> |
|
181 <dd> |
|
182 reference to the project object |
|
183 </dd><dt><i>parent</i></dt> |
|
184 <dd> |
|
185 parent widget of this browser (QWidget) |
|
186 </dd> |
|
187 </dl><a NAME="ProjectFormsBrowser.__TRPreview" ID="ProjectFormsBrowser.__TRPreview"></a> |
|
188 <h4>ProjectFormsBrowser.__TRPreview</h4> |
|
189 <b>__TRPreview</b>(<i></i>) |
|
190 <p> |
|
191 Private slot to handle the Preview translations action. |
|
192 </p><a NAME="ProjectFormsBrowser.__UIPreview" ID="ProjectFormsBrowser.__UIPreview"></a> |
|
193 <h4>ProjectFormsBrowser.__UIPreview</h4> |
|
194 <b>__UIPreview</b>(<i></i>) |
|
195 <p> |
|
196 Private slot to handle the Preview menu action. |
|
197 </p><a NAME="ProjectFormsBrowser.__addFormFiles" ID="ProjectFormsBrowser.__addFormFiles"></a> |
|
198 <h4>ProjectFormsBrowser.__addFormFiles</h4> |
|
199 <b>__addFormFiles</b>(<i></i>) |
|
200 <p> |
|
201 Private method to add form files to the project. |
|
202 </p><a NAME="ProjectFormsBrowser.__addFormsDirectory" ID="ProjectFormsBrowser.__addFormsDirectory"></a> |
|
203 <h4>ProjectFormsBrowser.__addFormsDirectory</h4> |
|
204 <b>__addFormsDirectory</b>(<i></i>) |
|
205 <p> |
|
206 Private method to add form files of a directory to the project. |
|
207 </p><a NAME="ProjectFormsBrowser.__compileAllForms" ID="ProjectFormsBrowser.__compileAllForms"></a> |
|
208 <h4>ProjectFormsBrowser.__compileAllForms</h4> |
|
209 <b>__compileAllForms</b>(<i></i>) |
|
210 <p> |
|
211 Private method to compile all forms to source files. |
|
212 </p><a NAME="ProjectFormsBrowser.__compileForm" ID="ProjectFormsBrowser.__compileForm"></a> |
|
213 <h4>ProjectFormsBrowser.__compileForm</h4> |
|
214 <b>__compileForm</b>(<i></i>) |
|
215 <p> |
|
216 Private method to compile a form to a source file. |
|
217 </p><a NAME="ProjectFormsBrowser.__compileSelectedForms" ID="ProjectFormsBrowser.__compileSelectedForms"></a> |
|
218 <h4>ProjectFormsBrowser.__compileSelectedForms</h4> |
|
219 <b>__compileSelectedForms</b>(<i></i>) |
|
220 <p> |
|
221 Private method to compile selected forms to source files. |
|
222 </p><a NAME="ProjectFormsBrowser.__compileUI" ID="ProjectFormsBrowser.__compileUI"></a> |
|
223 <h4>ProjectFormsBrowser.__compileUI</h4> |
|
224 <b>__compileUI</b>(<i>fn, noDialog = False, progress = None</i>) |
|
225 <p> |
|
226 Privat method to compile a .ui file to a .py/.rb file. |
|
227 </p><dl> |
|
228 <dt><i>fn</i></dt> |
|
229 <dd> |
|
230 filename of the .ui file to be compiled |
|
231 </dd><dt><i>noDialog</i></dt> |
|
232 <dd> |
|
233 flag indicating silent operations |
|
234 </dd><dt><i>progress</i></dt> |
|
235 <dd> |
|
236 reference to the progress dialog |
|
237 </dd> |
|
238 </dl><dl> |
|
239 <dt>Returns:</dt> |
|
240 <dd> |
|
241 reference to the compile process (QProcess) |
|
242 </dd> |
|
243 </dl><a NAME="ProjectFormsBrowser.__compileUIDone" ID="ProjectFormsBrowser.__compileUIDone"></a> |
|
244 <h4>ProjectFormsBrowser.__compileUIDone</h4> |
|
245 <b>__compileUIDone</b>(<i>exitCode, exitStatus</i>) |
|
246 <p> |
|
247 Private slot to handle the finished signal of the pyuic/rbuic process. |
|
248 </p><dl> |
|
249 <dt><i>exitCode</i></dt> |
|
250 <dd> |
|
251 exit code of the process (integer) |
|
252 </dd><dt><i>exitStatus</i></dt> |
|
253 <dd> |
|
254 exit status of the process (QProcess.ExitStatus) |
|
255 </dd> |
|
256 </dl><a NAME="ProjectFormsBrowser.__deleteFile" ID="ProjectFormsBrowser.__deleteFile"></a> |
|
257 <h4>ProjectFormsBrowser.__deleteFile</h4> |
|
258 <b>__deleteFile</b>(<i></i>) |
|
259 <p> |
|
260 Private method to delete a form file from the project. |
|
261 </p><a NAME="ProjectFormsBrowser.__generateDialogCode" ID="ProjectFormsBrowser.__generateDialogCode"></a> |
|
262 <h4>ProjectFormsBrowser.__generateDialogCode</h4> |
|
263 <b>__generateDialogCode</b>(<i></i>) |
|
264 <p> |
|
265 Private method to generate dialog code for the form (Qt4 only) |
|
266 </p><a NAME="ProjectFormsBrowser.__newForm" ID="ProjectFormsBrowser.__newForm"></a> |
|
267 <h4>ProjectFormsBrowser.__newForm</h4> |
|
268 <b>__newForm</b>(<i></i>) |
|
269 <p> |
|
270 Private slot to handle the New Form menu action. |
|
271 </p><a NAME="ProjectFormsBrowser.__newUiForm" ID="ProjectFormsBrowser.__newUiForm"></a> |
|
272 <h4>ProjectFormsBrowser.__newUiForm</h4> |
|
273 <b>__newUiForm</b>(<i>path</i>) |
|
274 <p> |
|
275 Private slot to handle the New Form menu action for Qt-related projects. |
|
276 </p><dl> |
|
277 <dt><i>path</i></dt> |
|
278 <dd> |
|
279 full directory path for the new form file (string) |
|
280 </dd> |
|
281 </dl><a NAME="ProjectFormsBrowser.__openFile" ID="ProjectFormsBrowser.__openFile"></a> |
|
282 <h4>ProjectFormsBrowser.__openFile</h4> |
|
283 <b>__openFile</b>(<i></i>) |
|
284 <p> |
|
285 Private slot to handle the Open menu action. |
|
286 </p><p> |
|
287 This uses the projects UI type to determine the Qt Designer |
|
288 version to use. |
|
289 </p><a NAME="ProjectFormsBrowser.__openFileInEditor" ID="ProjectFormsBrowser.__openFileInEditor"></a> |
|
290 <h4>ProjectFormsBrowser.__openFileInEditor</h4> |
|
291 <b>__openFileInEditor</b>(<i></i>) |
|
292 <p> |
|
293 Private slot to handle the Open in Editor menu action. |
|
294 </p><a NAME="ProjectFormsBrowser.__readStderr" ID="ProjectFormsBrowser.__readStderr"></a> |
|
295 <h4>ProjectFormsBrowser.__readStderr</h4> |
|
296 <b>__readStderr</b>(<i></i>) |
|
297 <p> |
|
298 Private slot to handle the readyReadStandardError signal of the |
|
299 pyuic/rbuic process. |
|
300 </p><a NAME="ProjectFormsBrowser.__readStdout" ID="ProjectFormsBrowser.__readStdout"></a> |
|
301 <h4>ProjectFormsBrowser.__readStdout</h4> |
|
302 <b>__readStdout</b>(<i></i>) |
|
303 <p> |
|
304 Private slot to handle the readyReadStandardOutput signal of the |
|
305 pyuic/rbuic process. |
|
306 </p><a NAME="ProjectFormsBrowser.__showContextMenu" ID="ProjectFormsBrowser.__showContextMenu"></a> |
|
307 <h4>ProjectFormsBrowser.__showContextMenu</h4> |
|
308 <b>__showContextMenu</b>(<i></i>) |
|
309 <p> |
|
310 Private slot called by the menu aboutToShow signal. |
|
311 </p><a NAME="ProjectFormsBrowser.__showContextMenuBack" ID="ProjectFormsBrowser.__showContextMenuBack"></a> |
|
312 <h4>ProjectFormsBrowser.__showContextMenuBack</h4> |
|
313 <b>__showContextMenuBack</b>(<i></i>) |
|
314 <p> |
|
315 Private slot called by the backMenu aboutToShow signal. |
|
316 </p><a NAME="ProjectFormsBrowser.__showContextMenuDir" ID="ProjectFormsBrowser.__showContextMenuDir"></a> |
|
317 <h4>ProjectFormsBrowser.__showContextMenuDir</h4> |
|
318 <b>__showContextMenuDir</b>(<i></i>) |
|
319 <p> |
|
320 Private slot called by the dirMenu aboutToShow signal. |
|
321 </p><a NAME="ProjectFormsBrowser.__showContextMenuDirMulti" ID="ProjectFormsBrowser.__showContextMenuDirMulti"></a> |
|
322 <h4>ProjectFormsBrowser.__showContextMenuDirMulti</h4> |
|
323 <b>__showContextMenuDirMulti</b>(<i></i>) |
|
324 <p> |
|
325 Private slot called by the dirMultiMenu aboutToShow signal. |
|
326 </p><a NAME="ProjectFormsBrowser.__showContextMenuMulti" ID="ProjectFormsBrowser.__showContextMenuMulti"></a> |
|
327 <h4>ProjectFormsBrowser.__showContextMenuMulti</h4> |
|
328 <b>__showContextMenuMulti</b>(<i></i>) |
|
329 <p> |
|
330 Private slot called by the multiMenu aboutToShow signal. |
|
331 </p><a NAME="ProjectFormsBrowser._contextMenuRequested" ID="ProjectFormsBrowser._contextMenuRequested"></a> |
|
332 <h4>ProjectFormsBrowser._contextMenuRequested</h4> |
|
333 <b>_contextMenuRequested</b>(<i>coord</i>) |
|
334 <p> |
|
335 Protected slot to show the context menu. |
|
336 </p><dl> |
|
337 <dt><i>coord</i></dt> |
|
338 <dd> |
|
339 the position of the mouse pointer (QPoint) |
|
340 </dd> |
|
341 </dl><a NAME="ProjectFormsBrowser._createPopupMenus" ID="ProjectFormsBrowser._createPopupMenus"></a> |
|
342 <h4>ProjectFormsBrowser._createPopupMenus</h4> |
|
343 <b>_createPopupMenus</b>(<i></i>) |
|
344 <p> |
|
345 Protected overloaded method to generate the popup menu. |
|
346 </p><a NAME="ProjectFormsBrowser._initHookMethods" ID="ProjectFormsBrowser._initHookMethods"></a> |
|
347 <h4>ProjectFormsBrowser._initHookMethods</h4> |
|
348 <b>_initHookMethods</b>(<i></i>) |
|
349 <p> |
|
350 Protected method to initialize the hooks dictionary. |
|
351 </p><p> |
|
352 Supported hook methods are: |
|
353 <ul> |
|
354 <li>compileForm: takes filename as parameter</li> |
|
355 <li>compileAllForms: takes list of filenames as parameter</li> |
|
356 <li>compileSelectedForms: takes list of filenames as parameter</li> |
|
357 <li>compileChangedForms: takes list of filenames as parameter</li> |
|
358 <li>generateDialogCode: takes filename as parameter</li> |
|
359 <li>newForm: takes full directory path of new file as parameter</li> |
|
360 </ul> |
|
361 </p><p> |
|
362 <b>Note</b>: Filenames are relative to the project directory, if not |
|
363 specified differently. |
|
364 </p><a NAME="ProjectFormsBrowser._openItem" ID="ProjectFormsBrowser._openItem"></a> |
|
365 <h4>ProjectFormsBrowser._openItem</h4> |
|
366 <b>_openItem</b>(<i></i>) |
|
367 <p> |
|
368 Protected slot to handle the open popup menu entry. |
|
369 </p><a NAME="ProjectFormsBrowser.compileChangedForms" ID="ProjectFormsBrowser.compileChangedForms"></a> |
|
370 <h4>ProjectFormsBrowser.compileChangedForms</h4> |
|
371 <b>compileChangedForms</b>(<i></i>) |
|
372 <p> |
|
373 Public method to compile all changed forms to source files. |
|
374 </p><a NAME="ProjectFormsBrowser.handlePreferencesChanged" ID="ProjectFormsBrowser.handlePreferencesChanged"></a> |
|
375 <h4>ProjectFormsBrowser.handlePreferencesChanged</h4> |
|
376 <b>handlePreferencesChanged</b>(<i></i>) |
|
377 <p> |
|
378 Public slot used to handle the preferencesChanged signal. |
|
379 </p> |
|
380 <div align="right"><a href="#top">Up</a></div> |
|
381 <hr /> |
|
382 </body></html> |