|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.WebBrowser.TabManager.TabManagerWidget</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.WebBrowser.TabManager.TabManagerWidget</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a window for managing the web browser tabs. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#TabManagerWidget">TabManagerWidget</a></td> |
|
25 <td>Class implementing a window for managing the web browser tabs.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="TabManagerWidget" ID="TabManagerWidget"></a> |
|
36 <h2>TabManagerWidget</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing a window for managing the web browser tabs. |
|
40 </p> |
|
41 <h3>Signals</h3> |
|
42 <dl> |
|
43 |
|
44 <dt>groupTypeChanged(int)</dt> |
|
45 <dd> |
|
46 emitted when the 'Group By' value was changed |
|
47 </dd> |
|
48 </dl> |
|
49 <h3>Derived from</h3> |
|
50 QWidget |
|
51 <h3>Class Attributes</h3> |
|
52 |
|
53 <table> |
|
54 <tr><td>GroupByDomain</td></tr><tr><td>GroupByHost</td></tr><tr><td>GroupByWindow</td></tr><tr><td>WebBrowserRole</td></tr><tr><td>WebWindowRole</td></tr><tr><td>_tldExtractor</td></tr> |
|
55 </table> |
|
56 <h3>Class Methods</h3> |
|
57 |
|
58 <table> |
|
59 <tr><td>None</td></tr> |
|
60 </table> |
|
61 <h3>Methods</h3> |
|
62 |
|
63 <table> |
|
64 |
|
65 <tr> |
|
66 <td><a href="#TabManagerWidget.__init__">TabManagerWidget</a></td> |
|
67 <td>Constructor</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#TabManagerWidget.__createEmptyItem">__createEmptyItem</a></td> |
|
71 <td>Private method to create an empty tree item.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#TabManagerWidget.__customContextMenuRequested">__customContextMenuRequested</a></td> |
|
75 <td>Private slot to show the context menu.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#TabManagerWidget.__groupByDomainName">__groupByDomainName</a></td> |
|
79 <td>Private method to group the tree items by domain name.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#TabManagerWidget.__groupByWindow">__groupByWindow</a></td> |
|
83 <td>Private method to group the tree items by window.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#TabManagerWidget.__isBrowserSelected">__isBrowserSelected</a></td> |
|
87 <td>Private slot to check, if any browser entry is selected.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#TabManagerWidget.__itemDoubleClicked">__itemDoubleClicked</a></td> |
|
91 <td>Private slot to handle double clicking a tree item.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#TabManagerWidget.__makeWebBrowserViewConnections">__makeWebBrowserViewConnections</a></td> |
|
95 <td>Private method to create the signal connections to the web view.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#TabManagerWidget.__processActions">__processActions</a></td> |
|
99 <td>Private slot to process the actions.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#TabManagerWidget.__refreshTree">__refreshTree</a></td> |
|
103 <td>Private slot to referesh the tree.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#TabManagerWidget.__setGroupType">__setGroupType</a></td> |
|
107 <td>Private method to set the 'Group By' type.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#TabManagerWidget.bookmarkSelectedBrowsers">bookmarkSelectedBrowsers</a></td> |
|
111 <td>Public method to bookmark the selected browsers.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#TabManagerWidget.changeGroupType">changeGroupType</a></td> |
|
115 <td>Public slot to change the 'Group By' type.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#TabManagerWidget.closeSelectedBrowsers">closeSelectedBrowsers</a></td> |
|
119 <td>Public method to close the selected browsers.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#TabManagerWidget.createStatusBarIcon">createStatusBarIcon</a></td> |
|
123 <td>Public method to create a status bar icon.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#TabManagerWidget.delayedRefreshTree">delayedRefreshTree</a></td> |
|
127 <td>Public slot to do a delyed refresh of the tree.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#TabManagerWidget.domainFromUrl">domainFromUrl</a></td> |
|
131 <td>Public method to extract the domain from an URL.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#TabManagerWidget.mainWindowCreated">mainWindowCreated</a></td> |
|
135 <td>Public method to act on the creation of a new web browser window.</td> |
|
136 </tr> |
|
137 <tr> |
|
138 <td><a href="#TabManagerWidget.raiseTabManager">raiseTabManager</a></td> |
|
139 <td>Public slot to show the tab manager.</td> |
|
140 </tr> |
|
141 </table> |
|
142 <h3>Static Methods</h3> |
|
143 |
|
144 <table> |
|
145 <tr><td>None</td></tr> |
|
146 </table> |
|
147 |
|
148 <a NAME="TabManagerWidget.__init__" ID="TabManagerWidget.__init__"></a> |
|
149 <h4>TabManagerWidget (Constructor)</h4> |
|
150 <b>TabManagerWidget</b>(<i>mainWindow, parent=None, defaultWidget=False</i>) |
|
151 |
|
152 <p> |
|
153 Constructor |
|
154 </p> |
|
155 <dl> |
|
156 |
|
157 <dt><i>mainWindow</i> (WebBrowserWindow)</dt> |
|
158 <dd> |
|
159 reference to the main window |
|
160 </dd> |
|
161 <dt><i>parent</i> (QWidget)</dt> |
|
162 <dd> |
|
163 reference to the parent widget |
|
164 </dd> |
|
165 <dt><i>defaultWidget</i> (bool)</dt> |
|
166 <dd> |
|
167 flag indicating the default widget |
|
168 </dd> |
|
169 </dl> |
|
170 <a NAME="TabManagerWidget.__createEmptyItem" ID="TabManagerWidget.__createEmptyItem"></a> |
|
171 <h4>TabManagerWidget.__createEmptyItem</h4> |
|
172 <b>__createEmptyItem</b>(<i>parent=None, addToTree=True</i>) |
|
173 |
|
174 <p> |
|
175 Private method to create an empty tree item. |
|
176 </p> |
|
177 <dl> |
|
178 |
|
179 <dt><i>parent</i> (QTreeWidgetItem or QTreeWidget)</dt> |
|
180 <dd> |
|
181 reference to the parent item |
|
182 </dd> |
|
183 <dt><i>addToTree</i> (bool)</dt> |
|
184 <dd> |
|
185 flag indicating to add the item to the tree |
|
186 </dd> |
|
187 </dl> |
|
188 <dl> |
|
189 <dt>Return:</dt> |
|
190 <dd> |
|
191 created item |
|
192 </dd> |
|
193 </dl> |
|
194 <dl> |
|
195 <dt>Return Type:</dt> |
|
196 <dd> |
|
197 QTreeWidgetItem |
|
198 </dd> |
|
199 </dl> |
|
200 <a NAME="TabManagerWidget.__customContextMenuRequested" ID="TabManagerWidget.__customContextMenuRequested"></a> |
|
201 <h4>TabManagerWidget.__customContextMenuRequested</h4> |
|
202 <b>__customContextMenuRequested</b>(<i>pos</i>) |
|
203 |
|
204 <p> |
|
205 Private slot to show the context menu. |
|
206 </p> |
|
207 <dl> |
|
208 |
|
209 <dt><i>pos</i> (QPoint)</dt> |
|
210 <dd> |
|
211 position the menu should be shown at |
|
212 </dd> |
|
213 </dl> |
|
214 <a NAME="TabManagerWidget.__groupByDomainName" ID="TabManagerWidget.__groupByDomainName"></a> |
|
215 <h4>TabManagerWidget.__groupByDomainName</h4> |
|
216 <b>__groupByDomainName</b>(<i>useHostName=False</i>) |
|
217 |
|
218 <p> |
|
219 Private method to group the tree items by domain name. |
|
220 </p> |
|
221 <dl> |
|
222 |
|
223 <dt><i>useHostName</i> (bool)</dt> |
|
224 <dd> |
|
225 flag indicating to use the host name |
|
226 </dd> |
|
227 </dl> |
|
228 <a NAME="TabManagerWidget.__groupByWindow" ID="TabManagerWidget.__groupByWindow"></a> |
|
229 <h4>TabManagerWidget.__groupByWindow</h4> |
|
230 <b>__groupByWindow</b>(<i></i>) |
|
231 |
|
232 <p> |
|
233 Private method to group the tree items by window. |
|
234 </p> |
|
235 <a NAME="TabManagerWidget.__isBrowserSelected" ID="TabManagerWidget.__isBrowserSelected"></a> |
|
236 <h4>TabManagerWidget.__isBrowserSelected</h4> |
|
237 <b>__isBrowserSelected</b>(<i></i>) |
|
238 |
|
239 <p> |
|
240 Private slot to check, if any browser entry is selected. |
|
241 </p> |
|
242 <dl> |
|
243 <dt>Return:</dt> |
|
244 <dd> |
|
245 flag indicating the existence of a selected entry |
|
246 </dd> |
|
247 </dl> |
|
248 <dl> |
|
249 <dt>Return Type:</dt> |
|
250 <dd> |
|
251 bool |
|
252 </dd> |
|
253 </dl> |
|
254 <a NAME="TabManagerWidget.__itemDoubleClicked" ID="TabManagerWidget.__itemDoubleClicked"></a> |
|
255 <h4>TabManagerWidget.__itemDoubleClicked</h4> |
|
256 <b>__itemDoubleClicked</b>(<i>itm, column</i>) |
|
257 |
|
258 <p> |
|
259 Private slot to handle double clicking a tree item. |
|
260 </p> |
|
261 <dl> |
|
262 |
|
263 <dt><i>itm</i> (QTreeWidgetItem)</dt> |
|
264 <dd> |
|
265 reference to the item having been double clicked |
|
266 </dd> |
|
267 <dt><i>column</i> (int)</dt> |
|
268 <dd> |
|
269 column of the double click |
|
270 </dd> |
|
271 </dl> |
|
272 <a NAME="TabManagerWidget.__makeWebBrowserViewConnections" ID="TabManagerWidget.__makeWebBrowserViewConnections"></a> |
|
273 <h4>TabManagerWidget.__makeWebBrowserViewConnections</h4> |
|
274 <b>__makeWebBrowserViewConnections</b>(<i>view</i>) |
|
275 |
|
276 <p> |
|
277 Private method to create the signal connections to the web view. |
|
278 </p> |
|
279 <dl> |
|
280 |
|
281 <dt><i>view</i> (WebBrowserView)</dt> |
|
282 <dd> |
|
283 reference to the web view |
|
284 </dd> |
|
285 </dl> |
|
286 <a NAME="TabManagerWidget.__processActions" ID="TabManagerWidget.__processActions"></a> |
|
287 <h4>TabManagerWidget.__processActions</h4> |
|
288 <b>__processActions</b>(<i>act</i>) |
|
289 |
|
290 <p> |
|
291 Private slot to process the actions. |
|
292 </p> |
|
293 <dl> |
|
294 |
|
295 <dt><i>act</i> (QAction)</dt> |
|
296 <dd> |
|
297 reference to the action that triggered |
|
298 </dd> |
|
299 </dl> |
|
300 <a NAME="TabManagerWidget.__refreshTree" ID="TabManagerWidget.__refreshTree"></a> |
|
301 <h4>TabManagerWidget.__refreshTree</h4> |
|
302 <b>__refreshTree</b>(<i></i>) |
|
303 |
|
304 <p> |
|
305 Private slot to referesh the tree. |
|
306 </p> |
|
307 <a NAME="TabManagerWidget.__setGroupType" ID="TabManagerWidget.__setGroupType"></a> |
|
308 <h4>TabManagerWidget.__setGroupType</h4> |
|
309 <b>__setGroupType</b>(<i>groupType</i>) |
|
310 |
|
311 <p> |
|
312 Private method to set the 'Group By' type. |
|
313 </p> |
|
314 <dl> |
|
315 |
|
316 <dt><i>groupType</i> (int (0 - 2))</dt> |
|
317 <dd> |
|
318 'Group By' type to be set |
|
319 </dd> |
|
320 </dl> |
|
321 <a NAME="TabManagerWidget.bookmarkSelectedBrowsers" ID="TabManagerWidget.bookmarkSelectedBrowsers"></a> |
|
322 <h4>TabManagerWidget.bookmarkSelectedBrowsers</h4> |
|
323 <b>bookmarkSelectedBrowsers</b>(<i>browsersDict</i>) |
|
324 |
|
325 <p> |
|
326 Public method to bookmark the selected browsers. |
|
327 </p> |
|
328 <dl> |
|
329 |
|
330 <dt><i>browsersDict</i> (dict with WebBrowserWindow as key and list of WebBrowserView)</dt> |
|
331 <dd> |
|
332 dictionary containing the browsers per window |
|
333 as value |
|
334 </dd> |
|
335 </dl> |
|
336 <a NAME="TabManagerWidget.changeGroupType" ID="TabManagerWidget.changeGroupType"></a> |
|
337 <h4>TabManagerWidget.changeGroupType</h4> |
|
338 <b>changeGroupType</b>(<i>act</i>) |
|
339 |
|
340 <p> |
|
341 Public slot to change the 'Group By' type. |
|
342 </p> |
|
343 <dl> |
|
344 |
|
345 <dt><i>act</i> (QAction)</dt> |
|
346 <dd> |
|
347 reference to the action that was triggered |
|
348 </dd> |
|
349 </dl> |
|
350 <a NAME="TabManagerWidget.closeSelectedBrowsers" ID="TabManagerWidget.closeSelectedBrowsers"></a> |
|
351 <h4>TabManagerWidget.closeSelectedBrowsers</h4> |
|
352 <b>closeSelectedBrowsers</b>(<i>browsersDict</i>) |
|
353 |
|
354 <p> |
|
355 Public method to close the selected browsers. |
|
356 </p> |
|
357 <dl> |
|
358 |
|
359 <dt><i>browsersDict</i> (dict with WebBrowserWindow as key and list of WebBrowserView)</dt> |
|
360 <dd> |
|
361 dictionary containing the browsers per window |
|
362 as value |
|
363 </dd> |
|
364 </dl> |
|
365 <a NAME="TabManagerWidget.createStatusBarIcon" ID="TabManagerWidget.createStatusBarIcon"></a> |
|
366 <h4>TabManagerWidget.createStatusBarIcon</h4> |
|
367 <b>createStatusBarIcon</b>(<i></i>) |
|
368 |
|
369 <p> |
|
370 Public method to create a status bar icon. |
|
371 </p> |
|
372 <dl> |
|
373 <dt>Return:</dt> |
|
374 <dd> |
|
375 generated icon |
|
376 </dd> |
|
377 </dl> |
|
378 <dl> |
|
379 <dt>Return Type:</dt> |
|
380 <dd> |
|
381 EricClickableLabel |
|
382 </dd> |
|
383 </dl> |
|
384 <a NAME="TabManagerWidget.delayedRefreshTree" ID="TabManagerWidget.delayedRefreshTree"></a> |
|
385 <h4>TabManagerWidget.delayedRefreshTree</h4> |
|
386 <b>delayedRefreshTree</b>(<i>page=None</i>) |
|
387 |
|
388 <p> |
|
389 Public slot to do a delyed refresh of the tree. |
|
390 </p> |
|
391 <dl> |
|
392 |
|
393 <dt><i>page</i> (WebBrowserPage)</dt> |
|
394 <dd> |
|
395 reference to the web page |
|
396 </dd> |
|
397 </dl> |
|
398 <a NAME="TabManagerWidget.domainFromUrl" ID="TabManagerWidget.domainFromUrl"></a> |
|
399 <h4>TabManagerWidget.domainFromUrl</h4> |
|
400 <b>domainFromUrl</b>(<i>url, useHostName=False</i>) |
|
401 |
|
402 <p> |
|
403 Public method to extract the domain from an URL. |
|
404 </p> |
|
405 <dl> |
|
406 |
|
407 <dt><i>url</i> (QUrl)</dt> |
|
408 <dd> |
|
409 URL to extract the domain from |
|
410 </dd> |
|
411 <dt><i>useHostName</i> (bool)</dt> |
|
412 <dd> |
|
413 flag indicating to use the host name |
|
414 </dd> |
|
415 </dl> |
|
416 <dl> |
|
417 <dt>Return:</dt> |
|
418 <dd> |
|
419 domain name |
|
420 </dd> |
|
421 </dl> |
|
422 <dl> |
|
423 <dt>Return Type:</dt> |
|
424 <dd> |
|
425 str |
|
426 </dd> |
|
427 </dl> |
|
428 <a NAME="TabManagerWidget.mainWindowCreated" ID="TabManagerWidget.mainWindowCreated"></a> |
|
429 <h4>TabManagerWidget.mainWindowCreated</h4> |
|
430 <b>mainWindowCreated</b>(<i>mainWin, refresh=True</i>) |
|
431 |
|
432 <p> |
|
433 Public method to act on the creation of a new web browser window. |
|
434 </p> |
|
435 <dl> |
|
436 |
|
437 <dt><i>mainWin</i> (WebBrowserWindow)</dt> |
|
438 <dd> |
|
439 reference to the web browser window |
|
440 </dd> |
|
441 <dt><i>refresh</i> (bool)</dt> |
|
442 <dd> |
|
443 flag indicating to refresh the widget |
|
444 </dd> |
|
445 </dl> |
|
446 <a NAME="TabManagerWidget.raiseTabManager" ID="TabManagerWidget.raiseTabManager"></a> |
|
447 <h4>TabManagerWidget.raiseTabManager</h4> |
|
448 <b>raiseTabManager</b>(<i>icon</i>) |
|
449 |
|
450 <p> |
|
451 Public slot to show the tab manager. |
|
452 </p> |
|
453 <dl> |
|
454 |
|
455 <dt><i>icon</i> (EricClickableLabel or QAction)</dt> |
|
456 <dd> |
|
457 reference to the clicked icon |
|
458 </dd> |
|
459 </dl> |
|
460 <div align="right"><a href="#top">Up</a></div> |
|
461 <hr /> |
|
462 </body></html> |