|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Project.ProjectBrowserModel</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.Project.ProjectBrowserModel</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the browser model. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <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>ProjectBrowserProtocolsType</td></tr><tr><td>ProjectBrowserResourceType</td></tr><tr><td>ProjectBrowserSourceType</td></tr><tr><td>ProjectBrowserTranslationType</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#ProjectBrowserDirectoryItem">ProjectBrowserDirectoryItem</a></td> |
|
39 <td>Class implementing the data structure for project browser directory items.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#ProjectBrowserFileItem">ProjectBrowserFileItem</a></td> |
|
43 <td>Class implementing the data structure for project browser file items.</td> |
|
44 </tr> |
|
45 <tr> |
|
46 <td><a href="#ProjectBrowserItemMixin">ProjectBrowserItemMixin</a></td> |
|
47 <td>Class implementing common methods of project browser items.</td> |
|
48 </tr> |
|
49 <tr> |
|
50 <td><a href="#ProjectBrowserModel">ProjectBrowserModel</a></td> |
|
51 <td>Class implementing the project browser model.</td> |
|
52 </tr> |
|
53 <tr> |
|
54 <td><a href="#ProjectBrowserSimpleDirectoryItem">ProjectBrowserSimpleDirectoryItem</a></td> |
|
55 <td>Class implementing the data structure for project browser simple directory items.</td> |
|
56 </tr> |
|
57 </table> |
|
58 <h3>Functions</h3> |
|
59 |
|
60 <table> |
|
61 <tr><td>None</td></tr> |
|
62 </table> |
|
63 <hr /> |
|
64 <hr /> |
|
65 <a NAME="ProjectBrowserDirectoryItem" ID="ProjectBrowserDirectoryItem"></a> |
|
66 <h2>ProjectBrowserDirectoryItem</h2> |
|
67 |
|
68 <p> |
|
69 Class implementing the data structure for project browser directory items. |
|
70 </p> |
|
71 <h3>Derived from</h3> |
|
72 BrowserDirectoryItem, ProjectBrowserItemMixin |
|
73 <h3>Class Attributes</h3> |
|
74 |
|
75 <table> |
|
76 <tr><td>None</td></tr> |
|
77 </table> |
|
78 <h3>Class Methods</h3> |
|
79 |
|
80 <table> |
|
81 <tr><td>None</td></tr> |
|
82 </table> |
|
83 <h3>Methods</h3> |
|
84 |
|
85 <table> |
|
86 |
|
87 <tr> |
|
88 <td><a href="#ProjectBrowserDirectoryItem.__init__">ProjectBrowserDirectoryItem</a></td> |
|
89 <td>Constructor</td> |
|
90 </tr> |
|
91 </table> |
|
92 <h3>Static Methods</h3> |
|
93 |
|
94 <table> |
|
95 <tr><td>None</td></tr> |
|
96 </table> |
|
97 |
|
98 <a NAME="ProjectBrowserDirectoryItem.__init__" ID="ProjectBrowserDirectoryItem.__init__"></a> |
|
99 <h4>ProjectBrowserDirectoryItem (Constructor)</h4> |
|
100 <b>ProjectBrowserDirectoryItem</b>(<i>parent, dinfo, projectType, full=True, bold=False</i>) |
|
101 |
|
102 <p> |
|
103 Constructor |
|
104 </p> |
|
105 <dl> |
|
106 |
|
107 <dt><i>parent</i></dt> |
|
108 <dd> |
|
109 parent item |
|
110 </dd> |
|
111 <dt><i>dinfo</i></dt> |
|
112 <dd> |
|
113 dinfo is the string for the directory (string) |
|
114 </dd> |
|
115 <dt><i>projectType</i></dt> |
|
116 <dd> |
|
117 type of file/directory in the project |
|
118 </dd> |
|
119 <dt><i>full</i></dt> |
|
120 <dd> |
|
121 flag indicating full pathname should be displayed (boolean) |
|
122 </dd> |
|
123 <dt><i>bold</i></dt> |
|
124 <dd> |
|
125 flag indicating a highlighted font (boolean) |
|
126 </dd> |
|
127 </dl> |
|
128 <div align="right"><a href="#top">Up</a></div> |
|
129 <hr /> |
|
130 <hr /> |
|
131 <a NAME="ProjectBrowserFileItem" ID="ProjectBrowserFileItem"></a> |
|
132 <h2>ProjectBrowserFileItem</h2> |
|
133 |
|
134 <p> |
|
135 Class implementing the data structure for project browser file items. |
|
136 </p> |
|
137 <h3>Derived from</h3> |
|
138 BrowserFileItem, ProjectBrowserItemMixin |
|
139 <h3>Class Attributes</h3> |
|
140 |
|
141 <table> |
|
142 <tr><td>None</td></tr> |
|
143 </table> |
|
144 <h3>Class Methods</h3> |
|
145 |
|
146 <table> |
|
147 <tr><td>None</td></tr> |
|
148 </table> |
|
149 <h3>Methods</h3> |
|
150 |
|
151 <table> |
|
152 |
|
153 <tr> |
|
154 <td><a href="#ProjectBrowserFileItem.__init__">ProjectBrowserFileItem</a></td> |
|
155 <td>Constructor</td> |
|
156 </tr> |
|
157 </table> |
|
158 <h3>Static Methods</h3> |
|
159 |
|
160 <table> |
|
161 <tr><td>None</td></tr> |
|
162 </table> |
|
163 |
|
164 <a NAME="ProjectBrowserFileItem.__init__" ID="ProjectBrowserFileItem.__init__"></a> |
|
165 <h4>ProjectBrowserFileItem (Constructor)</h4> |
|
166 <b>ProjectBrowserFileItem</b>(<i>parent, finfo, projectType, full=True, bold=False, sourceLanguage=""</i>) |
|
167 |
|
168 <p> |
|
169 Constructor |
|
170 </p> |
|
171 <dl> |
|
172 |
|
173 <dt><i>parent</i></dt> |
|
174 <dd> |
|
175 parent item |
|
176 </dd> |
|
177 <dt><i>finfo</i></dt> |
|
178 <dd> |
|
179 the string for the file (string) |
|
180 </dd> |
|
181 <dt><i>projectType</i></dt> |
|
182 <dd> |
|
183 type of file/directory in the project |
|
184 </dd> |
|
185 <dt><i>full</i></dt> |
|
186 <dd> |
|
187 flag indicating full pathname should be displayed (boolean) |
|
188 </dd> |
|
189 <dt><i>bold</i></dt> |
|
190 <dd> |
|
191 flag indicating a highlighted font (boolean) |
|
192 </dd> |
|
193 <dt><i>sourceLanguage</i></dt> |
|
194 <dd> |
|
195 source code language of the project (string) |
|
196 </dd> |
|
197 </dl> |
|
198 <div align="right"><a href="#top">Up</a></div> |
|
199 <hr /> |
|
200 <hr /> |
|
201 <a NAME="ProjectBrowserItemMixin" ID="ProjectBrowserItemMixin"></a> |
|
202 <h2>ProjectBrowserItemMixin</h2> |
|
203 |
|
204 <p> |
|
205 Class implementing common methods of project browser items. |
|
206 </p> |
|
207 <p> |
|
208 It is meant to be used as a mixin class. |
|
209 </p> |
|
210 <h3>Derived from</h3> |
|
211 None |
|
212 <h3>Class Attributes</h3> |
|
213 |
|
214 <table> |
|
215 <tr><td>None</td></tr> |
|
216 </table> |
|
217 <h3>Class Methods</h3> |
|
218 |
|
219 <table> |
|
220 <tr><td>None</td></tr> |
|
221 </table> |
|
222 <h3>Methods</h3> |
|
223 |
|
224 <table> |
|
225 |
|
226 <tr> |
|
227 <td><a href="#ProjectBrowserItemMixin.__init__">ProjectBrowserItemMixin</a></td> |
|
228 <td>Constructor</td> |
|
229 </tr> |
|
230 <tr> |
|
231 <td><a href="#ProjectBrowserItemMixin.addProjectType">addProjectType</a></td> |
|
232 <td>Public method to add a type to the list.</td> |
|
233 </tr> |
|
234 <tr> |
|
235 <td><a href="#ProjectBrowserItemMixin.addVcsStatus">addVcsStatus</a></td> |
|
236 <td>Public method to add the VCS status.</td> |
|
237 </tr> |
|
238 <tr> |
|
239 <td><a href="#ProjectBrowserItemMixin.getProjectTypes">getProjectTypes</a></td> |
|
240 <td>Public method to get the project type.</td> |
|
241 </tr> |
|
242 <tr> |
|
243 <td><a href="#ProjectBrowserItemMixin.getTextColor">getTextColor</a></td> |
|
244 <td>Public method to get the items text color.</td> |
|
245 </tr> |
|
246 <tr> |
|
247 <td><a href="#ProjectBrowserItemMixin.setVcsState">setVcsState</a></td> |
|
248 <td>Public method to set the items VCS state.</td> |
|
249 </tr> |
|
250 <tr> |
|
251 <td><a href="#ProjectBrowserItemMixin.setVcsStatus">setVcsStatus</a></td> |
|
252 <td>Public method to set the VCS status.</td> |
|
253 </tr> |
|
254 </table> |
|
255 <h3>Static Methods</h3> |
|
256 |
|
257 <table> |
|
258 <tr><td>None</td></tr> |
|
259 </table> |
|
260 |
|
261 <a NAME="ProjectBrowserItemMixin.__init__" ID="ProjectBrowserItemMixin.__init__"></a> |
|
262 <h4>ProjectBrowserItemMixin (Constructor)</h4> |
|
263 <b>ProjectBrowserItemMixin</b>(<i>type_, bold=False</i>) |
|
264 |
|
265 <p> |
|
266 Constructor |
|
267 </p> |
|
268 <dl> |
|
269 |
|
270 <dt><i>type_</i></dt> |
|
271 <dd> |
|
272 type of file/directory in the project |
|
273 </dd> |
|
274 <dt><i>bold</i></dt> |
|
275 <dd> |
|
276 flag indicating a highlighted font |
|
277 </dd> |
|
278 </dl> |
|
279 <a NAME="ProjectBrowserItemMixin.addProjectType" ID="ProjectBrowserItemMixin.addProjectType"></a> |
|
280 <h4>ProjectBrowserItemMixin.addProjectType</h4> |
|
281 <b>addProjectType</b>(<i>type_</i>) |
|
282 |
|
283 <p> |
|
284 Public method to add a type to the list. |
|
285 </p> |
|
286 <dl> |
|
287 |
|
288 <dt><i>type_</i></dt> |
|
289 <dd> |
|
290 type to add to the list |
|
291 </dd> |
|
292 </dl> |
|
293 <a NAME="ProjectBrowserItemMixin.addVcsStatus" ID="ProjectBrowserItemMixin.addVcsStatus"></a> |
|
294 <h4>ProjectBrowserItemMixin.addVcsStatus</h4> |
|
295 <b>addVcsStatus</b>(<i>vcsStatus</i>) |
|
296 |
|
297 <p> |
|
298 Public method to add the VCS status. |
|
299 </p> |
|
300 <dl> |
|
301 |
|
302 <dt><i>vcsStatus</i></dt> |
|
303 <dd> |
|
304 VCS status text (string) |
|
305 </dd> |
|
306 </dl> |
|
307 <a NAME="ProjectBrowserItemMixin.getProjectTypes" ID="ProjectBrowserItemMixin.getProjectTypes"></a> |
|
308 <h4>ProjectBrowserItemMixin.getProjectTypes</h4> |
|
309 <b>getProjectTypes</b>(<i></i>) |
|
310 |
|
311 <p> |
|
312 Public method to get the project type. |
|
313 </p> |
|
314 <dl> |
|
315 <dt>Return:</dt> |
|
316 <dd> |
|
317 project type |
|
318 </dd> |
|
319 </dl> |
|
320 <a NAME="ProjectBrowserItemMixin.getTextColor" ID="ProjectBrowserItemMixin.getTextColor"></a> |
|
321 <h4>ProjectBrowserItemMixin.getTextColor</h4> |
|
322 <b>getTextColor</b>(<i></i>) |
|
323 |
|
324 <p> |
|
325 Public method to get the items text color. |
|
326 </p> |
|
327 <dl> |
|
328 <dt>Return:</dt> |
|
329 <dd> |
|
330 text color (QColor) |
|
331 </dd> |
|
332 </dl> |
|
333 <a NAME="ProjectBrowserItemMixin.setVcsState" ID="ProjectBrowserItemMixin.setVcsState"></a> |
|
334 <h4>ProjectBrowserItemMixin.setVcsState</h4> |
|
335 <b>setVcsState</b>(<i>state</i>) |
|
336 |
|
337 <p> |
|
338 Public method to set the items VCS state. |
|
339 </p> |
|
340 <dl> |
|
341 |
|
342 <dt><i>state</i></dt> |
|
343 <dd> |
|
344 VCS state (one of A, C, M, U or " ") (string) |
|
345 </dd> |
|
346 </dl> |
|
347 <a NAME="ProjectBrowserItemMixin.setVcsStatus" ID="ProjectBrowserItemMixin.setVcsStatus"></a> |
|
348 <h4>ProjectBrowserItemMixin.setVcsStatus</h4> |
|
349 <b>setVcsStatus</b>(<i>vcsStatus</i>) |
|
350 |
|
351 <p> |
|
352 Public method to set the VCS status. |
|
353 </p> |
|
354 <dl> |
|
355 |
|
356 <dt><i>vcsStatus</i></dt> |
|
357 <dd> |
|
358 VCS status text (string) |
|
359 </dd> |
|
360 </dl> |
|
361 <div align="right"><a href="#top">Up</a></div> |
|
362 <hr /> |
|
363 <hr /> |
|
364 <a NAME="ProjectBrowserModel" ID="ProjectBrowserModel"></a> |
|
365 <h2>ProjectBrowserModel</h2> |
|
366 |
|
367 <p> |
|
368 Class implementing the project browser model. |
|
369 </p> |
|
370 <h3>Signals</h3> |
|
371 <dl> |
|
372 |
|
373 <dt>vcsStateChanged(str)</dt> |
|
374 <dd> |
|
375 emitted after the VCS state has changed |
|
376 </dd> |
|
377 </dl> |
|
378 <h3>Derived from</h3> |
|
379 BrowserModel |
|
380 <h3>Class Attributes</h3> |
|
381 |
|
382 <table> |
|
383 <tr><td>None</td></tr> |
|
384 </table> |
|
385 <h3>Class Methods</h3> |
|
386 |
|
387 <table> |
|
388 <tr><td>None</td></tr> |
|
389 </table> |
|
390 <h3>Methods</h3> |
|
391 |
|
392 <table> |
|
393 |
|
394 <tr> |
|
395 <td><a href="#ProjectBrowserModel.__init__">ProjectBrowserModel</a></td> |
|
396 <td>Constructor</td> |
|
397 </tr> |
|
398 <tr> |
|
399 <td><a href="#ProjectBrowserModel.__addVCSStatus">__addVCSStatus</a></td> |
|
400 <td>Private method used to set the vcs status of a node.</td> |
|
401 </tr> |
|
402 <tr> |
|
403 <td><a href="#ProjectBrowserModel.__changeParentsVCSState">__changeParentsVCSState</a></td> |
|
404 <td>Private method to recursively change the parents VCS state.</td> |
|
405 </tr> |
|
406 <tr> |
|
407 <td><a href="#ProjectBrowserModel.__updateVCSStatus">__updateVCSStatus</a></td> |
|
408 <td>Private method used to update the vcs status of a node.</td> |
|
409 </tr> |
|
410 <tr> |
|
411 <td><a href="#ProjectBrowserModel.addNewItem">addNewItem</a></td> |
|
412 <td>Public method to add a new item to the model.</td> |
|
413 </tr> |
|
414 <tr> |
|
415 <td><a href="#ProjectBrowserModel.changeVCSStates">changeVCSStates</a></td> |
|
416 <td>Public slot to record the (non normal) VCS states.</td> |
|
417 </tr> |
|
418 <tr> |
|
419 <td><a href="#ProjectBrowserModel.data">data</a></td> |
|
420 <td>Public method to get data of an item.</td> |
|
421 </tr> |
|
422 <tr> |
|
423 <td><a href="#ProjectBrowserModel.directoryChanged">directoryChanged</a></td> |
|
424 <td>Public slot to handle the directoryChanged signal of the watcher.</td> |
|
425 </tr> |
|
426 <tr> |
|
427 <td><a href="#ProjectBrowserModel.findChildItem">findChildItem</a></td> |
|
428 <td>Public method to find a child item given some text.</td> |
|
429 </tr> |
|
430 <tr> |
|
431 <td><a href="#ProjectBrowserModel.findItem">findItem</a></td> |
|
432 <td>Public method to find an item given its name.</td> |
|
433 </tr> |
|
434 <tr> |
|
435 <td><a href="#ProjectBrowserModel.findParentItemByName">findParentItemByName</a></td> |
|
436 <td>Public method to find an item given its name.</td> |
|
437 </tr> |
|
438 <tr> |
|
439 <td><a href="#ProjectBrowserModel.itemIndexByName">itemIndexByName</a></td> |
|
440 <td>Public method to find an item's index given its name.</td> |
|
441 </tr> |
|
442 <tr> |
|
443 <td><a href="#ProjectBrowserModel.itemIndexByNameAndLine">itemIndexByNameAndLine</a></td> |
|
444 <td>Public method to find an item's index given its name.</td> |
|
445 </tr> |
|
446 <tr> |
|
447 <td><a href="#ProjectBrowserModel.populateItem">populateItem</a></td> |
|
448 <td>Public method to populate an item's subtree.</td> |
|
449 </tr> |
|
450 <tr> |
|
451 <td><a href="#ProjectBrowserModel.populateProjectDirectoryItem">populateProjectDirectoryItem</a></td> |
|
452 <td>Public method to populate a directory item's subtree.</td> |
|
453 </tr> |
|
454 <tr> |
|
455 <td><a href="#ProjectBrowserModel.preferencesChanged">preferencesChanged</a></td> |
|
456 <td>Public method used to handle a change in preferences.</td> |
|
457 </tr> |
|
458 <tr> |
|
459 <td><a href="#ProjectBrowserModel.projectClosed">projectClosed</a></td> |
|
460 <td>Public method called after a project has been closed.</td> |
|
461 </tr> |
|
462 <tr> |
|
463 <td><a href="#ProjectBrowserModel.projectOpened">projectOpened</a></td> |
|
464 <td>Public method used to populate the model after a project has been opened.</td> |
|
465 </tr> |
|
466 <tr> |
|
467 <td><a href="#ProjectBrowserModel.projectPropertiesChanged">projectPropertiesChanged</a></td> |
|
468 <td>Public method to react on a change of the project properties.</td> |
|
469 </tr> |
|
470 <tr> |
|
471 <td><a href="#ProjectBrowserModel.removeItem">removeItem</a></td> |
|
472 <td>Public method to remove a named item.</td> |
|
473 </tr> |
|
474 <tr> |
|
475 <td><a href="#ProjectBrowserModel.renameItem">renameItem</a></td> |
|
476 <td>Public method to rename an item.</td> |
|
477 </tr> |
|
478 <tr> |
|
479 <td><a href="#ProjectBrowserModel.repopulateItem">repopulateItem</a></td> |
|
480 <td>Public method to repopulate an item.</td> |
|
481 </tr> |
|
482 <tr> |
|
483 <td><a href="#ProjectBrowserModel.startFileSystemMonitoring">startFileSystemMonitoring</a></td> |
|
484 <td>Public method to (re)start monitoring the project file system.</td> |
|
485 </tr> |
|
486 <tr> |
|
487 <td><a href="#ProjectBrowserModel.stopFileSystemMonitoring">stopFileSystemMonitoring</a></td> |
|
488 <td>Public method to stop monitoring the project file system.</td> |
|
489 </tr> |
|
490 <tr> |
|
491 <td><a href="#ProjectBrowserModel.updateVCSStatus">updateVCSStatus</a></td> |
|
492 <td>Public method used to update the vcs status of a node.</td> |
|
493 </tr> |
|
494 </table> |
|
495 <h3>Static Methods</h3> |
|
496 |
|
497 <table> |
|
498 <tr><td>None</td></tr> |
|
499 </table> |
|
500 |
|
501 <a NAME="ProjectBrowserModel.__init__" ID="ProjectBrowserModel.__init__"></a> |
|
502 <h4>ProjectBrowserModel (Constructor)</h4> |
|
503 <b>ProjectBrowserModel</b>(<i>parent</i>) |
|
504 |
|
505 <p> |
|
506 Constructor |
|
507 </p> |
|
508 <dl> |
|
509 |
|
510 <dt><i>parent</i></dt> |
|
511 <dd> |
|
512 reference to parent object (Project.Project) |
|
513 </dd> |
|
514 </dl> |
|
515 <a NAME="ProjectBrowserModel.__addVCSStatus" ID="ProjectBrowserModel.__addVCSStatus"></a> |
|
516 <h4>ProjectBrowserModel.__addVCSStatus</h4> |
|
517 <b>__addVCSStatus</b>(<i>item, name</i>) |
|
518 |
|
519 <p> |
|
520 Private method used to set the vcs status of a node. |
|
521 </p> |
|
522 <dl> |
|
523 |
|
524 <dt><i>item</i></dt> |
|
525 <dd> |
|
526 item to work on |
|
527 </dd> |
|
528 <dt><i>name</i></dt> |
|
529 <dd> |
|
530 filename belonging to this item (string) |
|
531 </dd> |
|
532 </dl> |
|
533 <a NAME="ProjectBrowserModel.__changeParentsVCSState" ID="ProjectBrowserModel.__changeParentsVCSState"></a> |
|
534 <h4>ProjectBrowserModel.__changeParentsVCSState</h4> |
|
535 <b>__changeParentsVCSState</b>(<i>path, itemCache</i>) |
|
536 |
|
537 <p> |
|
538 Private method to recursively change the parents VCS state. |
|
539 </p> |
|
540 <dl> |
|
541 |
|
542 <dt><i>path</i></dt> |
|
543 <dd> |
|
544 pathname of parent item (string) |
|
545 </dd> |
|
546 <dt><i>itemCache</i></dt> |
|
547 <dd> |
|
548 reference to the item cache used to store |
|
549 references to named items |
|
550 </dd> |
|
551 </dl> |
|
552 <a NAME="ProjectBrowserModel.__updateVCSStatus" ID="ProjectBrowserModel.__updateVCSStatus"></a> |
|
553 <h4>ProjectBrowserModel.__updateVCSStatus</h4> |
|
554 <b>__updateVCSStatus</b>(<i>item, name, recursive=True</i>) |
|
555 |
|
556 <p> |
|
557 Private method used to update the vcs status of a node. |
|
558 </p> |
|
559 <dl> |
|
560 |
|
561 <dt><i>item</i></dt> |
|
562 <dd> |
|
563 item to work on |
|
564 </dd> |
|
565 <dt><i>name</i></dt> |
|
566 <dd> |
|
567 filename belonging to this item (string) |
|
568 </dd> |
|
569 <dt><i>recursive</i></dt> |
|
570 <dd> |
|
571 flag indicating a recursive update (boolean) |
|
572 </dd> |
|
573 </dl> |
|
574 <a NAME="ProjectBrowserModel.addNewItem" ID="ProjectBrowserModel.addNewItem"></a> |
|
575 <h4>ProjectBrowserModel.addNewItem</h4> |
|
576 <b>addNewItem</b>(<i>typeString, name, additionalTypeStrings=None</i>) |
|
577 |
|
578 <p> |
|
579 Public method to add a new item to the model. |
|
580 </p> |
|
581 <dl> |
|
582 |
|
583 <dt><i>typeString</i></dt> |
|
584 <dd> |
|
585 string denoting the type of the new item (string) |
|
586 </dd> |
|
587 <dt><i>name</i></dt> |
|
588 <dd> |
|
589 name of the new item (string) |
|
590 </dd> |
|
591 <dt><i>additionalTypeStrings</i></dt> |
|
592 <dd> |
|
593 names of additional types (list of string) |
|
594 </dd> |
|
595 </dl> |
|
596 <a NAME="ProjectBrowserModel.changeVCSStates" ID="ProjectBrowserModel.changeVCSStates"></a> |
|
597 <h4>ProjectBrowserModel.changeVCSStates</h4> |
|
598 <b>changeVCSStates</b>(<i>statesList</i>) |
|
599 |
|
600 <p> |
|
601 Public slot to record the (non normal) VCS states. |
|
602 </p> |
|
603 <dl> |
|
604 |
|
605 <dt><i>statesList</i></dt> |
|
606 <dd> |
|
607 list of VCS state entries (list of strings) giving |
|
608 the states in the first column and the path relative to the project |
|
609 directory starting with the third column. The allowed status flags |
|
610 are: |
|
611 <ul> |
|
612 <li>"A" path was added but not yet comitted</li> |
|
613 <li>"M" path has local changes</li> |
|
614 <li>"O" path was removed</li> |
|
615 <li>"R" path was deleted and then re-added</li> |
|
616 <li>"U" path needs an update</li> |
|
617 <li>"Z" path contains a conflict</li> |
|
618 <li>" " path is back at normal</li> |
|
619 </ul> |
|
620 </dd> |
|
621 </dl> |
|
622 <a NAME="ProjectBrowserModel.data" ID="ProjectBrowserModel.data"></a> |
|
623 <h4>ProjectBrowserModel.data</h4> |
|
624 <b>data</b>(<i>index, role</i>) |
|
625 |
|
626 <p> |
|
627 Public method to get data of an item. |
|
628 </p> |
|
629 <dl> |
|
630 |
|
631 <dt><i>index</i></dt> |
|
632 <dd> |
|
633 index of the data to retrieve (QModelIndex) |
|
634 </dd> |
|
635 <dt><i>role</i></dt> |
|
636 <dd> |
|
637 role of data (Qt.ItemDataRole) |
|
638 </dd> |
|
639 </dl> |
|
640 <dl> |
|
641 <dt>Return:</dt> |
|
642 <dd> |
|
643 requested data |
|
644 </dd> |
|
645 </dl> |
|
646 <a NAME="ProjectBrowserModel.directoryChanged" ID="ProjectBrowserModel.directoryChanged"></a> |
|
647 <h4>ProjectBrowserModel.directoryChanged</h4> |
|
648 <b>directoryChanged</b>(<i>path</i>) |
|
649 |
|
650 <p> |
|
651 Public slot to handle the directoryChanged signal of the watcher. |
|
652 </p> |
|
653 <dl> |
|
654 |
|
655 <dt><i>path</i></dt> |
|
656 <dd> |
|
657 path of the directory (string) |
|
658 </dd> |
|
659 </dl> |
|
660 <a NAME="ProjectBrowserModel.findChildItem" ID="ProjectBrowserModel.findChildItem"></a> |
|
661 <h4>ProjectBrowserModel.findChildItem</h4> |
|
662 <b>findChildItem</b>(<i>text, column, parentItem=None</i>) |
|
663 |
|
664 <p> |
|
665 Public method to find a child item given some text. |
|
666 </p> |
|
667 <dl> |
|
668 |
|
669 <dt><i>text</i></dt> |
|
670 <dd> |
|
671 text to search for (string) |
|
672 </dd> |
|
673 <dt><i>column</i></dt> |
|
674 <dd> |
|
675 column to search in (integer) |
|
676 </dd> |
|
677 <dt><i>parentItem</i></dt> |
|
678 <dd> |
|
679 reference to parent item |
|
680 </dd> |
|
681 </dl> |
|
682 <dl> |
|
683 <dt>Return:</dt> |
|
684 <dd> |
|
685 reference to the item found |
|
686 </dd> |
|
687 </dl> |
|
688 <a NAME="ProjectBrowserModel.findItem" ID="ProjectBrowserModel.findItem"></a> |
|
689 <h4>ProjectBrowserModel.findItem</h4> |
|
690 <b>findItem</b>(<i>name</i>) |
|
691 |
|
692 <p> |
|
693 Public method to find an item given its name. |
|
694 </p> |
|
695 <dl> |
|
696 |
|
697 <dt><i>name</i></dt> |
|
698 <dd> |
|
699 name of the item (string) |
|
700 </dd> |
|
701 </dl> |
|
702 <dl> |
|
703 <dt>Return:</dt> |
|
704 <dd> |
|
705 reference to the item found |
|
706 </dd> |
|
707 </dl> |
|
708 <a NAME="ProjectBrowserModel.findParentItemByName" ID="ProjectBrowserModel.findParentItemByName"></a> |
|
709 <h4>ProjectBrowserModel.findParentItemByName</h4> |
|
710 <b>findParentItemByName</b>(<i>type_, name, dontSplit=False</i>) |
|
711 |
|
712 <p> |
|
713 Public method to find an item given its name. |
|
714 </p> |
|
715 <p> |
|
716 <b>Note</b>: This method creates all necessary parent items, if they |
|
717 don't exist. |
|
718 </p> |
|
719 <dl> |
|
720 |
|
721 <dt><i>type_</i></dt> |
|
722 <dd> |
|
723 type of the item |
|
724 </dd> |
|
725 <dt><i>name</i></dt> |
|
726 <dd> |
|
727 name of the item (string) |
|
728 </dd> |
|
729 <dt><i>dontSplit</i></dt> |
|
730 <dd> |
|
731 flag indicating the name should not be split (boolean) |
|
732 </dd> |
|
733 </dl> |
|
734 <dl> |
|
735 <dt>Return:</dt> |
|
736 <dd> |
|
737 reference to the item found and the new display name (string) |
|
738 </dd> |
|
739 </dl> |
|
740 <a NAME="ProjectBrowserModel.itemIndexByName" ID="ProjectBrowserModel.itemIndexByName"></a> |
|
741 <h4>ProjectBrowserModel.itemIndexByName</h4> |
|
742 <b>itemIndexByName</b>(<i>name</i>) |
|
743 |
|
744 <p> |
|
745 Public method to find an item's index given its name. |
|
746 </p> |
|
747 <dl> |
|
748 |
|
749 <dt><i>name</i></dt> |
|
750 <dd> |
|
751 name of the item (string) |
|
752 </dd> |
|
753 </dl> |
|
754 <dl> |
|
755 <dt>Return:</dt> |
|
756 <dd> |
|
757 index of the item found (QModelIndex) |
|
758 </dd> |
|
759 </dl> |
|
760 <a NAME="ProjectBrowserModel.itemIndexByNameAndLine" ID="ProjectBrowserModel.itemIndexByNameAndLine"></a> |
|
761 <h4>ProjectBrowserModel.itemIndexByNameAndLine</h4> |
|
762 <b>itemIndexByNameAndLine</b>(<i>name, lineno</i>) |
|
763 |
|
764 <p> |
|
765 Public method to find an item's index given its name. |
|
766 </p> |
|
767 <dl> |
|
768 |
|
769 <dt><i>name</i></dt> |
|
770 <dd> |
|
771 name of the item (string) |
|
772 </dd> |
|
773 <dt><i>lineno</i></dt> |
|
774 <dd> |
|
775 one based line number of the item (integer) |
|
776 </dd> |
|
777 </dl> |
|
778 <dl> |
|
779 <dt>Return:</dt> |
|
780 <dd> |
|
781 index of the item found (QModelIndex) |
|
782 </dd> |
|
783 </dl> |
|
784 <a NAME="ProjectBrowserModel.populateItem" ID="ProjectBrowserModel.populateItem"></a> |
|
785 <h4>ProjectBrowserModel.populateItem</h4> |
|
786 <b>populateItem</b>(<i>parentItem, repopulate=False</i>) |
|
787 |
|
788 <p> |
|
789 Public method to populate an item's subtree. |
|
790 </p> |
|
791 <dl> |
|
792 |
|
793 <dt><i>parentItem</i></dt> |
|
794 <dd> |
|
795 reference to the item to be populated |
|
796 </dd> |
|
797 <dt><i>repopulate</i></dt> |
|
798 <dd> |
|
799 flag indicating a repopulation (boolean) |
|
800 </dd> |
|
801 </dl> |
|
802 <a NAME="ProjectBrowserModel.populateProjectDirectoryItem" ID="ProjectBrowserModel.populateProjectDirectoryItem"></a> |
|
803 <h4>ProjectBrowserModel.populateProjectDirectoryItem</h4> |
|
804 <b>populateProjectDirectoryItem</b>(<i>parentItem, repopulate=False</i>) |
|
805 |
|
806 <p> |
|
807 Public method to populate a directory item's subtree. |
|
808 </p> |
|
809 <dl> |
|
810 |
|
811 <dt><i>parentItem</i></dt> |
|
812 <dd> |
|
813 reference to the directory item to be populated |
|
814 </dd> |
|
815 <dt><i>repopulate</i></dt> |
|
816 <dd> |
|
817 flag indicating a repopulation (boolean) |
|
818 </dd> |
|
819 </dl> |
|
820 <a NAME="ProjectBrowserModel.preferencesChanged" ID="ProjectBrowserModel.preferencesChanged"></a> |
|
821 <h4>ProjectBrowserModel.preferencesChanged</h4> |
|
822 <b>preferencesChanged</b>(<i></i>) |
|
823 |
|
824 <p> |
|
825 Public method used to handle a change in preferences. |
|
826 </p> |
|
827 <a NAME="ProjectBrowserModel.projectClosed" ID="ProjectBrowserModel.projectClosed"></a> |
|
828 <h4>ProjectBrowserModel.projectClosed</h4> |
|
829 <b>projectClosed</b>(<i></i>) |
|
830 |
|
831 <p> |
|
832 Public method called after a project has been closed. |
|
833 </p> |
|
834 <a NAME="ProjectBrowserModel.projectOpened" ID="ProjectBrowserModel.projectOpened"></a> |
|
835 <h4>ProjectBrowserModel.projectOpened</h4> |
|
836 <b>projectOpened</b>(<i></i>) |
|
837 |
|
838 <p> |
|
839 Public method used to populate the model after a project has been |
|
840 opened. |
|
841 </p> |
|
842 <a NAME="ProjectBrowserModel.projectPropertiesChanged" ID="ProjectBrowserModel.projectPropertiesChanged"></a> |
|
843 <h4>ProjectBrowserModel.projectPropertiesChanged</h4> |
|
844 <b>projectPropertiesChanged</b>(<i></i>) |
|
845 |
|
846 <p> |
|
847 Public method to react on a change of the project properties. |
|
848 </p> |
|
849 <a NAME="ProjectBrowserModel.removeItem" ID="ProjectBrowserModel.removeItem"></a> |
|
850 <h4>ProjectBrowserModel.removeItem</h4> |
|
851 <b>removeItem</b>(<i>name</i>) |
|
852 |
|
853 <p> |
|
854 Public method to remove a named item. |
|
855 </p> |
|
856 <dl> |
|
857 |
|
858 <dt><i>name</i></dt> |
|
859 <dd> |
|
860 file or directory name of the item (string). |
|
861 </dd> |
|
862 </dl> |
|
863 <a NAME="ProjectBrowserModel.renameItem" ID="ProjectBrowserModel.renameItem"></a> |
|
864 <h4>ProjectBrowserModel.renameItem</h4> |
|
865 <b>renameItem</b>(<i>name, newFilename</i>) |
|
866 |
|
867 <p> |
|
868 Public method to rename an item. |
|
869 </p> |
|
870 <dl> |
|
871 |
|
872 <dt><i>name</i></dt> |
|
873 <dd> |
|
874 the old display name (string) |
|
875 </dd> |
|
876 <dt><i>newFilename</i></dt> |
|
877 <dd> |
|
878 new filename of the item (string) |
|
879 </dd> |
|
880 </dl> |
|
881 <a NAME="ProjectBrowserModel.repopulateItem" ID="ProjectBrowserModel.repopulateItem"></a> |
|
882 <h4>ProjectBrowserModel.repopulateItem</h4> |
|
883 <b>repopulateItem</b>(<i>name</i>) |
|
884 |
|
885 <p> |
|
886 Public method to repopulate an item. |
|
887 </p> |
|
888 <dl> |
|
889 |
|
890 <dt><i>name</i></dt> |
|
891 <dd> |
|
892 name of the file relative to the project root (string) |
|
893 </dd> |
|
894 </dl> |
|
895 <a NAME="ProjectBrowserModel.startFileSystemMonitoring" ID="ProjectBrowserModel.startFileSystemMonitoring"></a> |
|
896 <h4>ProjectBrowserModel.startFileSystemMonitoring</h4> |
|
897 <b>startFileSystemMonitoring</b>(<i></i>) |
|
898 |
|
899 <p> |
|
900 Public method to (re)start monitoring the project file system. |
|
901 </p> |
|
902 <a NAME="ProjectBrowserModel.stopFileSystemMonitoring" ID="ProjectBrowserModel.stopFileSystemMonitoring"></a> |
|
903 <h4>ProjectBrowserModel.stopFileSystemMonitoring</h4> |
|
904 <b>stopFileSystemMonitoring</b>(<i></i>) |
|
905 |
|
906 <p> |
|
907 Public method to stop monitoring the project file system. |
|
908 </p> |
|
909 <a NAME="ProjectBrowserModel.updateVCSStatus" ID="ProjectBrowserModel.updateVCSStatus"></a> |
|
910 <h4>ProjectBrowserModel.updateVCSStatus</h4> |
|
911 <b>updateVCSStatus</b>(<i>name, recursive=True</i>) |
|
912 |
|
913 <p> |
|
914 Public method used to update the vcs status of a node. |
|
915 </p> |
|
916 <dl> |
|
917 |
|
918 <dt><i>name</i></dt> |
|
919 <dd> |
|
920 filename belonging to this item (string) |
|
921 </dd> |
|
922 <dt><i>recursive</i></dt> |
|
923 <dd> |
|
924 flag indicating a recursive update (boolean) |
|
925 </dd> |
|
926 </dl> |
|
927 <div align="right"><a href="#top">Up</a></div> |
|
928 <hr /> |
|
929 <hr /> |
|
930 <a NAME="ProjectBrowserSimpleDirectoryItem" ID="ProjectBrowserSimpleDirectoryItem"></a> |
|
931 <h2>ProjectBrowserSimpleDirectoryItem</h2> |
|
932 |
|
933 <p> |
|
934 Class implementing the data structure for project browser simple directory |
|
935 items. |
|
936 </p> |
|
937 <h3>Derived from</h3> |
|
938 BrowserItem, ProjectBrowserItemMixin |
|
939 <h3>Class Attributes</h3> |
|
940 |
|
941 <table> |
|
942 <tr><td>None</td></tr> |
|
943 </table> |
|
944 <h3>Class Methods</h3> |
|
945 |
|
946 <table> |
|
947 <tr><td>None</td></tr> |
|
948 </table> |
|
949 <h3>Methods</h3> |
|
950 |
|
951 <table> |
|
952 |
|
953 <tr> |
|
954 <td><a href="#ProjectBrowserSimpleDirectoryItem.__init__">ProjectBrowserSimpleDirectoryItem</a></td> |
|
955 <td>Constructor</td> |
|
956 </tr> |
|
957 <tr> |
|
958 <td><a href="#ProjectBrowserSimpleDirectoryItem.dirName">dirName</a></td> |
|
959 <td>Public method returning the directory name.</td> |
|
960 </tr> |
|
961 <tr> |
|
962 <td><a href="#ProjectBrowserSimpleDirectoryItem.lessThan">lessThan</a></td> |
|
963 <td>Public method to check, if the item is less than the other one.</td> |
|
964 </tr> |
|
965 <tr> |
|
966 <td><a href="#ProjectBrowserSimpleDirectoryItem.name">name</a></td> |
|
967 <td>Public method to return the name of the item.</td> |
|
968 </tr> |
|
969 <tr> |
|
970 <td><a href="#ProjectBrowserSimpleDirectoryItem.setName">setName</a></td> |
|
971 <td>Public method to set the directory name.</td> |
|
972 </tr> |
|
973 </table> |
|
974 <h3>Static Methods</h3> |
|
975 |
|
976 <table> |
|
977 <tr><td>None</td></tr> |
|
978 </table> |
|
979 |
|
980 <a NAME="ProjectBrowserSimpleDirectoryItem.__init__" ID="ProjectBrowserSimpleDirectoryItem.__init__"></a> |
|
981 <h4>ProjectBrowserSimpleDirectoryItem (Constructor)</h4> |
|
982 <b>ProjectBrowserSimpleDirectoryItem</b>(<i>parent, projectType, text, path=""</i>) |
|
983 |
|
984 <p> |
|
985 Constructor |
|
986 </p> |
|
987 <dl> |
|
988 |
|
989 <dt><i>parent</i></dt> |
|
990 <dd> |
|
991 parent item |
|
992 </dd> |
|
993 <dt><i>projectType</i></dt> |
|
994 <dd> |
|
995 type of file/directory in the project |
|
996 </dd> |
|
997 <dt><i>text</i></dt> |
|
998 <dd> |
|
999 text to be displayed (string) |
|
1000 </dd> |
|
1001 <dt><i>path</i></dt> |
|
1002 <dd> |
|
1003 path of the directory (string) |
|
1004 </dd> |
|
1005 </dl> |
|
1006 <a NAME="ProjectBrowserSimpleDirectoryItem.dirName" ID="ProjectBrowserSimpleDirectoryItem.dirName"></a> |
|
1007 <h4>ProjectBrowserSimpleDirectoryItem.dirName</h4> |
|
1008 <b>dirName</b>(<i></i>) |
|
1009 |
|
1010 <p> |
|
1011 Public method returning the directory name. |
|
1012 </p> |
|
1013 <dl> |
|
1014 <dt>Return:</dt> |
|
1015 <dd> |
|
1016 directory name (string) |
|
1017 </dd> |
|
1018 </dl> |
|
1019 <a NAME="ProjectBrowserSimpleDirectoryItem.lessThan" ID="ProjectBrowserSimpleDirectoryItem.lessThan"></a> |
|
1020 <h4>ProjectBrowserSimpleDirectoryItem.lessThan</h4> |
|
1021 <b>lessThan</b>(<i>other, column, order</i>) |
|
1022 |
|
1023 <p> |
|
1024 Public method to check, if the item is less than the other one. |
|
1025 </p> |
|
1026 <dl> |
|
1027 |
|
1028 <dt><i>other</i></dt> |
|
1029 <dd> |
|
1030 reference to item to compare against (BrowserItem) |
|
1031 </dd> |
|
1032 <dt><i>column</i></dt> |
|
1033 <dd> |
|
1034 column number to use for the comparison (integer) |
|
1035 </dd> |
|
1036 <dt><i>order</i></dt> |
|
1037 <dd> |
|
1038 sort order (Qt.SortOrder) (for special sorting) |
|
1039 </dd> |
|
1040 </dl> |
|
1041 <dl> |
|
1042 <dt>Return:</dt> |
|
1043 <dd> |
|
1044 true, if this item is less than other (boolean) |
|
1045 </dd> |
|
1046 </dl> |
|
1047 <a NAME="ProjectBrowserSimpleDirectoryItem.name" ID="ProjectBrowserSimpleDirectoryItem.name"></a> |
|
1048 <h4>ProjectBrowserSimpleDirectoryItem.name</h4> |
|
1049 <b>name</b>(<i></i>) |
|
1050 |
|
1051 <p> |
|
1052 Public method to return the name of the item. |
|
1053 </p> |
|
1054 <dl> |
|
1055 <dt>Return:</dt> |
|
1056 <dd> |
|
1057 name of the item (string) |
|
1058 </dd> |
|
1059 </dl> |
|
1060 <a NAME="ProjectBrowserSimpleDirectoryItem.setName" ID="ProjectBrowserSimpleDirectoryItem.setName"></a> |
|
1061 <h4>ProjectBrowserSimpleDirectoryItem.setName</h4> |
|
1062 <b>setName</b>(<i>dinfo, full=True</i>) |
|
1063 |
|
1064 <p> |
|
1065 Public method to set the directory name. |
|
1066 </p> |
|
1067 <dl> |
|
1068 |
|
1069 <dt><i>dinfo</i></dt> |
|
1070 <dd> |
|
1071 dinfo is the string for the directory (string) |
|
1072 </dd> |
|
1073 <dt><i>full</i></dt> |
|
1074 <dd> |
|
1075 flag indicating full pathname should be displayed (boolean) |
|
1076 </dd> |
|
1077 </dl> |
|
1078 <div align="right"><a href="#top">Up</a></div> |
|
1079 <hr /> |
|
1080 </body></html> |