|
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.ProjectBrowserModel</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.ProjectBrowserModel</h1> |
|
12 <p> |
|
13 Module implementing the browser model. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>ProjectBrowserFormType</td></tr><tr><td>ProjectBrowserInterfaceType</td></tr><tr><td>ProjectBrowserItemDirectory</td></tr><tr><td>ProjectBrowserItemFile</td></tr><tr><td>ProjectBrowserItemSimpleDirectory</td></tr><tr><td>ProjectBrowserNoType</td></tr><tr><td>ProjectBrowserOthersType</td></tr><tr><td>ProjectBrowserResourceType</td></tr><tr><td>ProjectBrowserSourceType</td></tr><tr><td>ProjectBrowserTranslationType</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#ProjectBrowserDirectoryItem">ProjectBrowserDirectoryItem</a></td> |
|
23 <td>Class implementing the data structure for project browser directory items.</td> |
|
24 </tr><tr> |
|
25 <td><a href="#ProjectBrowserFileItem">ProjectBrowserFileItem</a></td> |
|
26 <td>Class implementing the data structure for project browser file items.</td> |
|
27 </tr><tr> |
|
28 <td><a href="#ProjectBrowserItemMixin">ProjectBrowserItemMixin</a></td> |
|
29 <td>Class implementing common methods of project browser items.</td> |
|
30 </tr><tr> |
|
31 <td><a href="#ProjectBrowserModel">ProjectBrowserModel</a></td> |
|
32 <td>Class implementing the project browser model.</td> |
|
33 </tr><tr> |
|
34 <td><a href="#ProjectBrowserSimpleDirectoryItem">ProjectBrowserSimpleDirectoryItem</a></td> |
|
35 <td>Class implementing the data structure for project browser simple directory items.</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="ProjectBrowserDirectoryItem" ID="ProjectBrowserDirectoryItem"></a> |
|
44 <h2>ProjectBrowserDirectoryItem</h2> |
|
45 <p> |
|
46 Class implementing the data structure for project browser directory items. |
|
47 </p> |
|
48 <h3>Derived from</h3> |
|
49 BrowserDirectoryItem, ProjectBrowserItemMixin |
|
50 <h3>Class Attributes</h3> |
|
51 <table> |
|
52 <tr><td>None</td></tr> |
|
53 </table> |
|
54 <h3>Methods</h3> |
|
55 <table> |
|
56 <tr> |
|
57 <td><a href="#ProjectBrowserDirectoryItem.__init__">ProjectBrowserDirectoryItem</a></td> |
|
58 <td>Constructor</td> |
|
59 </tr> |
|
60 </table> |
|
61 <a NAME="ProjectBrowserDirectoryItem.__init__" ID="ProjectBrowserDirectoryItem.__init__"></a> |
|
62 <h4>ProjectBrowserDirectoryItem (Constructor)</h4> |
|
63 <b>ProjectBrowserDirectoryItem</b>(<i>parent, dinfo, projectType, full = True, bold = False</i>) |
|
64 <p> |
|
65 Constructor |
|
66 </p><dl> |
|
67 <dt><i>parent</i></dt> |
|
68 <dd> |
|
69 parent item |
|
70 </dd><dt><i>dinfo</i></dt> |
|
71 <dd> |
|
72 dinfo is the string for the directory (string) |
|
73 </dd><dt><i>projectType</i></dt> |
|
74 <dd> |
|
75 type of file/directory in the project |
|
76 </dd><dt><i>full</i></dt> |
|
77 <dd> |
|
78 flag indicating full pathname should be displayed (boolean) |
|
79 </dd><dt><i>bold</i></dt> |
|
80 <dd> |
|
81 flag indicating a highlighted font (boolean) |
|
82 </dd> |
|
83 </dl> |
|
84 <div align="right"><a href="#top">Up</a></div> |
|
85 <hr /><hr /> |
|
86 <a NAME="ProjectBrowserFileItem" ID="ProjectBrowserFileItem"></a> |
|
87 <h2>ProjectBrowserFileItem</h2> |
|
88 <p> |
|
89 Class implementing the data structure for project browser file items. |
|
90 </p> |
|
91 <h3>Derived from</h3> |
|
92 BrowserFileItem, ProjectBrowserItemMixin |
|
93 <h3>Class Attributes</h3> |
|
94 <table> |
|
95 <tr><td>None</td></tr> |
|
96 </table> |
|
97 <h3>Methods</h3> |
|
98 <table> |
|
99 <tr> |
|
100 <td><a href="#ProjectBrowserFileItem.__init__">ProjectBrowserFileItem</a></td> |
|
101 <td>Constructor</td> |
|
102 </tr> |
|
103 </table> |
|
104 <a NAME="ProjectBrowserFileItem.__init__" ID="ProjectBrowserFileItem.__init__"></a> |
|
105 <h4>ProjectBrowserFileItem (Constructor)</h4> |
|
106 <b>ProjectBrowserFileItem</b>(<i>parent, finfo, projectType, full = True, bold = False, sourceLanguage = ""</i>) |
|
107 <p> |
|
108 Constructor |
|
109 </p><dl> |
|
110 <dt><i>parent</i></dt> |
|
111 <dd> |
|
112 parent item |
|
113 </dd><dt><i>finfo</i></dt> |
|
114 <dd> |
|
115 the string for the file (string) |
|
116 </dd><dt><i>projectType</i></dt> |
|
117 <dd> |
|
118 type of file/directory in the project |
|
119 </dd><dt><i>full</i></dt> |
|
120 <dd> |
|
121 flag indicating full pathname should be displayed (boolean) |
|
122 </dd><dt><i>bold</i></dt> |
|
123 <dd> |
|
124 flag indicating a highlighted font (boolean) |
|
125 </dd><dt><i>sourceLanguage</i></dt> |
|
126 <dd> |
|
127 source code language of the project (string) |
|
128 </dd> |
|
129 </dl> |
|
130 <div align="right"><a href="#top">Up</a></div> |
|
131 <hr /><hr /> |
|
132 <a NAME="ProjectBrowserItemMixin" ID="ProjectBrowserItemMixin"></a> |
|
133 <h2>ProjectBrowserItemMixin</h2> |
|
134 <p> |
|
135 Class implementing common methods of project browser items. |
|
136 </p><p> |
|
137 It is meant to be used as a mixin class. |
|
138 </p> |
|
139 <h3>Derived from</h3> |
|
140 object |
|
141 <h3>Class Attributes</h3> |
|
142 <table> |
|
143 <tr><td>None</td></tr> |
|
144 </table> |
|
145 <h3>Methods</h3> |
|
146 <table> |
|
147 <tr> |
|
148 <td><a href="#ProjectBrowserItemMixin.__init__">ProjectBrowserItemMixin</a></td> |
|
149 <td>Constructor</td> |
|
150 </tr><tr> |
|
151 <td><a href="#ProjectBrowserItemMixin.addProjectType">addProjectType</a></td> |
|
152 <td>Public method to add a type to the list.</td> |
|
153 </tr><tr> |
|
154 <td><a href="#ProjectBrowserItemMixin.addVcsStatus">addVcsStatus</a></td> |
|
155 <td>Public method to add the VCS status.</td> |
|
156 </tr><tr> |
|
157 <td><a href="#ProjectBrowserItemMixin.getProjectTypes">getProjectTypes</a></td> |
|
158 <td>Public method to get the project type.</td> |
|
159 </tr><tr> |
|
160 <td><a href="#ProjectBrowserItemMixin.getTextColor">getTextColor</a></td> |
|
161 <td>Public method to get the items text color.</td> |
|
162 </tr><tr> |
|
163 <td><a href="#ProjectBrowserItemMixin.setVcsState">setVcsState</a></td> |
|
164 <td>Public method to set the items VCS state.</td> |
|
165 </tr><tr> |
|
166 <td><a href="#ProjectBrowserItemMixin.setVcsStatus">setVcsStatus</a></td> |
|
167 <td>Public method to set the VCS status.</td> |
|
168 </tr> |
|
169 </table> |
|
170 <a NAME="ProjectBrowserItemMixin.__init__" ID="ProjectBrowserItemMixin.__init__"></a> |
|
171 <h4>ProjectBrowserItemMixin (Constructor)</h4> |
|
172 <b>ProjectBrowserItemMixin</b>(<i>type_, bold = False</i>) |
|
173 <p> |
|
174 Constructor |
|
175 </p><dl> |
|
176 <dt><i>type_</i></dt> |
|
177 <dd> |
|
178 type of file/directory in the project |
|
179 </dd><dt><i>bold</i></dt> |
|
180 <dd> |
|
181 flag indicating a highlighted font |
|
182 </dd> |
|
183 </dl><a NAME="ProjectBrowserItemMixin.addProjectType" ID="ProjectBrowserItemMixin.addProjectType"></a> |
|
184 <h4>ProjectBrowserItemMixin.addProjectType</h4> |
|
185 <b>addProjectType</b>(<i>type_</i>) |
|
186 <p> |
|
187 Public method to add a type to the list. |
|
188 </p><dl> |
|
189 <dt><i>type_</i></dt> |
|
190 <dd> |
|
191 type to add to the list |
|
192 </dd> |
|
193 </dl><a NAME="ProjectBrowserItemMixin.addVcsStatus" ID="ProjectBrowserItemMixin.addVcsStatus"></a> |
|
194 <h4>ProjectBrowserItemMixin.addVcsStatus</h4> |
|
195 <b>addVcsStatus</b>(<i>vcsStatus</i>) |
|
196 <p> |
|
197 Public method to add the VCS status. |
|
198 </p><dl> |
|
199 <dt><i>vcsStatus</i></dt> |
|
200 <dd> |
|
201 VCS status text (string) |
|
202 </dd> |
|
203 </dl><a NAME="ProjectBrowserItemMixin.getProjectTypes" ID="ProjectBrowserItemMixin.getProjectTypes"></a> |
|
204 <h4>ProjectBrowserItemMixin.getProjectTypes</h4> |
|
205 <b>getProjectTypes</b>(<i></i>) |
|
206 <p> |
|
207 Public method to get the project type. |
|
208 </p><dl> |
|
209 <dt>Returns:</dt> |
|
210 <dd> |
|
211 project type |
|
212 </dd> |
|
213 </dl><a NAME="ProjectBrowserItemMixin.getTextColor" ID="ProjectBrowserItemMixin.getTextColor"></a> |
|
214 <h4>ProjectBrowserItemMixin.getTextColor</h4> |
|
215 <b>getTextColor</b>(<i></i>) |
|
216 <p> |
|
217 Public method to get the items text color. |
|
218 </p><dl> |
|
219 <dt>Returns:</dt> |
|
220 <dd> |
|
221 text color (QColor) |
|
222 </dd> |
|
223 </dl><a NAME="ProjectBrowserItemMixin.setVcsState" ID="ProjectBrowserItemMixin.setVcsState"></a> |
|
224 <h4>ProjectBrowserItemMixin.setVcsState</h4> |
|
225 <b>setVcsState</b>(<i>state</i>) |
|
226 <p> |
|
227 Public method to set the items VCS state. |
|
228 </p><dl> |
|
229 <dt><i>state</i></dt> |
|
230 <dd> |
|
231 VCS state (one of A, C, M, U or " ") (string) |
|
232 </dd> |
|
233 </dl><a NAME="ProjectBrowserItemMixin.setVcsStatus" ID="ProjectBrowserItemMixin.setVcsStatus"></a> |
|
234 <h4>ProjectBrowserItemMixin.setVcsStatus</h4> |
|
235 <b>setVcsStatus</b>(<i>vcsStatus</i>) |
|
236 <p> |
|
237 Public method to set the VCS status. |
|
238 </p><dl> |
|
239 <dt><i>vcsStatus</i></dt> |
|
240 <dd> |
|
241 VCS status text (string) |
|
242 </dd> |
|
243 </dl> |
|
244 <div align="right"><a href="#top">Up</a></div> |
|
245 <hr /><hr /> |
|
246 <a NAME="ProjectBrowserModel" ID="ProjectBrowserModel"></a> |
|
247 <h2>ProjectBrowserModel</h2> |
|
248 <p> |
|
249 Class implementing the project browser model. |
|
250 </p><h4>Signals</h4> |
|
251 <dl> |
|
252 <dt>vcsStateChanged(QString)</dt> |
|
253 <dd> |
|
254 emitted after the VCS state has changed |
|
255 </dd> |
|
256 </dl> |
|
257 <h3>Derived from</h3> |
|
258 BrowserModel |
|
259 <h3>Class Attributes</h3> |
|
260 <table> |
|
261 <tr><td>None</td></tr> |
|
262 </table> |
|
263 <h3>Methods</h3> |
|
264 <table> |
|
265 <tr> |
|
266 <td><a href="#ProjectBrowserModel.__init__">ProjectBrowserModel</a></td> |
|
267 <td>Constructor</td> |
|
268 </tr><tr> |
|
269 <td><a href="#ProjectBrowserModel.__addVCSStatus">__addVCSStatus</a></td> |
|
270 <td>Private method used to set the vcs status of a node.</td> |
|
271 </tr><tr> |
|
272 <td><a href="#ProjectBrowserModel.__changeParentsVCSState">__changeParentsVCSState</a></td> |
|
273 <td>Private method to recursively change the parents VCS state.</td> |
|
274 </tr><tr> |
|
275 <td><a href="#ProjectBrowserModel.__updateVCSStatus">__updateVCSStatus</a></td> |
|
276 <td>Private method used to update the vcs status of a node.</td> |
|
277 </tr><tr> |
|
278 <td><a href="#ProjectBrowserModel.addNewItem">addNewItem</a></td> |
|
279 <td>Public method to add a new item to the model.</td> |
|
280 </tr><tr> |
|
281 <td><a href="#ProjectBrowserModel.changeVCSStates">changeVCSStates</a></td> |
|
282 <td>Public slot to record the (non normal) VCS states.</td> |
|
283 </tr><tr> |
|
284 <td><a href="#ProjectBrowserModel.data">data</a></td> |
|
285 <td>Public method to get data of an item.</td> |
|
286 </tr><tr> |
|
287 <td><a href="#ProjectBrowserModel.findChildItem">findChildItem</a></td> |
|
288 <td>Public method to find a child item given some text.</td> |
|
289 </tr><tr> |
|
290 <td><a href="#ProjectBrowserModel.findItem">findItem</a></td> |
|
291 <td>Public method to find an item given it's name.</td> |
|
292 </tr><tr> |
|
293 <td><a href="#ProjectBrowserModel.findParentItemByName">findParentItemByName</a></td> |
|
294 <td>Public method to find an item given it's name.</td> |
|
295 </tr><tr> |
|
296 <td><a href="#ProjectBrowserModel.itemIndexByName">itemIndexByName</a></td> |
|
297 <td>Public method to find an item's index given it's name.</td> |
|
298 </tr><tr> |
|
299 <td><a href="#ProjectBrowserModel.populateItem">populateItem</a></td> |
|
300 <td>Public method to populate an item's subtree.</td> |
|
301 </tr><tr> |
|
302 <td><a href="#ProjectBrowserModel.populateProjectDirectoryItem">populateProjectDirectoryItem</a></td> |
|
303 <td>Public method to populate a directory item's subtree.</td> |
|
304 </tr><tr> |
|
305 <td><a href="#ProjectBrowserModel.preferencesChanged">preferencesChanged</a></td> |
|
306 <td>Public method used to handle a change in preferences.</td> |
|
307 </tr><tr> |
|
308 <td><a href="#ProjectBrowserModel.projectClosed">projectClosed</a></td> |
|
309 <td>Public method called after a project has been closed.</td> |
|
310 </tr><tr> |
|
311 <td><a href="#ProjectBrowserModel.projectOpened">projectOpened</a></td> |
|
312 <td>Public method used to populate the model after a project has been opened.</td> |
|
313 </tr><tr> |
|
314 <td><a href="#ProjectBrowserModel.projectPropertiesChanged">projectPropertiesChanged</a></td> |
|
315 <td>Public method to react on a change of the project properties.</td> |
|
316 </tr><tr> |
|
317 <td><a href="#ProjectBrowserModel.removeItem">removeItem</a></td> |
|
318 <td>Public method to remove a named item.</td> |
|
319 </tr><tr> |
|
320 <td><a href="#ProjectBrowserModel.renameItem">renameItem</a></td> |
|
321 <td>Public method to rename an item.</td> |
|
322 </tr><tr> |
|
323 <td><a href="#ProjectBrowserModel.repopulateItem">repopulateItem</a></td> |
|
324 <td>Public method to repopulate an item.</td> |
|
325 </tr><tr> |
|
326 <td><a href="#ProjectBrowserModel.updateVCSStatus">updateVCSStatus</a></td> |
|
327 <td>Public method used to update the vcs status of a node.</td> |
|
328 </tr> |
|
329 </table> |
|
330 <a NAME="ProjectBrowserModel.__init__" ID="ProjectBrowserModel.__init__"></a> |
|
331 <h4>ProjectBrowserModel (Constructor)</h4> |
|
332 <b>ProjectBrowserModel</b>(<i>parent</i>) |
|
333 <p> |
|
334 Constructor |
|
335 </p><dl> |
|
336 <dt><i>parent</i></dt> |
|
337 <dd> |
|
338 reference to parent object (Project.Project) |
|
339 </dd> |
|
340 </dl><a NAME="ProjectBrowserModel.__addVCSStatus" ID="ProjectBrowserModel.__addVCSStatus"></a> |
|
341 <h4>ProjectBrowserModel.__addVCSStatus</h4> |
|
342 <b>__addVCSStatus</b>(<i>item, name</i>) |
|
343 <p> |
|
344 Private method used to set the vcs status of a node. |
|
345 </p><dl> |
|
346 <dt><i>item</i></dt> |
|
347 <dd> |
|
348 item to work on |
|
349 </dd><dt><i>name</i></dt> |
|
350 <dd> |
|
351 filename belonging to this item (string) |
|
352 </dd> |
|
353 </dl><a NAME="ProjectBrowserModel.__changeParentsVCSState" ID="ProjectBrowserModel.__changeParentsVCSState"></a> |
|
354 <h4>ProjectBrowserModel.__changeParentsVCSState</h4> |
|
355 <b>__changeParentsVCSState</b>(<i>path, itemCache</i>) |
|
356 <p> |
|
357 Private method to recursively change the parents VCS state. |
|
358 </p><dl> |
|
359 <dt><i>path</i></dt> |
|
360 <dd> |
|
361 pathname of parent item (string) |
|
362 </dd><dt><i>itemCache</i></dt> |
|
363 <dd> |
|
364 reference to the item cache used to store |
|
365 references to named items |
|
366 </dd> |
|
367 </dl><a NAME="ProjectBrowserModel.__updateVCSStatus" ID="ProjectBrowserModel.__updateVCSStatus"></a> |
|
368 <h4>ProjectBrowserModel.__updateVCSStatus</h4> |
|
369 <b>__updateVCSStatus</b>(<i>item, name, recursive = True</i>) |
|
370 <p> |
|
371 Private method used to update the vcs status of a node. |
|
372 </p><dl> |
|
373 <dt><i>item</i></dt> |
|
374 <dd> |
|
375 item to work on |
|
376 </dd><dt><i>name</i></dt> |
|
377 <dd> |
|
378 filename belonging to this item (string) |
|
379 </dd><dt><i>recursive</i></dt> |
|
380 <dd> |
|
381 flag indicating a recursive update (boolean) |
|
382 </dd> |
|
383 </dl><a NAME="ProjectBrowserModel.addNewItem" ID="ProjectBrowserModel.addNewItem"></a> |
|
384 <h4>ProjectBrowserModel.addNewItem</h4> |
|
385 <b>addNewItem</b>(<i>typeString, name, additionalTypeStrings = []</i>) |
|
386 <p> |
|
387 Public method to add a new item to the model. |
|
388 </p><dl> |
|
389 <dt><i>typeString</i></dt> |
|
390 <dd> |
|
391 string denoting the type of the new item (string) |
|
392 </dd><dt><i>name</i></dt> |
|
393 <dd> |
|
394 name of the new item (string) |
|
395 </dd><dt><i>additionalTypeStrings</i></dt> |
|
396 <dd> |
|
397 names of additional types (list of string) |
|
398 </dd> |
|
399 </dl><a NAME="ProjectBrowserModel.changeVCSStates" ID="ProjectBrowserModel.changeVCSStates"></a> |
|
400 <h4>ProjectBrowserModel.changeVCSStates</h4> |
|
401 <b>changeVCSStates</b>(<i>statesList</i>) |
|
402 <p> |
|
403 Public slot to record the (non normal) VCS states. |
|
404 </p><dl> |
|
405 <dt><i>statesList</i></dt> |
|
406 <dd> |
|
407 list of VCS state entries (list of strings) giving the |
|
408 states in the first column and the path relative to the project |
|
409 directory starting with the third column. The allowed status flags |
|
410 are: |
|
411 <ul> |
|
412 <li>"A" path was added but not yet comitted</li> |
|
413 <li>"M" path has local changes</li> |
|
414 <li>"R" path was deleted and then re-added</li> |
|
415 <li>"U" path needs an update</li> |
|
416 <li>"Z" path contains a conflict</li> |
|
417 <li>" " path is back at normal</li> |
|
418 </ul> |
|
419 </dd> |
|
420 </dl><a NAME="ProjectBrowserModel.data" ID="ProjectBrowserModel.data"></a> |
|
421 <h4>ProjectBrowserModel.data</h4> |
|
422 <b>data</b>(<i>index, role</i>) |
|
423 <p> |
|
424 Public method to get data of an item. |
|
425 </p><dl> |
|
426 <dt><i>index</i></dt> |
|
427 <dd> |
|
428 index of the data to retrieve (QModelIndex) |
|
429 </dd><dt><i>role</i></dt> |
|
430 <dd> |
|
431 role of data (Qt.ItemDataRole) |
|
432 </dd> |
|
433 </dl><dl> |
|
434 <dt>Returns:</dt> |
|
435 <dd> |
|
436 requested data |
|
437 </dd> |
|
438 </dl><a NAME="ProjectBrowserModel.findChildItem" ID="ProjectBrowserModel.findChildItem"></a> |
|
439 <h4>ProjectBrowserModel.findChildItem</h4> |
|
440 <b>findChildItem</b>(<i>text, column, parentItem = None</i>) |
|
441 <p> |
|
442 Public method to find a child item given some text. |
|
443 </p><dl> |
|
444 <dt><i>text</i></dt> |
|
445 <dd> |
|
446 text to search for (string) |
|
447 </dd><dt><i>column</i></dt> |
|
448 <dd> |
|
449 column to search in (integer) |
|
450 </dd><dt><i>parentItem</i></dt> |
|
451 <dd> |
|
452 reference to parent item |
|
453 </dd> |
|
454 </dl><dl> |
|
455 <dt>Returns:</dt> |
|
456 <dd> |
|
457 reference to the item found |
|
458 </dd> |
|
459 </dl><a NAME="ProjectBrowserModel.findItem" ID="ProjectBrowserModel.findItem"></a> |
|
460 <h4>ProjectBrowserModel.findItem</h4> |
|
461 <b>findItem</b>(<i>name</i>) |
|
462 <p> |
|
463 Public method to find an item given it's name. |
|
464 </p><dl> |
|
465 <dt><i>name</i></dt> |
|
466 <dd> |
|
467 name of the item (string) |
|
468 </dd> |
|
469 </dl><dl> |
|
470 <dt>Returns:</dt> |
|
471 <dd> |
|
472 reference to the item found |
|
473 </dd> |
|
474 </dl><a NAME="ProjectBrowserModel.findParentItemByName" ID="ProjectBrowserModel.findParentItemByName"></a> |
|
475 <h4>ProjectBrowserModel.findParentItemByName</h4> |
|
476 <b>findParentItemByName</b>(<i>type_, name, dontSplit = False</i>) |
|
477 <p> |
|
478 Public method to find an item given it's name. |
|
479 </p><p> |
|
480 <b>Note</b>: This method creates all necessary parent items, if they |
|
481 don't exist. |
|
482 </p><dl> |
|
483 <dt><i>type_</i></dt> |
|
484 <dd> |
|
485 type of the item |
|
486 </dd><dt><i>name</i></dt> |
|
487 <dd> |
|
488 name of the item (string) |
|
489 </dd><dt><i>dontSplit</i></dt> |
|
490 <dd> |
|
491 flag indicating the name should not be split (boolean) |
|
492 </dd> |
|
493 </dl><dl> |
|
494 <dt>Returns:</dt> |
|
495 <dd> |
|
496 reference to the item found and the new display name (string) |
|
497 </dd> |
|
498 </dl><a NAME="ProjectBrowserModel.itemIndexByName" ID="ProjectBrowserModel.itemIndexByName"></a> |
|
499 <h4>ProjectBrowserModel.itemIndexByName</h4> |
|
500 <b>itemIndexByName</b>(<i>name</i>) |
|
501 <p> |
|
502 Public method to find an item's index given it's name. |
|
503 </p><dl> |
|
504 <dt><i>name</i></dt> |
|
505 <dd> |
|
506 name of the item (string) |
|
507 </dd> |
|
508 </dl><dl> |
|
509 <dt>Returns:</dt> |
|
510 <dd> |
|
511 index of the item found (QModelIndex) |
|
512 </dd> |
|
513 </dl><a NAME="ProjectBrowserModel.populateItem" ID="ProjectBrowserModel.populateItem"></a> |
|
514 <h4>ProjectBrowserModel.populateItem</h4> |
|
515 <b>populateItem</b>(<i>parentItem, repopulate = False</i>) |
|
516 <p> |
|
517 Public method to populate an item's subtree. |
|
518 </p><dl> |
|
519 <dt><i>parentItem</i></dt> |
|
520 <dd> |
|
521 reference to the item to be populated |
|
522 </dd><dt><i>repopulate</i></dt> |
|
523 <dd> |
|
524 flag indicating a repopulation (boolean) |
|
525 </dd> |
|
526 </dl><a NAME="ProjectBrowserModel.populateProjectDirectoryItem" ID="ProjectBrowserModel.populateProjectDirectoryItem"></a> |
|
527 <h4>ProjectBrowserModel.populateProjectDirectoryItem</h4> |
|
528 <b>populateProjectDirectoryItem</b>(<i>parentItem, repopulate = False</i>) |
|
529 <p> |
|
530 Public method to populate a directory item's subtree. |
|
531 </p><dl> |
|
532 <dt><i>parentItem</i></dt> |
|
533 <dd> |
|
534 reference to the directory item to be populated |
|
535 </dd><dt><i>repopulate</i></dt> |
|
536 <dd> |
|
537 flag indicating a repopulation (boolean) |
|
538 </dd> |
|
539 </dl><a NAME="ProjectBrowserModel.preferencesChanged" ID="ProjectBrowserModel.preferencesChanged"></a> |
|
540 <h4>ProjectBrowserModel.preferencesChanged</h4> |
|
541 <b>preferencesChanged</b>(<i></i>) |
|
542 <p> |
|
543 Public method used to handle a change in preferences. |
|
544 </p><a NAME="ProjectBrowserModel.projectClosed" ID="ProjectBrowserModel.projectClosed"></a> |
|
545 <h4>ProjectBrowserModel.projectClosed</h4> |
|
546 <b>projectClosed</b>(<i></i>) |
|
547 <p> |
|
548 Public method called after a project has been closed. |
|
549 </p><a NAME="ProjectBrowserModel.projectOpened" ID="ProjectBrowserModel.projectOpened"></a> |
|
550 <h4>ProjectBrowserModel.projectOpened</h4> |
|
551 <b>projectOpened</b>(<i></i>) |
|
552 <p> |
|
553 Public method used to populate the model after a project has been opened. |
|
554 </p><a NAME="ProjectBrowserModel.projectPropertiesChanged" ID="ProjectBrowserModel.projectPropertiesChanged"></a> |
|
555 <h4>ProjectBrowserModel.projectPropertiesChanged</h4> |
|
556 <b>projectPropertiesChanged</b>(<i></i>) |
|
557 <p> |
|
558 Public method to react on a change of the project properties. |
|
559 </p><a NAME="ProjectBrowserModel.removeItem" ID="ProjectBrowserModel.removeItem"></a> |
|
560 <h4>ProjectBrowserModel.removeItem</h4> |
|
561 <b>removeItem</b>(<i>name</i>) |
|
562 <p> |
|
563 Public method to remove a named item. |
|
564 </p><dl> |
|
565 <dt><i>name</i></dt> |
|
566 <dd> |
|
567 file or directory name of the item (string). |
|
568 </dd> |
|
569 </dl><a NAME="ProjectBrowserModel.renameItem" ID="ProjectBrowserModel.renameItem"></a> |
|
570 <h4>ProjectBrowserModel.renameItem</h4> |
|
571 <b>renameItem</b>(<i>name, newFilename</i>) |
|
572 <p> |
|
573 Public method to rename an item. |
|
574 </p><dl> |
|
575 <dt><i>name</i></dt> |
|
576 <dd> |
|
577 the old display name (string) |
|
578 </dd><dt><i>newFilename</i></dt> |
|
579 <dd> |
|
580 new filename of the item (string) |
|
581 </dd> |
|
582 </dl><a NAME="ProjectBrowserModel.repopulateItem" ID="ProjectBrowserModel.repopulateItem"></a> |
|
583 <h4>ProjectBrowserModel.repopulateItem</h4> |
|
584 <b>repopulateItem</b>(<i>name</i>) |
|
585 <p> |
|
586 Public method to repopulate an item. |
|
587 </p><dl> |
|
588 <dt><i>name</i></dt> |
|
589 <dd> |
|
590 name of the file relative to the project root (string) |
|
591 </dd> |
|
592 </dl><a NAME="ProjectBrowserModel.updateVCSStatus" ID="ProjectBrowserModel.updateVCSStatus"></a> |
|
593 <h4>ProjectBrowserModel.updateVCSStatus</h4> |
|
594 <b>updateVCSStatus</b>(<i>name, recursive = True</i>) |
|
595 <p> |
|
596 Public method used to update the vcs status of a node. |
|
597 </p><dl> |
|
598 <dt><i>name</i></dt> |
|
599 <dd> |
|
600 filename belonging to this item (string) |
|
601 </dd><dt><i>recursive</i></dt> |
|
602 <dd> |
|
603 flag indicating a recursive update (boolean) |
|
604 </dd> |
|
605 </dl> |
|
606 <div align="right"><a href="#top">Up</a></div> |
|
607 <hr /><hr /> |
|
608 <a NAME="ProjectBrowserSimpleDirectoryItem" ID="ProjectBrowserSimpleDirectoryItem"></a> |
|
609 <h2>ProjectBrowserSimpleDirectoryItem</h2> |
|
610 <p> |
|
611 Class implementing the data structure for project browser simple directory items. |
|
612 </p> |
|
613 <h3>Derived from</h3> |
|
614 BrowserItem, ProjectBrowserItemMixin |
|
615 <h3>Class Attributes</h3> |
|
616 <table> |
|
617 <tr><td>None</td></tr> |
|
618 </table> |
|
619 <h3>Methods</h3> |
|
620 <table> |
|
621 <tr> |
|
622 <td><a href="#ProjectBrowserSimpleDirectoryItem.__init__">ProjectBrowserSimpleDirectoryItem</a></td> |
|
623 <td>Constructor</td> |
|
624 </tr><tr> |
|
625 <td><a href="#ProjectBrowserSimpleDirectoryItem.dirName">dirName</a></td> |
|
626 <td>Public method returning the directory name.</td> |
|
627 </tr><tr> |
|
628 <td><a href="#ProjectBrowserSimpleDirectoryItem.lessThan">lessThan</a></td> |
|
629 <td>Public method to check, if the item is less than the other one.</td> |
|
630 </tr> |
|
631 </table> |
|
632 <a NAME="ProjectBrowserSimpleDirectoryItem.__init__" ID="ProjectBrowserSimpleDirectoryItem.__init__"></a> |
|
633 <h4>ProjectBrowserSimpleDirectoryItem (Constructor)</h4> |
|
634 <b>ProjectBrowserSimpleDirectoryItem</b>(<i>parent, projectType, text, path = ""</i>) |
|
635 <p> |
|
636 Constructor |
|
637 </p><dl> |
|
638 <dt><i>parent</i></dt> |
|
639 <dd> |
|
640 parent item |
|
641 </dd><dt><i>projectType</i></dt> |
|
642 <dd> |
|
643 type of file/directory in the project |
|
644 </dd><dt><i>text</i></dt> |
|
645 <dd> |
|
646 text to be displayed (string) |
|
647 </dd><dt><i>path</i></dt> |
|
648 <dd> |
|
649 path of the directory (string) |
|
650 </dd> |
|
651 </dl><a NAME="ProjectBrowserSimpleDirectoryItem.dirName" ID="ProjectBrowserSimpleDirectoryItem.dirName"></a> |
|
652 <h4>ProjectBrowserSimpleDirectoryItem.dirName</h4> |
|
653 <b>dirName</b>(<i></i>) |
|
654 <p> |
|
655 Public method returning the directory name. |
|
656 </p><dl> |
|
657 <dt>Returns:</dt> |
|
658 <dd> |
|
659 directory name (string) |
|
660 </dd> |
|
661 </dl><a NAME="ProjectBrowserSimpleDirectoryItem.lessThan" ID="ProjectBrowserSimpleDirectoryItem.lessThan"></a> |
|
662 <h4>ProjectBrowserSimpleDirectoryItem.lessThan</h4> |
|
663 <b>lessThan</b>(<i>other, column, order</i>) |
|
664 <p> |
|
665 Public method to check, if the item is less than the other one. |
|
666 </p><dl> |
|
667 <dt><i>other</i></dt> |
|
668 <dd> |
|
669 reference to item to compare against (BrowserItem) |
|
670 </dd><dt><i>column</i></dt> |
|
671 <dd> |
|
672 column number to use for the comparison (integer) |
|
673 </dd><dt><i>order</i></dt> |
|
674 <dd> |
|
675 sort order (Qt.SortOrder) (for special sorting) |
|
676 </dd> |
|
677 </dl><dl> |
|
678 <dt>Returns:</dt> |
|
679 <dd> |
|
680 true, if this item is less than other (boolean) |
|
681 </dd> |
|
682 </dl> |
|
683 <div align="right"><a href="#top">Up</a></div> |
|
684 <hr /> |
|
685 </body></html> |