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