|
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> |
|
47 <h3>Derived from</h3> |
|
48 QDialog, Ui_DownloadManager |
|
49 <h3>Class Attributes</h3> |
|
50 <table> |
|
51 <tr><td>RemoveExit</td></tr><tr><td>RemoveNever</td></tr><tr><td>RemoveSuccessFullDownload</td></tr> |
|
52 </table> |
|
53 <h3>Class Methods</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#DownloadManager.__init__">DownloadManager</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#DownloadManager.__addItem">__addItem</a></td> |
|
64 <td>Private method to add a download to the list of downloads.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#DownloadManager.__contextMenuCancel">__contextMenuCancel</a></td> |
|
67 <td>Private method to cancel the current download.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#DownloadManager.__contextMenuCopyLink">__contextMenuCopyLink</a></td> |
|
70 <td>Private method to copy the download link to the clipboard.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#DownloadManager.__contextMenuGotoPage">__contextMenuGotoPage</a></td> |
|
73 <td>Private method to open the download page.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#DownloadManager.__contextMenuOpen">__contextMenuOpen</a></td> |
|
76 <td>Private method to open the downloaded file.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#DownloadManager.__contextMenuOpenFolder">__contextMenuOpenFolder</a></td> |
|
79 <td>Private method to open the folder containing the downloaded file.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#DownloadManager.__contextMenuRemoveSelected">__contextMenuRemoveSelected</a></td> |
|
82 <td>Private method to remove the selected downloads from the list.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#DownloadManager.__contextMenuSelectAll">__contextMenuSelectAll</a></td> |
|
85 <td>Private method to select all downloads.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#DownloadManager.__currentItem">__currentItem</a></td> |
|
88 <td>Private method to get a reference to the current item.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#DownloadManager.__customContextMenuRequested">__customContextMenuRequested</a></td> |
|
91 <td>Private slot to handle the context menu request for the bookmarks tree.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#DownloadManager.__finished">__finished</a></td> |
|
94 <td>Private slot to handle a finished download.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#DownloadManager.__load">__load</a></td> |
|
97 <td>Private method to load the download settings.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#DownloadManager.__updateActiveItemCount">__updateActiveItemCount</a></td> |
|
100 <td>Private method to update the window title.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#DownloadManager.__updateItemCount">__updateItemCount</a></td> |
|
103 <td>Private method to update the count label.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#DownloadManager.__updateRow">__updateRow</a></td> |
|
106 <td>Private slot to update a download item.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#DownloadManager.activeDownloads">activeDownloads</a></td> |
|
109 <td>Public method to get the number of active downloads.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#DownloadManager.allowQuit">allowQuit</a></td> |
|
112 <td>Public method to check, if it is ok to quit.</td> |
|
113 </tr><tr> |
|
114 <td><a href="#DownloadManager.changeOccurred">changeOccurred</a></td> |
|
115 <td>Public method to signal a change.</td> |
|
116 </tr><tr> |
|
117 <td><a href="#DownloadManager.cleanup">cleanup</a></td> |
|
118 <td>Public slot to cleanup the downloads.</td> |
|
119 </tr><tr> |
|
120 <td><a href="#DownloadManager.count">count</a></td> |
|
121 <td>Public method to get the number of downloads.</td> |
|
122 </tr><tr> |
|
123 <td><a href="#DownloadManager.download">download</a></td> |
|
124 <td>Public method to download a file.</td> |
|
125 </tr><tr> |
|
126 <td><a href="#DownloadManager.downloadDirectory">downloadDirectory</a></td> |
|
127 <td>Public method to get the current download directory.</td> |
|
128 </tr><tr> |
|
129 <td><a href="#DownloadManager.downloads">downloads</a></td> |
|
130 <td>Public method to get a reference to the downloads.</td> |
|
131 </tr><tr> |
|
132 <td><a href="#DownloadManager.on_cleanupButton_clicked">on_cleanupButton_clicked</a></td> |
|
133 <td>Private slot cleanup the downloads.</td> |
|
134 </tr><tr> |
|
135 <td><a href="#DownloadManager.removePolicy">removePolicy</a></td> |
|
136 <td>Public method to get the remove policy.</td> |
|
137 </tr><tr> |
|
138 <td><a href="#DownloadManager.save">save</a></td> |
|
139 <td>Public method to save the download settings.</td> |
|
140 </tr><tr> |
|
141 <td><a href="#DownloadManager.setDownloadDirectory">setDownloadDirectory</a></td> |
|
142 <td>Public method to set the current download directory.</td> |
|
143 </tr><tr> |
|
144 <td><a href="#DownloadManager.setRemovePolicy">setRemovePolicy</a></td> |
|
145 <td>Public method to set the remove policy.</td> |
|
146 </tr><tr> |
|
147 <td><a href="#DownloadManager.shutdown">shutdown</a></td> |
|
148 <td>Public method to stop the download manager.</td> |
|
149 </tr> |
|
150 </table> |
|
151 <h3>Static Methods</h3> |
|
152 <table> |
|
153 <tr><td>None</td></tr> |
|
154 </table> |
|
155 <a NAME="DownloadManager.__init__" ID="DownloadManager.__init__"></a> |
|
156 <h4>DownloadManager (Constructor)</h4> |
|
157 <b>DownloadManager</b>(<i>parent=None</i>) |
|
158 <p> |
|
159 Constructor |
|
160 </p><dl> |
|
161 <dt><i>parent</i></dt> |
|
162 <dd> |
|
163 reference to the parent widget (QWidget) |
|
164 </dd> |
|
165 </dl><a NAME="DownloadManager.__addItem" ID="DownloadManager.__addItem"></a> |
|
166 <h4>DownloadManager.__addItem</h4> |
|
167 <b>__addItem</b>(<i>itm</i>) |
|
168 <p> |
|
169 Private method to add a download to the list of downloads. |
|
170 </p><dl> |
|
171 <dt><i>itm</i></dt> |
|
172 <dd> |
|
173 reference to the download item (DownloadItem) |
|
174 </dd> |
|
175 </dl><a NAME="DownloadManager.__contextMenuCancel" ID="DownloadManager.__contextMenuCancel"></a> |
|
176 <h4>DownloadManager.__contextMenuCancel</h4> |
|
177 <b>__contextMenuCancel</b>(<i></i>) |
|
178 <p> |
|
179 Private method to cancel the current download. |
|
180 </p><a NAME="DownloadManager.__contextMenuCopyLink" ID="DownloadManager.__contextMenuCopyLink"></a> |
|
181 <h4>DownloadManager.__contextMenuCopyLink</h4> |
|
182 <b>__contextMenuCopyLink</b>(<i></i>) |
|
183 <p> |
|
184 Private method to copy the download link to the clipboard. |
|
185 </p><a NAME="DownloadManager.__contextMenuGotoPage" ID="DownloadManager.__contextMenuGotoPage"></a> |
|
186 <h4>DownloadManager.__contextMenuGotoPage</h4> |
|
187 <b>__contextMenuGotoPage</b>(<i></i>) |
|
188 <p> |
|
189 Private method to open the download page. |
|
190 </p><a NAME="DownloadManager.__contextMenuOpen" ID="DownloadManager.__contextMenuOpen"></a> |
|
191 <h4>DownloadManager.__contextMenuOpen</h4> |
|
192 <b>__contextMenuOpen</b>(<i></i>) |
|
193 <p> |
|
194 Private method to open the downloaded file. |
|
195 </p><a NAME="DownloadManager.__contextMenuOpenFolder" ID="DownloadManager.__contextMenuOpenFolder"></a> |
|
196 <h4>DownloadManager.__contextMenuOpenFolder</h4> |
|
197 <b>__contextMenuOpenFolder</b>(<i></i>) |
|
198 <p> |
|
199 Private method to open the folder containing the downloaded file. |
|
200 </p><a NAME="DownloadManager.__contextMenuRemoveSelected" ID="DownloadManager.__contextMenuRemoveSelected"></a> |
|
201 <h4>DownloadManager.__contextMenuRemoveSelected</h4> |
|
202 <b>__contextMenuRemoveSelected</b>(<i></i>) |
|
203 <p> |
|
204 Private method to remove the selected downloads from the list. |
|
205 </p><a NAME="DownloadManager.__contextMenuSelectAll" ID="DownloadManager.__contextMenuSelectAll"></a> |
|
206 <h4>DownloadManager.__contextMenuSelectAll</h4> |
|
207 <b>__contextMenuSelectAll</b>(<i></i>) |
|
208 <p> |
|
209 Private method to select all downloads. |
|
210 </p><a NAME="DownloadManager.__currentItem" ID="DownloadManager.__currentItem"></a> |
|
211 <h4>DownloadManager.__currentItem</h4> |
|
212 <b>__currentItem</b>(<i></i>) |
|
213 <p> |
|
214 Private method to get a reference to the current item. |
|
215 </p><dl> |
|
216 <dt>Returns:</dt> |
|
217 <dd> |
|
218 reference to the current item (DownloadItem) |
|
219 </dd> |
|
220 </dl><a NAME="DownloadManager.__customContextMenuRequested" ID="DownloadManager.__customContextMenuRequested"></a> |
|
221 <h4>DownloadManager.__customContextMenuRequested</h4> |
|
222 <b>__customContextMenuRequested</b>(<i>pos</i>) |
|
223 <p> |
|
224 Private slot to handle the context menu request for the bookmarks tree. |
|
225 </p><dl> |
|
226 <dt><i>pos</i></dt> |
|
227 <dd> |
|
228 position the context menu was requested (QPoint) |
|
229 </dd> |
|
230 </dl><a NAME="DownloadManager.__finished" ID="DownloadManager.__finished"></a> |
|
231 <h4>DownloadManager.__finished</h4> |
|
232 <b>__finished</b>(<i></i>) |
|
233 <p> |
|
234 Private slot to handle a finished download. |
|
235 </p><a NAME="DownloadManager.__load" ID="DownloadManager.__load"></a> |
|
236 <h4>DownloadManager.__load</h4> |
|
237 <b>__load</b>(<i></i>) |
|
238 <p> |
|
239 Private method to load the download settings. |
|
240 </p><a NAME="DownloadManager.__updateActiveItemCount" ID="DownloadManager.__updateActiveItemCount"></a> |
|
241 <h4>DownloadManager.__updateActiveItemCount</h4> |
|
242 <b>__updateActiveItemCount</b>(<i></i>) |
|
243 <p> |
|
244 Private method to update the window title. |
|
245 </p><a NAME="DownloadManager.__updateItemCount" ID="DownloadManager.__updateItemCount"></a> |
|
246 <h4>DownloadManager.__updateItemCount</h4> |
|
247 <b>__updateItemCount</b>(<i></i>) |
|
248 <p> |
|
249 Private method to update the count label. |
|
250 </p><a NAME="DownloadManager.__updateRow" ID="DownloadManager.__updateRow"></a> |
|
251 <h4>DownloadManager.__updateRow</h4> |
|
252 <b>__updateRow</b>(<i>itm=None</i>) |
|
253 <p> |
|
254 Private slot to update a download item. |
|
255 </p><dl> |
|
256 <dt><i>itm</i></dt> |
|
257 <dd> |
|
258 reference to the download item (DownloadItem) |
|
259 </dd> |
|
260 </dl><a NAME="DownloadManager.activeDownloads" ID="DownloadManager.activeDownloads"></a> |
|
261 <h4>DownloadManager.activeDownloads</h4> |
|
262 <b>activeDownloads</b>(<i></i>) |
|
263 <p> |
|
264 Public method to get the number of active downloads. |
|
265 </p><dl> |
|
266 <dt>Returns:</dt> |
|
267 <dd> |
|
268 number of active downloads (integer) |
|
269 </dd> |
|
270 </dl><a NAME="DownloadManager.allowQuit" ID="DownloadManager.allowQuit"></a> |
|
271 <h4>DownloadManager.allowQuit</h4> |
|
272 <b>allowQuit</b>(<i></i>) |
|
273 <p> |
|
274 Public method to check, if it is ok to quit. |
|
275 </p><dl> |
|
276 <dt>Returns:</dt> |
|
277 <dd> |
|
278 flag indicating allowance to quit (boolean) |
|
279 </dd> |
|
280 </dl><a NAME="DownloadManager.changeOccurred" ID="DownloadManager.changeOccurred"></a> |
|
281 <h4>DownloadManager.changeOccurred</h4> |
|
282 <b>changeOccurred</b>(<i></i>) |
|
283 <p> |
|
284 Public method to signal a change. |
|
285 </p><a NAME="DownloadManager.cleanup" ID="DownloadManager.cleanup"></a> |
|
286 <h4>DownloadManager.cleanup</h4> |
|
287 <b>cleanup</b>(<i></i>) |
|
288 <p> |
|
289 Public slot to cleanup the downloads. |
|
290 </p><a NAME="DownloadManager.count" ID="DownloadManager.count"></a> |
|
291 <h4>DownloadManager.count</h4> |
|
292 <b>count</b>(<i></i>) |
|
293 <p> |
|
294 Public method to get the number of downloads. |
|
295 </p><dl> |
|
296 <dt>Returns:</dt> |
|
297 <dd> |
|
298 number of downloads (integer) |
|
299 </dd> |
|
300 </dl><a NAME="DownloadManager.download" ID="DownloadManager.download"></a> |
|
301 <h4>DownloadManager.download</h4> |
|
302 <b>download</b>(<i>downloadItem</i>) |
|
303 <p> |
|
304 Public method to download a file. |
|
305 </p><dl> |
|
306 <dt><i>downloadItem</i> (QWebEngineDownloadItem)</dt> |
|
307 <dd> |
|
308 reference to the download object containing the |
|
309 download data. |
|
310 </dd> |
|
311 </dl><a NAME="DownloadManager.downloadDirectory" ID="DownloadManager.downloadDirectory"></a> |
|
312 <h4>DownloadManager.downloadDirectory</h4> |
|
313 <b>downloadDirectory</b>(<i></i>) |
|
314 <p> |
|
315 Public method to get the current download directory. |
|
316 </p><dl> |
|
317 <dt>Returns:</dt> |
|
318 <dd> |
|
319 current download directory (string) |
|
320 </dd> |
|
321 </dl><a NAME="DownloadManager.downloads" ID="DownloadManager.downloads"></a> |
|
322 <h4>DownloadManager.downloads</h4> |
|
323 <b>downloads</b>(<i></i>) |
|
324 <p> |
|
325 Public method to get a reference to the downloads. |
|
326 </p><dl> |
|
327 <dt>Returns:</dt> |
|
328 <dd> |
|
329 reference to the downloads (list of DownloadItem) |
|
330 </dd> |
|
331 </dl><a NAME="DownloadManager.on_cleanupButton_clicked" ID="DownloadManager.on_cleanupButton_clicked"></a> |
|
332 <h4>DownloadManager.on_cleanupButton_clicked</h4> |
|
333 <b>on_cleanupButton_clicked</b>(<i></i>) |
|
334 <p> |
|
335 Private slot cleanup the downloads. |
|
336 </p><a NAME="DownloadManager.removePolicy" ID="DownloadManager.removePolicy"></a> |
|
337 <h4>DownloadManager.removePolicy</h4> |
|
338 <b>removePolicy</b>(<i></i>) |
|
339 <p> |
|
340 Public method to get the remove policy. |
|
341 </p><dl> |
|
342 <dt>Returns:</dt> |
|
343 <dd> |
|
344 remove policy (integer) |
|
345 </dd> |
|
346 </dl><a NAME="DownloadManager.save" ID="DownloadManager.save"></a> |
|
347 <h4>DownloadManager.save</h4> |
|
348 <b>save</b>(<i></i>) |
|
349 <p> |
|
350 Public method to save the download settings. |
|
351 </p><a NAME="DownloadManager.setDownloadDirectory" ID="DownloadManager.setDownloadDirectory"></a> |
|
352 <h4>DownloadManager.setDownloadDirectory</h4> |
|
353 <b>setDownloadDirectory</b>(<i>directory</i>) |
|
354 <p> |
|
355 Public method to set the current download directory. |
|
356 </p><dl> |
|
357 <dt><i>directory</i></dt> |
|
358 <dd> |
|
359 current download directory (string) |
|
360 </dd> |
|
361 </dl><a NAME="DownloadManager.setRemovePolicy" ID="DownloadManager.setRemovePolicy"></a> |
|
362 <h4>DownloadManager.setRemovePolicy</h4> |
|
363 <b>setRemovePolicy</b>(<i>policy</i>) |
|
364 <p> |
|
365 Public method to set the remove policy. |
|
366 </p><dl> |
|
367 <dt><i>policy</i></dt> |
|
368 <dd> |
|
369 policy to be set |
|
370 (DownloadManager.RemoveExit, DownloadManager.RemoveNever, |
|
371 DownloadManager.RemoveSuccessFullDownload) |
|
372 </dd> |
|
373 </dl><a NAME="DownloadManager.shutdown" ID="DownloadManager.shutdown"></a> |
|
374 <h4>DownloadManager.shutdown</h4> |
|
375 <b>shutdown</b>(<i></i>) |
|
376 <p> |
|
377 Public method to stop the download manager. |
|
378 </p> |
|
379 <div align="right"><a href="#top">Up</a></div> |
|
380 <hr /> |
|
381 </body></html> |