eric6/Documentation/Source/eric6.WebBrowser.Download.DownloadManager.html

branch
maintenance
changeset 6989
8b8cadf8d7e9
parent 6942
2602857055c5
child 7273
391d6b7b1eff
equal deleted inserted replaced
6938:7926553b7509 6989:8b8cadf8d7e9
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.WebBrowser.Download.DownloadManager</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><a NAME="top" ID="top"></a>
22 <h1>eric6.WebBrowser.Download.DownloadManager</h1>
23 <p>
24 Module implementing the download manager class.
25 </p>
26 <h3>Global Attributes</h3>
27 <table>
28 <tr><td>None</td></tr>
29 </table>
30 <h3>Classes</h3>
31 <table>
32 <tr>
33 <td><a href="#DownloadManager">DownloadManager</a></td>
34 <td>Class implementing the download manager.</td>
35 </tr>
36 </table>
37 <h3>Functions</h3>
38 <table>
39 <tr><td>None</td></tr>
40 </table>
41 <hr /><hr />
42 <a NAME="DownloadManager" ID="DownloadManager"></a>
43 <h2>DownloadManager</h2>
44 <p>
45 Class implementing the download manager.
46 </p><h3>Signals</h3>
47 <dl>
48 <dt>downloadsCountChanged()</dt>
49 <dd>
50 emitted to indicate a change of the
51 count of download items
52 </dd>
53 </dl>
54 <h3>Derived from</h3>
55 QDialog, Ui_DownloadManager
56 <h3>Class Attributes</h3>
57 <table>
58 <tr><td>RemoveExit</td></tr><tr><td>RemoveNever</td></tr><tr><td>RemoveSuccessFullDownload</td></tr><tr><td>UpdateTimerTimeout</td></tr>
59 </table>
60 <h3>Class Methods</h3>
61 <table>
62 <tr><td>None</td></tr>
63 </table>
64 <h3>Methods</h3>
65 <table>
66 <tr>
67 <td><a href="#DownloadManager.__init__">DownloadManager</a></td>
68 <td>Constructor</td>
69 </tr><tr>
70 <td><a href="#DownloadManager.__addItem">__addItem</a></td>
71 <td>Private method to add a download to the list of downloads.</td>
72 </tr><tr>
73 <td><a href="#DownloadManager.__closeDownloadTab">__closeDownloadTab</a></td>
74 <td>Private method to close an empty tab, that was opened only for loading the download URL.</td>
75 </tr><tr>
76 <td><a href="#DownloadManager.__contextMenuCancel">__contextMenuCancel</a></td>
77 <td>Private method to cancel the current download.</td>
78 </tr><tr>
79 <td><a href="#DownloadManager.__contextMenuCopyLink">__contextMenuCopyLink</a></td>
80 <td>Private method to copy the download link to the clipboard.</td>
81 </tr><tr>
82 <td><a href="#DownloadManager.__contextMenuGotoPage">__contextMenuGotoPage</a></td>
83 <td>Private method to open the download page.</td>
84 </tr><tr>
85 <td><a href="#DownloadManager.__contextMenuOpen">__contextMenuOpen</a></td>
86 <td>Private method to open the downloaded file.</td>
87 </tr><tr>
88 <td><a href="#DownloadManager.__contextMenuOpenFolder">__contextMenuOpenFolder</a></td>
89 <td>Private method to open the folder containing the downloaded file.</td>
90 </tr><tr>
91 <td><a href="#DownloadManager.__contextMenuRemoveSelected">__contextMenuRemoveSelected</a></td>
92 <td>Private method to remove the selected downloads from the list.</td>
93 </tr><tr>
94 <td><a href="#DownloadManager.__contextMenuSelectAll">__contextMenuSelectAll</a></td>
95 <td>Private method to select all downloads.</td>
96 </tr><tr>
97 <td><a href="#DownloadManager.__currentItem">__currentItem</a></td>
98 <td>Private method to get a reference to the current item.</td>
99 </tr><tr>
100 <td><a href="#DownloadManager.__customContextMenuRequested">__customContextMenuRequested</a></td>
101 <td>Private slot to handle the context menu request for the bookmarks tree.</td>
102 </tr><tr>
103 <td><a href="#DownloadManager.__finished">__finished</a></td>
104 <td>Private slot to handle a finished download.</td>
105 </tr><tr>
106 <td><a href="#DownloadManager.__load">__load</a></td>
107 <td>Private method to load the download settings.</td>
108 </tr><tr>
109 <td><a href="#DownloadManager.__startUpdateTimer">__startUpdateTimer</a></td>
110 <td>Private slot to start the update timer.</td>
111 </tr><tr>
112 <td><a href="#DownloadManager.__stopUpdateTimer">__stopUpdateTimer</a></td>
113 <td>Private slot to stop the update timer.</td>
114 </tr><tr>
115 <td><a href="#DownloadManager.__taskbarButton">__taskbarButton</a></td>
116 <td>Private method to get a reference to the task bar button (Windows only).</td>
117 </tr><tr>
118 <td><a href="#DownloadManager.__testWebBrowserView">__testWebBrowserView</a></td>
119 <td>Private method to test a web browser view against an URL.</td>
120 </tr><tr>
121 <td><a href="#DownloadManager.__updateRow">__updateRow</a></td>
122 <td>Private slot to update a download item.</td>
123 </tr><tr>
124 <td><a href="#DownloadManager.activeDownloadsCount">activeDownloadsCount</a></td>
125 <td>Public method to get the number of active downloads.</td>
126 </tr><tr>
127 <td><a href="#DownloadManager.allowQuit">allowQuit</a></td>
128 <td>Public method to check, if it is ok to quit.</td>
129 </tr><tr>
130 <td><a href="#DownloadManager.changeOccurred">changeOccurred</a></td>
131 <td>Public method to signal a change.</td>
132 </tr><tr>
133 <td><a href="#DownloadManager.cleanup">cleanup</a></td>
134 <td>Public slot to cleanup the downloads.</td>
135 </tr><tr>
136 <td><a href="#DownloadManager.closeEvent">closeEvent</a></td>
137 <td>Protected event handler for the close event.</td>
138 </tr><tr>
139 <td><a href="#DownloadManager.download">download</a></td>
140 <td>Public method to download a file.</td>
141 </tr><tr>
142 <td><a href="#DownloadManager.downloadDirectory">downloadDirectory</a></td>
143 <td>Public method to get the current download directory.</td>
144 </tr><tr>
145 <td><a href="#DownloadManager.downloads">downloads</a></td>
146 <td>Public method to get a reference to the downloads.</td>
147 </tr><tr>
148 <td><a href="#DownloadManager.downloadsCount">downloadsCount</a></td>
149 <td>Public method to get the number of downloads.</td>
150 </tr><tr>
151 <td><a href="#DownloadManager.on_cleanupButton_clicked">on_cleanupButton_clicked</a></td>
152 <td>Private slot to cleanup the downloads.</td>
153 </tr><tr>
154 <td><a href="#DownloadManager.removePolicy">removePolicy</a></td>
155 <td>Public method to get the remove policy.</td>
156 </tr><tr>
157 <td><a href="#DownloadManager.save">save</a></td>
158 <td>Public method to save the download settings.</td>
159 </tr><tr>
160 <td><a href="#DownloadManager.setDownloadDirectory">setDownloadDirectory</a></td>
161 <td>Public method to set the current download directory.</td>
162 </tr><tr>
163 <td><a href="#DownloadManager.setRemovePolicy">setRemovePolicy</a></td>
164 <td>Public method to set the remove policy.</td>
165 </tr><tr>
166 <td><a href="#DownloadManager.show">show</a></td>
167 <td>Public slot to show the download manager dialog.</td>
168 </tr><tr>
169 <td><a href="#DownloadManager.shutdown">shutdown</a></td>
170 <td>Public method to stop the download manager.</td>
171 </tr><tr>
172 <td><a href="#DownloadManager.timerEvent">timerEvent</a></td>
173 <td>Protected event handler for timer events.</td>
174 </tr>
175 </table>
176 <h3>Static Methods</h3>
177 <table>
178 <tr><td>None</td></tr>
179 </table>
180 <a NAME="DownloadManager.__init__" ID="DownloadManager.__init__"></a>
181 <h4>DownloadManager (Constructor)</h4>
182 <b>DownloadManager</b>(<i>parent=None</i>)
183 <p>
184 Constructor
185 </p><dl>
186 <dt><i>parent</i></dt>
187 <dd>
188 reference to the parent widget (QWidget)
189 </dd>
190 </dl><a NAME="DownloadManager.__addItem" ID="DownloadManager.__addItem"></a>
191 <h4>DownloadManager.__addItem</h4>
192 <b>__addItem</b>(<i>itm, append=False</i>)
193 <p>
194 Private method to add a download to the list of downloads.
195 </p><dl>
196 <dt><i>itm</i> (DownloadItem)</dt>
197 <dd>
198 reference to the download item
199 </dd><dt><i>append</i> (bool)</dt>
200 <dd>
201 flag indicating to append the item
202 </dd>
203 </dl><a NAME="DownloadManager.__closeDownloadTab" ID="DownloadManager.__closeDownloadTab"></a>
204 <h4>DownloadManager.__closeDownloadTab</h4>
205 <b>__closeDownloadTab</b>(<i>url</i>)
206 <p>
207 Private method to close an empty tab, that was opened only for loading
208 the download URL.
209 </p><dl>
210 <dt><i>url</i> (QUrl)</dt>
211 <dd>
212 download URL
213 </dd>
214 </dl><a NAME="DownloadManager.__contextMenuCancel" ID="DownloadManager.__contextMenuCancel"></a>
215 <h4>DownloadManager.__contextMenuCancel</h4>
216 <b>__contextMenuCancel</b>(<i></i>)
217 <p>
218 Private method to cancel the current download.
219 </p><a NAME="DownloadManager.__contextMenuCopyLink" ID="DownloadManager.__contextMenuCopyLink"></a>
220 <h4>DownloadManager.__contextMenuCopyLink</h4>
221 <b>__contextMenuCopyLink</b>(<i></i>)
222 <p>
223 Private method to copy the download link to the clipboard.
224 </p><a NAME="DownloadManager.__contextMenuGotoPage" ID="DownloadManager.__contextMenuGotoPage"></a>
225 <h4>DownloadManager.__contextMenuGotoPage</h4>
226 <b>__contextMenuGotoPage</b>(<i></i>)
227 <p>
228 Private method to open the download page.
229 </p><a NAME="DownloadManager.__contextMenuOpen" ID="DownloadManager.__contextMenuOpen"></a>
230 <h4>DownloadManager.__contextMenuOpen</h4>
231 <b>__contextMenuOpen</b>(<i></i>)
232 <p>
233 Private method to open the downloaded file.
234 </p><a NAME="DownloadManager.__contextMenuOpenFolder" ID="DownloadManager.__contextMenuOpenFolder"></a>
235 <h4>DownloadManager.__contextMenuOpenFolder</h4>
236 <b>__contextMenuOpenFolder</b>(<i></i>)
237 <p>
238 Private method to open the folder containing the downloaded file.
239 </p><a NAME="DownloadManager.__contextMenuRemoveSelected" ID="DownloadManager.__contextMenuRemoveSelected"></a>
240 <h4>DownloadManager.__contextMenuRemoveSelected</h4>
241 <b>__contextMenuRemoveSelected</b>(<i></i>)
242 <p>
243 Private method to remove the selected downloads from the list.
244 </p><a NAME="DownloadManager.__contextMenuSelectAll" ID="DownloadManager.__contextMenuSelectAll"></a>
245 <h4>DownloadManager.__contextMenuSelectAll</h4>
246 <b>__contextMenuSelectAll</b>(<i></i>)
247 <p>
248 Private method to select all downloads.
249 </p><a NAME="DownloadManager.__currentItem" ID="DownloadManager.__currentItem"></a>
250 <h4>DownloadManager.__currentItem</h4>
251 <b>__currentItem</b>(<i></i>)
252 <p>
253 Private method to get a reference to the current item.
254 </p><dl>
255 <dt>Returns:</dt>
256 <dd>
257 reference to the current item (DownloadItem)
258 </dd>
259 </dl><a NAME="DownloadManager.__customContextMenuRequested" ID="DownloadManager.__customContextMenuRequested"></a>
260 <h4>DownloadManager.__customContextMenuRequested</h4>
261 <b>__customContextMenuRequested</b>(<i>pos</i>)
262 <p>
263 Private slot to handle the context menu request for the bookmarks tree.
264 </p><dl>
265 <dt><i>pos</i></dt>
266 <dd>
267 position the context menu was requested (QPoint)
268 </dd>
269 </dl><a NAME="DownloadManager.__finished" ID="DownloadManager.__finished"></a>
270 <h4>DownloadManager.__finished</h4>
271 <b>__finished</b>(<i>success</i>)
272 <p>
273 Private slot to handle a finished download.
274 </p><dl>
275 <dt><i>success</i> (bool)</dt>
276 <dd>
277 flag indicating a successful download
278 </dd>
279 </dl><a NAME="DownloadManager.__load" ID="DownloadManager.__load"></a>
280 <h4>DownloadManager.__load</h4>
281 <b>__load</b>(<i></i>)
282 <p>
283 Private method to load the download settings.
284 </p><a NAME="DownloadManager.__startUpdateTimer" ID="DownloadManager.__startUpdateTimer"></a>
285 <h4>DownloadManager.__startUpdateTimer</h4>
286 <b>__startUpdateTimer</b>(<i></i>)
287 <p>
288 Private slot to start the update timer.
289 </p><a NAME="DownloadManager.__stopUpdateTimer" ID="DownloadManager.__stopUpdateTimer"></a>
290 <h4>DownloadManager.__stopUpdateTimer</h4>
291 <b>__stopUpdateTimer</b>(<i></i>)
292 <p>
293 Private slot to stop the update timer.
294 </p><a NAME="DownloadManager.__taskbarButton" ID="DownloadManager.__taskbarButton"></a>
295 <h4>DownloadManager.__taskbarButton</h4>
296 <b>__taskbarButton</b>(<i></i>)
297 <p>
298 Private method to get a reference to the task bar button (Windows
299 only).
300 </p><dl>
301 <dt>Returns:</dt>
302 <dd>
303 reference to the task bar button
304 </dd>
305 </dl><dl>
306 <dt>Return Type:</dt>
307 <dd>
308 QWinTaskbarButton or None
309 </dd>
310 </dl><a NAME="DownloadManager.__testWebBrowserView" ID="DownloadManager.__testWebBrowserView"></a>
311 <h4>DownloadManager.__testWebBrowserView</h4>
312 <b>__testWebBrowserView</b>(<i>view, url</i>)
313 <p>
314 Private method to test a web browser view against an URL.
315 </p><dl>
316 <dt><i>view</i> (WebBrowserView)</dt>
317 <dd>
318 reference to the web browser view to be tested
319 </dd><dt><i>url</i> (QUrl)</dt>
320 <dd>
321 URL to test against
322 </dd>
323 </dl><dl>
324 <dt>Returns:</dt>
325 <dd>
326 flag indicating, that the view is the one for the URL
327 </dd>
328 </dl><dl>
329 <dt>Return Type:</dt>
330 <dd>
331 bool
332 </dd>
333 </dl><a NAME="DownloadManager.__updateRow" ID="DownloadManager.__updateRow"></a>
334 <h4>DownloadManager.__updateRow</h4>
335 <b>__updateRow</b>(<i>itm</i>)
336 <p>
337 Private slot to update a download item.
338 </p><dl>
339 <dt><i>itm</i> (DownloadItem)</dt>
340 <dd>
341 reference to the download item
342 </dd>
343 </dl><a NAME="DownloadManager.activeDownloadsCount" ID="DownloadManager.activeDownloadsCount"></a>
344 <h4>DownloadManager.activeDownloadsCount</h4>
345 <b>activeDownloadsCount</b>(<i></i>)
346 <p>
347 Public method to get the number of active downloads.
348 </p><dl>
349 <dt>Returns:</dt>
350 <dd>
351 number of active downloads (integer)
352 </dd>
353 </dl><a NAME="DownloadManager.allowQuit" ID="DownloadManager.allowQuit"></a>
354 <h4>DownloadManager.allowQuit</h4>
355 <b>allowQuit</b>(<i></i>)
356 <p>
357 Public method to check, if it is ok to quit.
358 </p><dl>
359 <dt>Returns:</dt>
360 <dd>
361 flag indicating allowance to quit (boolean)
362 </dd>
363 </dl><a NAME="DownloadManager.changeOccurred" ID="DownloadManager.changeOccurred"></a>
364 <h4>DownloadManager.changeOccurred</h4>
365 <b>changeOccurred</b>(<i></i>)
366 <p>
367 Public method to signal a change.
368 </p><a NAME="DownloadManager.cleanup" ID="DownloadManager.cleanup"></a>
369 <h4>DownloadManager.cleanup</h4>
370 <b>cleanup</b>(<i></i>)
371 <p>
372 Public slot to cleanup the downloads.
373 </p><a NAME="DownloadManager.closeEvent" ID="DownloadManager.closeEvent"></a>
374 <h4>DownloadManager.closeEvent</h4>
375 <b>closeEvent</b>(<i>evt</i>)
376 <p>
377 Protected event handler for the close event.
378 </p><dl>
379 <dt><i>evt</i> (QCloseEvent)</dt>
380 <dd>
381 reference to the close event
382 </dd>
383 </dl><a NAME="DownloadManager.download" ID="DownloadManager.download"></a>
384 <h4>DownloadManager.download</h4>
385 <b>download</b>(<i>downloadItem</i>)
386 <p>
387 Public method to download a file.
388 </p><dl>
389 <dt><i>downloadItem</i> (QWebEngineDownloadItem)</dt>
390 <dd>
391 reference to the download object containing the
392 download data.
393 </dd>
394 </dl><a NAME="DownloadManager.downloadDirectory" ID="DownloadManager.downloadDirectory"></a>
395 <h4>DownloadManager.downloadDirectory</h4>
396 <b>downloadDirectory</b>(<i></i>)
397 <p>
398 Public method to get the current download directory.
399 </p><dl>
400 <dt>Returns:</dt>
401 <dd>
402 current download directory (string)
403 </dd>
404 </dl><a NAME="DownloadManager.downloads" ID="DownloadManager.downloads"></a>
405 <h4>DownloadManager.downloads</h4>
406 <b>downloads</b>(<i></i>)
407 <p>
408 Public method to get a reference to the downloads.
409 </p><dl>
410 <dt>Returns:</dt>
411 <dd>
412 reference to the downloads (list of DownloadItem)
413 </dd>
414 </dl><a NAME="DownloadManager.downloadsCount" ID="DownloadManager.downloadsCount"></a>
415 <h4>DownloadManager.downloadsCount</h4>
416 <b>downloadsCount</b>(<i></i>)
417 <p>
418 Public method to get the number of downloads.
419 </p><dl>
420 <dt>Returns:</dt>
421 <dd>
422 number of downloads
423 </dd>
424 </dl><dl>
425 <dt>Return Type:</dt>
426 <dd>
427 int
428 </dd>
429 </dl><a NAME="DownloadManager.on_cleanupButton_clicked" ID="DownloadManager.on_cleanupButton_clicked"></a>
430 <h4>DownloadManager.on_cleanupButton_clicked</h4>
431 <b>on_cleanupButton_clicked</b>(<i></i>)
432 <p>
433 Private slot to cleanup the downloads.
434 </p><a NAME="DownloadManager.removePolicy" ID="DownloadManager.removePolicy"></a>
435 <h4>DownloadManager.removePolicy</h4>
436 <b>removePolicy</b>(<i></i>)
437 <p>
438 Public method to get the remove policy.
439 </p><dl>
440 <dt>Returns:</dt>
441 <dd>
442 remove policy (integer)
443 </dd>
444 </dl><a NAME="DownloadManager.save" ID="DownloadManager.save"></a>
445 <h4>DownloadManager.save</h4>
446 <b>save</b>(<i></i>)
447 <p>
448 Public method to save the download settings.
449 </p><a NAME="DownloadManager.setDownloadDirectory" ID="DownloadManager.setDownloadDirectory"></a>
450 <h4>DownloadManager.setDownloadDirectory</h4>
451 <b>setDownloadDirectory</b>(<i>directory</i>)
452 <p>
453 Public method to set the current download directory.
454 </p><dl>
455 <dt><i>directory</i></dt>
456 <dd>
457 current download directory (string)
458 </dd>
459 </dl><a NAME="DownloadManager.setRemovePolicy" ID="DownloadManager.setRemovePolicy"></a>
460 <h4>DownloadManager.setRemovePolicy</h4>
461 <b>setRemovePolicy</b>(<i>policy</i>)
462 <p>
463 Public method to set the remove policy.
464 </p><dl>
465 <dt><i>policy</i></dt>
466 <dd>
467 policy to be set
468 (DownloadManager.RemoveExit, DownloadManager.RemoveNever,
469 DownloadManager.RemoveSuccessFullDownload)
470 </dd>
471 </dl><a NAME="DownloadManager.show" ID="DownloadManager.show"></a>
472 <h4>DownloadManager.show</h4>
473 <b>show</b>(<i></i>)
474 <p>
475 Public slot to show the download manager dialog.
476 </p><a NAME="DownloadManager.shutdown" ID="DownloadManager.shutdown"></a>
477 <h4>DownloadManager.shutdown</h4>
478 <b>shutdown</b>(<i></i>)
479 <p>
480 Public method to stop the download manager.
481 </p><a NAME="DownloadManager.timerEvent" ID="DownloadManager.timerEvent"></a>
482 <h4>DownloadManager.timerEvent</h4>
483 <b>timerEvent</b>(<i>evt</i>)
484 <p>
485 Protected event handler for timer events.
486 </p><dl>
487 <dt><i>evt</i> (QTimerEvent)</dt>
488 <dd>
489 reference to the timer event
490 </dd>
491 </dl>
492 <div align="right"><a href="#top">Up</a></div>
493 <hr />
494 </body></html>

eric ide

mercurial