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