|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric5.Helpviewer.Download.DownloadManager</title> |
|
6 <style> |
|
7 body { |
|
8 background: #EDECE6; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #85774A; } |
|
14 h2 { color: white; background: #85774A; } |
|
15 h3 { color: white; background: #9D936E; } |
|
16 h4 { color: white; background: #9D936E; } |
|
17 |
|
18 a { color: #BA6D36; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric5.Helpviewer.Download.DownloadManager</h1> |
|
24 <p> |
|
25 Module implementing the download manager class. |
|
26 </p> |
|
27 <h3>Global Attributes</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 <h3>Classes</h3> |
|
32 <table> |
|
33 <tr> |
|
34 <td><a href="#DownloadManager">DownloadManager</a></td> |
|
35 <td>Class implementing the download manager</td> |
|
36 </tr> |
|
37 </table> |
|
38 <h3>Functions</h3> |
|
39 <table> |
|
40 <tr><td>None</td></tr> |
|
41 </table> |
|
42 <hr /><hr /> |
|
43 <a NAME="DownloadManager" ID="DownloadManager"></a> |
|
44 <h2>DownloadManager</h2> |
|
45 <p> |
|
46 Class implementing the download manager |
|
47 </p> |
|
48 <h3>Derived from</h3> |
|
49 QDialog, Ui_DownloadManager |
|
50 <h3>Class Attributes</h3> |
|
51 <table> |
|
52 <tr><td>RemoveExit</td></tr><tr><td>RemoveNever</td></tr><tr><td>RemoveSuccessFullDownload</td></tr> |
|
53 </table> |
|
54 <h3>Methods</h3> |
|
55 <table> |
|
56 <tr> |
|
57 <td><a href="#DownloadManager.__init__">DownloadManager</a></td> |
|
58 <td>Constructor</td> |
|
59 </tr><tr> |
|
60 <td><a href="#DownloadManager.__addItem">__addItem</a></td> |
|
61 <td>Private method to add a download to the list of downloads.</td> |
|
62 </tr><tr> |
|
63 <td><a href="#DownloadManager.__load">__load</a></td> |
|
64 <td>Public method to load the download settings.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#DownloadManager.__updateItemCount">__updateItemCount</a></td> |
|
67 <td>Private method to update the count label.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#DownloadManager.__updateRow">__updateRow</a></td> |
|
70 <td>Private slot to update a download item.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#DownloadManager.activeDownloads">activeDownloads</a></td> |
|
73 <td>Public method to get the number of active downloads.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#DownloadManager.allowQuit">allowQuit</a></td> |
|
76 <td>Public method to check, if it is ok to quit.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#DownloadManager.changeOccurred">changeOccurred</a></td> |
|
79 <td>Public method to signal a change.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#DownloadManager.cleanup">cleanup</a></td> |
|
82 <td>Public slot to cleanup the downloads.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#DownloadManager.count">count</a></td> |
|
85 <td>Public method to get the number of downloads.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#DownloadManager.download">download</a></td> |
|
88 <td>Public method to download a file.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#DownloadManager.downloadDirectory">downloadDirectory</a></td> |
|
91 <td>Public method to get the current download directory.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#DownloadManager.downloads">downloads</a></td> |
|
94 <td>Public method to get a reference to the downloads.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#DownloadManager.handleUnsupportedContent">handleUnsupportedContent</a></td> |
|
97 <td></td> |
|
98 </tr><tr> |
|
99 <td><a href="#DownloadManager.on_cleanupButton_clicked">on_cleanupButton_clicked</a></td> |
|
100 <td>Private slot cleanup the downloads.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#DownloadManager.removePolicy">removePolicy</a></td> |
|
103 <td>Public method to get the remove policy.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#DownloadManager.save">save</a></td> |
|
106 <td>Public method to save the download settings.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#DownloadManager.setDownloadDirectory">setDownloadDirectory</a></td> |
|
109 <td>Public method to set the current download directory.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#DownloadManager.setRemovePolicy">setRemovePolicy</a></td> |
|
112 <td>Public method to set the remove policy.</td> |
|
113 </tr><tr> |
|
114 <td><a href="#DownloadManager.shutdown">shutdown</a></td> |
|
115 <td>Public method to stop the download manager.</td> |
|
116 </tr> |
|
117 </table> |
|
118 <a NAME="DownloadManager.__init__" ID="DownloadManager.__init__"></a> |
|
119 <h4>DownloadManager (Constructor)</h4> |
|
120 <b>DownloadManager</b>(<i>parent = None</i>) |
|
121 <p> |
|
122 Constructor |
|
123 </p><dl> |
|
124 <dt><i>parent</i></dt> |
|
125 <dd> |
|
126 reference to the parent widget (QWidget) |
|
127 </dd> |
|
128 </dl><a NAME="DownloadManager.__addItem" ID="DownloadManager.__addItem"></a> |
|
129 <h4>DownloadManager.__addItem</h4> |
|
130 <b>__addItem</b>(<i>itm</i>) |
|
131 <p> |
|
132 Private method to add a download to the list of downloads. |
|
133 </p><dl> |
|
134 <dt><i>itm</i></dt> |
|
135 <dd> |
|
136 reference to the download item (DownloadItem) |
|
137 </dd> |
|
138 </dl><a NAME="DownloadManager.__load" ID="DownloadManager.__load"></a> |
|
139 <h4>DownloadManager.__load</h4> |
|
140 <b>__load</b>(<i></i>) |
|
141 <p> |
|
142 Public method to load the download settings. |
|
143 </p><a NAME="DownloadManager.__updateItemCount" ID="DownloadManager.__updateItemCount"></a> |
|
144 <h4>DownloadManager.__updateItemCount</h4> |
|
145 <b>__updateItemCount</b>(<i></i>) |
|
146 <p> |
|
147 Private method to update the count label. |
|
148 </p><a NAME="DownloadManager.__updateRow" ID="DownloadManager.__updateRow"></a> |
|
149 <h4>DownloadManager.__updateRow</h4> |
|
150 <b>__updateRow</b>(<i>itm = None</i>) |
|
151 <p> |
|
152 Private slot to update a download item. |
|
153 </p><dl> |
|
154 <dt><i>itm</i></dt> |
|
155 <dd> |
|
156 reference to the download item (DownloadItem) |
|
157 </dd> |
|
158 </dl><a NAME="DownloadManager.activeDownloads" ID="DownloadManager.activeDownloads"></a> |
|
159 <h4>DownloadManager.activeDownloads</h4> |
|
160 <b>activeDownloads</b>(<i></i>) |
|
161 <p> |
|
162 Public method to get the number of active downloads. |
|
163 </p><dl> |
|
164 <dt>Returns:</dt> |
|
165 <dd> |
|
166 number of active downloads (integer) |
|
167 </dd> |
|
168 </dl><a NAME="DownloadManager.allowQuit" ID="DownloadManager.allowQuit"></a> |
|
169 <h4>DownloadManager.allowQuit</h4> |
|
170 <b>allowQuit</b>(<i></i>) |
|
171 <p> |
|
172 Public method to check, if it is ok to quit. |
|
173 </p><dl> |
|
174 <dt>Returns:</dt> |
|
175 <dd> |
|
176 flag indicating allowance to quit (boolean) |
|
177 </dd> |
|
178 </dl><a NAME="DownloadManager.changeOccurred" ID="DownloadManager.changeOccurred"></a> |
|
179 <h4>DownloadManager.changeOccurred</h4> |
|
180 <b>changeOccurred</b>(<i></i>) |
|
181 <p> |
|
182 Public method to signal a change. |
|
183 </p><a NAME="DownloadManager.cleanup" ID="DownloadManager.cleanup"></a> |
|
184 <h4>DownloadManager.cleanup</h4> |
|
185 <b>cleanup</b>(<i></i>) |
|
186 <p> |
|
187 Public slot to cleanup the downloads. |
|
188 </p><a NAME="DownloadManager.count" ID="DownloadManager.count"></a> |
|
189 <h4>DownloadManager.count</h4> |
|
190 <b>count</b>(<i></i>) |
|
191 <p> |
|
192 Public method to get the number of downloads. |
|
193 </p><dl> |
|
194 <dt>Returns:</dt> |
|
195 <dd> |
|
196 number of downloads (integer) |
|
197 </dd> |
|
198 </dl><a NAME="DownloadManager.download" ID="DownloadManager.download"></a> |
|
199 <h4>DownloadManager.download</h4> |
|
200 <b>download</b>(<i>requestOrUrl, requestFileName = False</i>) |
|
201 <p> |
|
202 Public method to download a file. |
|
203 </p><dl> |
|
204 <dt><i>requestOrUrl</i></dt> |
|
205 <dd> |
|
206 reference to a request object (QNetworkRequest) |
|
207 or a URL to be downloaded (QUrl) |
|
208 </dd><dt><i>requestFileName=</i></dt> |
|
209 <dd> |
|
210 flag indicating to ask for the |
|
211 download file name (boolean) |
|
212 </dd> |
|
213 </dl><a NAME="DownloadManager.downloadDirectory" ID="DownloadManager.downloadDirectory"></a> |
|
214 <h4>DownloadManager.downloadDirectory</h4> |
|
215 <b>downloadDirectory</b>(<i></i>) |
|
216 <p> |
|
217 Public method to get the current download directory. |
|
218 </p><dl> |
|
219 <dt>Returns:</dt> |
|
220 <dd> |
|
221 current download directory (string) |
|
222 </dd> |
|
223 </dl><a NAME="DownloadManager.downloads" ID="DownloadManager.downloads"></a> |
|
224 <h4>DownloadManager.downloads</h4> |
|
225 <b>downloads</b>(<i></i>) |
|
226 <p> |
|
227 Public method to get a reference to the downloads. |
|
228 </p><dl> |
|
229 <dt>Returns:</dt> |
|
230 <dd> |
|
231 reference to the downloads (list of DownloadItem) |
|
232 </dd> |
|
233 </dl><a NAME="DownloadManager.handleUnsupportedContent" ID="DownloadManager.handleUnsupportedContent"></a> |
|
234 <h4>DownloadManager.handleUnsupportedContent</h4> |
|
235 <b>handleUnsupportedContent</b>(<i>reply, requestFileName = False, webPage = None, download = False</i>) |
|
236 <a NAME="DownloadManager.on_cleanupButton_clicked" ID="DownloadManager.on_cleanupButton_clicked"></a> |
|
237 <h4>DownloadManager.on_cleanupButton_clicked</h4> |
|
238 <b>on_cleanupButton_clicked</b>(<i></i>) |
|
239 <p> |
|
240 Private slot cleanup the downloads. |
|
241 </p><a NAME="DownloadManager.removePolicy" ID="DownloadManager.removePolicy"></a> |
|
242 <h4>DownloadManager.removePolicy</h4> |
|
243 <b>removePolicy</b>(<i></i>) |
|
244 <p> |
|
245 Public method to get the remove policy. |
|
246 </p><dl> |
|
247 <dt>Returns:</dt> |
|
248 <dd> |
|
249 remove policy (integer) |
|
250 </dd> |
|
251 </dl><a NAME="DownloadManager.save" ID="DownloadManager.save"></a> |
|
252 <h4>DownloadManager.save</h4> |
|
253 <b>save</b>(<i></i>) |
|
254 <p> |
|
255 Public method to save the download settings. |
|
256 </p><a NAME="DownloadManager.setDownloadDirectory" ID="DownloadManager.setDownloadDirectory"></a> |
|
257 <h4>DownloadManager.setDownloadDirectory</h4> |
|
258 <b>setDownloadDirectory</b>(<i>directory</i>) |
|
259 <p> |
|
260 Public method to set the current download directory. |
|
261 </p><dl> |
|
262 <dt><i>directory</i></dt> |
|
263 <dd> |
|
264 current download directory (string) |
|
265 </dd> |
|
266 </dl><a NAME="DownloadManager.setRemovePolicy" ID="DownloadManager.setRemovePolicy"></a> |
|
267 <h4>DownloadManager.setRemovePolicy</h4> |
|
268 <b>setRemovePolicy</b>(<i>policy</i>) |
|
269 <p> |
|
270 Public method to set the remove policy. |
|
271 </p><dl> |
|
272 <dt><i>policy</i></dt> |
|
273 <dd> |
|
274 policy to be set |
|
275 (DownloadManager.RemoveExit, DownloadManager.RemoveNever, |
|
276 DownloadManager.RemoveSuccessFullDownload) |
|
277 </dd> |
|
278 </dl><a NAME="DownloadManager.shutdown" ID="DownloadManager.shutdown"></a> |
|
279 <h4>DownloadManager.shutdown</h4> |
|
280 <b>shutdown</b>(<i></i>) |
|
281 <p> |
|
282 Public method to stop the download manager. |
|
283 </p> |
|
284 <div align="right"><a href="#top">Up</a></div> |
|
285 <hr /> |
|
286 </body></html> |