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

changeset 6942
2602857055c5
parent 6123
39cd368143db
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.Helpviewer.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.Helpviewer.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.__contextMenuRetry">__contextMenuRetry</a></td>
85 <td>Private method to retry of the download.</td>
86 </tr><tr>
87 <td><a href="#DownloadManager.__contextMenuSelectAll">__contextMenuSelectAll</a></td>
88 <td>Private method to select all downloads.</td>
89 </tr><tr>
90 <td><a href="#DownloadManager.__currentItem">__currentItem</a></td>
91 <td>Private method to get a reference to the current item.</td>
92 </tr><tr>
93 <td><a href="#DownloadManager.__customContextMenuRequested">__customContextMenuRequested</a></td>
94 <td>Private slot to handle the context menu request for the bookmarks tree.</td>
95 </tr><tr>
96 <td><a href="#DownloadManager.__finished">__finished</a></td>
97 <td>Private slot to handle a finished download.</td>
98 </tr><tr>
99 <td><a href="#DownloadManager.__load">__load</a></td>
100 <td>Private method to load the download settings.</td>
101 </tr><tr>
102 <td><a href="#DownloadManager.__updateActiveItemCount">__updateActiveItemCount</a></td>
103 <td>Private method to update the window title.</td>
104 </tr><tr>
105 <td><a href="#DownloadManager.__updateItemCount">__updateItemCount</a></td>
106 <td>Private method to update the count label.</td>
107 </tr><tr>
108 <td><a href="#DownloadManager.__updateRow">__updateRow</a></td>
109 <td>Private slot to update a download item.</td>
110 </tr><tr>
111 <td><a href="#DownloadManager.activeDownloads">activeDownloads</a></td>
112 <td>Public method to get the number of active downloads.</td>
113 </tr><tr>
114 <td><a href="#DownloadManager.allowQuit">allowQuit</a></td>
115 <td>Public method to check, if it is ok to quit.</td>
116 </tr><tr>
117 <td><a href="#DownloadManager.changeOccurred">changeOccurred</a></td>
118 <td>Public method to signal a change.</td>
119 </tr><tr>
120 <td><a href="#DownloadManager.cleanup">cleanup</a></td>
121 <td>Public slot to cleanup the downloads.</td>
122 </tr><tr>
123 <td><a href="#DownloadManager.count">count</a></td>
124 <td>Public method to get the number of downloads.</td>
125 </tr><tr>
126 <td><a href="#DownloadManager.download">download</a></td>
127 <td>Public method to download a file.</td>
128 </tr><tr>
129 <td><a href="#DownloadManager.downloadDirectory">downloadDirectory</a></td>
130 <td>Public method to get the current download directory.</td>
131 </tr><tr>
132 <td><a href="#DownloadManager.downloads">downloads</a></td>
133 <td>Public method to get a reference to the downloads.</td>
134 </tr><tr>
135 <td><a href="#DownloadManager.handleUnsupportedContent">handleUnsupportedContent</a></td>
136 <td>Public method to handle unsupported content by downloading the referenced resource.</td>
137 </tr><tr>
138 <td><a href="#DownloadManager.on_cleanupButton_clicked">on_cleanupButton_clicked</a></td>
139 <td>Private slot cleanup the downloads.</td>
140 </tr><tr>
141 <td><a href="#DownloadManager.removePolicy">removePolicy</a></td>
142 <td>Public method to get the remove policy.</td>
143 </tr><tr>
144 <td><a href="#DownloadManager.save">save</a></td>
145 <td>Public method to save the download settings.</td>
146 </tr><tr>
147 <td><a href="#DownloadManager.setDownloadDirectory">setDownloadDirectory</a></td>
148 <td>Public method to set the current download directory.</td>
149 </tr><tr>
150 <td><a href="#DownloadManager.setRemovePolicy">setRemovePolicy</a></td>
151 <td>Public method to set the remove policy.</td>
152 </tr><tr>
153 <td><a href="#DownloadManager.shutdown">shutdown</a></td>
154 <td>Public method to stop the download manager.</td>
155 </tr>
156 </table>
157 <h3>Static Methods</h3>
158 <table>
159 <tr><td>None</td></tr>
160 </table>
161 <a NAME="DownloadManager.__init__" ID="DownloadManager.__init__"></a>
162 <h4>DownloadManager (Constructor)</h4>
163 <b>DownloadManager</b>(<i>parent=None</i>)
164 <p>
165 Constructor
166 </p><dl>
167 <dt><i>parent</i></dt>
168 <dd>
169 reference to the parent widget (QWidget)
170 </dd>
171 </dl><a NAME="DownloadManager.__addItem" ID="DownloadManager.__addItem"></a>
172 <h4>DownloadManager.__addItem</h4>
173 <b>__addItem</b>(<i>itm, append=False</i>)
174 <p>
175 Private method to add a download to the list of downloads.
176 </p><dl>
177 <dt><i>itm</i> (DownloadItem)</dt>
178 <dd>
179 reference to the download item
180 </dd><dt><i>append</i> (bool)</dt>
181 <dd>
182 flag indicating to append the item
183 </dd>
184 </dl><a NAME="DownloadManager.__contextMenuCancel" ID="DownloadManager.__contextMenuCancel"></a>
185 <h4>DownloadManager.__contextMenuCancel</h4>
186 <b>__contextMenuCancel</b>(<i></i>)
187 <p>
188 Private method to cancel the current download.
189 </p><a NAME="DownloadManager.__contextMenuCopyLink" ID="DownloadManager.__contextMenuCopyLink"></a>
190 <h4>DownloadManager.__contextMenuCopyLink</h4>
191 <b>__contextMenuCopyLink</b>(<i></i>)
192 <p>
193 Private method to copy the download link to the clipboard.
194 </p><a NAME="DownloadManager.__contextMenuGotoPage" ID="DownloadManager.__contextMenuGotoPage"></a>
195 <h4>DownloadManager.__contextMenuGotoPage</h4>
196 <b>__contextMenuGotoPage</b>(<i></i>)
197 <p>
198 Private method to open the download page.
199 </p><a NAME="DownloadManager.__contextMenuOpen" ID="DownloadManager.__contextMenuOpen"></a>
200 <h4>DownloadManager.__contextMenuOpen</h4>
201 <b>__contextMenuOpen</b>(<i></i>)
202 <p>
203 Private method to open the downloaded file.
204 </p><a NAME="DownloadManager.__contextMenuOpenFolder" ID="DownloadManager.__contextMenuOpenFolder"></a>
205 <h4>DownloadManager.__contextMenuOpenFolder</h4>
206 <b>__contextMenuOpenFolder</b>(<i></i>)
207 <p>
208 Private method to open the folder containing the downloaded file.
209 </p><a NAME="DownloadManager.__contextMenuRemoveSelected" ID="DownloadManager.__contextMenuRemoveSelected"></a>
210 <h4>DownloadManager.__contextMenuRemoveSelected</h4>
211 <b>__contextMenuRemoveSelected</b>(<i></i>)
212 <p>
213 Private method to remove the selected downloads from the list.
214 </p><a NAME="DownloadManager.__contextMenuRetry" ID="DownloadManager.__contextMenuRetry"></a>
215 <h4>DownloadManager.__contextMenuRetry</h4>
216 <b>__contextMenuRetry</b>(<i></i>)
217 <p>
218 Private method to retry of the download.
219 </p><a NAME="DownloadManager.__contextMenuSelectAll" ID="DownloadManager.__contextMenuSelectAll"></a>
220 <h4>DownloadManager.__contextMenuSelectAll</h4>
221 <b>__contextMenuSelectAll</b>(<i></i>)
222 <p>
223 Private method to select all downloads.
224 </p><a NAME="DownloadManager.__currentItem" ID="DownloadManager.__currentItem"></a>
225 <h4>DownloadManager.__currentItem</h4>
226 <b>__currentItem</b>(<i></i>)
227 <p>
228 Private method to get a reference to the current item.
229 </p><dl>
230 <dt>Returns:</dt>
231 <dd>
232 reference to the current item (DownloadItem)
233 </dd>
234 </dl><a NAME="DownloadManager.__customContextMenuRequested" ID="DownloadManager.__customContextMenuRequested"></a>
235 <h4>DownloadManager.__customContextMenuRequested</h4>
236 <b>__customContextMenuRequested</b>(<i>pos</i>)
237 <p>
238 Private slot to handle the context menu request for the bookmarks tree.
239 </p><dl>
240 <dt><i>pos</i></dt>
241 <dd>
242 position the context menu was requested (QPoint)
243 </dd>
244 </dl><a NAME="DownloadManager.__finished" ID="DownloadManager.__finished"></a>
245 <h4>DownloadManager.__finished</h4>
246 <b>__finished</b>(<i></i>)
247 <p>
248 Private slot to handle a finished download.
249 </p><a NAME="DownloadManager.__load" ID="DownloadManager.__load"></a>
250 <h4>DownloadManager.__load</h4>
251 <b>__load</b>(<i></i>)
252 <p>
253 Private method to load the download settings.
254 </p><a NAME="DownloadManager.__updateActiveItemCount" ID="DownloadManager.__updateActiveItemCount"></a>
255 <h4>DownloadManager.__updateActiveItemCount</h4>
256 <b>__updateActiveItemCount</b>(<i></i>)
257 <p>
258 Private method to update the window title.
259 </p><a NAME="DownloadManager.__updateItemCount" ID="DownloadManager.__updateItemCount"></a>
260 <h4>DownloadManager.__updateItemCount</h4>
261 <b>__updateItemCount</b>(<i></i>)
262 <p>
263 Private method to update the count label.
264 </p><a NAME="DownloadManager.__updateRow" ID="DownloadManager.__updateRow"></a>
265 <h4>DownloadManager.__updateRow</h4>
266 <b>__updateRow</b>(<i>itm</i>)
267 <p>
268 Private slot to update a download item.
269 </p><dl>
270 <dt><i>itm</i> (DownloadItem)</dt>
271 <dd>
272 reference to the download item
273 </dd>
274 </dl><a NAME="DownloadManager.activeDownloads" ID="DownloadManager.activeDownloads"></a>
275 <h4>DownloadManager.activeDownloads</h4>
276 <b>activeDownloads</b>(<i></i>)
277 <p>
278 Public method to get the number of active downloads.
279 </p><dl>
280 <dt>Returns:</dt>
281 <dd>
282 number of active downloads (integer)
283 </dd>
284 </dl><a NAME="DownloadManager.allowQuit" ID="DownloadManager.allowQuit"></a>
285 <h4>DownloadManager.allowQuit</h4>
286 <b>allowQuit</b>(<i></i>)
287 <p>
288 Public method to check, if it is ok to quit.
289 </p><dl>
290 <dt>Returns:</dt>
291 <dd>
292 flag indicating allowance to quit (boolean)
293 </dd>
294 </dl><a NAME="DownloadManager.changeOccurred" ID="DownloadManager.changeOccurred"></a>
295 <h4>DownloadManager.changeOccurred</h4>
296 <b>changeOccurred</b>(<i></i>)
297 <p>
298 Public method to signal a change.
299 </p><a NAME="DownloadManager.cleanup" ID="DownloadManager.cleanup"></a>
300 <h4>DownloadManager.cleanup</h4>
301 <b>cleanup</b>(<i></i>)
302 <p>
303 Public slot to cleanup the downloads.
304 </p><a NAME="DownloadManager.count" ID="DownloadManager.count"></a>
305 <h4>DownloadManager.count</h4>
306 <b>count</b>(<i></i>)
307 <p>
308 Public method to get the number of downloads.
309 </p><dl>
310 <dt>Returns:</dt>
311 <dd>
312 number of downloads (integer)
313 </dd>
314 </dl><a NAME="DownloadManager.download" ID="DownloadManager.download"></a>
315 <h4>DownloadManager.download</h4>
316 <b>download</b>(<i>requestOrUrl, requestFileName=False, mainWindow=None</i>)
317 <p>
318 Public method to download a file.
319 </p><dl>
320 <dt><i>requestOrUrl</i></dt>
321 <dd>
322 reference to a request object (QNetworkRequest)
323 or a URL to be downloaded (QUrl)
324 </dd><dt><i>requestFileName=</i></dt>
325 <dd>
326 flag indicating to ask for the
327 download file name (boolean)
328 </dd><dt><i>mainWindow=</i></dt>
329 <dd>
330 reference to the main window (HelpWindow)
331 </dd>
332 </dl><a NAME="DownloadManager.downloadDirectory" ID="DownloadManager.downloadDirectory"></a>
333 <h4>DownloadManager.downloadDirectory</h4>
334 <b>downloadDirectory</b>(<i></i>)
335 <p>
336 Public method to get the current download directory.
337 </p><dl>
338 <dt>Returns:</dt>
339 <dd>
340 current download directory (string)
341 </dd>
342 </dl><a NAME="DownloadManager.downloads" ID="DownloadManager.downloads"></a>
343 <h4>DownloadManager.downloads</h4>
344 <b>downloads</b>(<i></i>)
345 <p>
346 Public method to get a reference to the downloads.
347 </p><dl>
348 <dt>Returns:</dt>
349 <dd>
350 reference to the downloads (list of DownloadItem)
351 </dd>
352 </dl><a NAME="DownloadManager.handleUnsupportedContent" ID="DownloadManager.handleUnsupportedContent"></a>
353 <h4>DownloadManager.handleUnsupportedContent</h4>
354 <b>handleUnsupportedContent</b>(<i>reply, requestFileName=False, webPage=None, download=False, mainWindow=None</i>)
355 <p>
356 Public method to handle unsupported content by downloading the
357 referenced resource.
358 </p><dl>
359 <dt><i>reply</i></dt>
360 <dd>
361 reference to the reply object (QNetworkReply)
362 </dd><dt><i>requestFileName=</i></dt>
363 <dd>
364 indicating to ask for a filename
365 (boolean)
366 </dd><dt><i>webPage=</i></dt>
367 <dd>
368 reference to the web page (HelpWebPage)
369 </dd><dt><i>download=</i></dt>
370 <dd>
371 flag indicating a download request (boolean)
372 </dd><dt><i>mainWindow=</i></dt>
373 <dd>
374 reference to the main window (HelpWindow)
375 </dd>
376 </dl><a NAME="DownloadManager.on_cleanupButton_clicked" ID="DownloadManager.on_cleanupButton_clicked"></a>
377 <h4>DownloadManager.on_cleanupButton_clicked</h4>
378 <b>on_cleanupButton_clicked</b>(<i></i>)
379 <p>
380 Private slot cleanup the downloads.
381 </p><a NAME="DownloadManager.removePolicy" ID="DownloadManager.removePolicy"></a>
382 <h4>DownloadManager.removePolicy</h4>
383 <b>removePolicy</b>(<i></i>)
384 <p>
385 Public method to get the remove policy.
386 </p><dl>
387 <dt>Returns:</dt>
388 <dd>
389 remove policy (integer)
390 </dd>
391 </dl><a NAME="DownloadManager.save" ID="DownloadManager.save"></a>
392 <h4>DownloadManager.save</h4>
393 <b>save</b>(<i></i>)
394 <p>
395 Public method to save the download settings.
396 </p><a NAME="DownloadManager.setDownloadDirectory" ID="DownloadManager.setDownloadDirectory"></a>
397 <h4>DownloadManager.setDownloadDirectory</h4>
398 <b>setDownloadDirectory</b>(<i>directory</i>)
399 <p>
400 Public method to set the current download directory.
401 </p><dl>
402 <dt><i>directory</i></dt>
403 <dd>
404 current download directory (string)
405 </dd>
406 </dl><a NAME="DownloadManager.setRemovePolicy" ID="DownloadManager.setRemovePolicy"></a>
407 <h4>DownloadManager.setRemovePolicy</h4>
408 <b>setRemovePolicy</b>(<i>policy</i>)
409 <p>
410 Public method to set the remove policy.
411 </p><dl>
412 <dt><i>policy</i></dt>
413 <dd>
414 policy to be set
415 (DownloadManager.RemoveExit, DownloadManager.RemoveNever,
416 DownloadManager.RemoveSuccessFullDownload)
417 </dd>
418 </dl><a NAME="DownloadManager.shutdown" ID="DownloadManager.shutdown"></a>
419 <h4>DownloadManager.shutdown</h4>
420 <b>shutdown</b>(<i></i>)
421 <p>
422 Public method to stop the download manager.
423 </p>
424 <div align="right"><a href="#top">Up</a></div>
425 <hr />
426 </body></html>

eric ide

mercurial