|
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>eric4.Helpviewer.History.HistoryManager</title> |
|
6 <style> |
|
7 body { |
|
8 background:white; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #4FA4FF; } |
|
14 h2 { color: white; background: #4FA4FF; } |
|
15 h3 { color: white; background: #00557F; } |
|
16 h4 { color: white; background: #00557F; } |
|
17 |
|
18 a { color: #AA5500; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric4.Helpviewer.History.HistoryManager</h1> |
|
24 <p> |
|
25 Module implementing the history manager. |
|
26 </p> |
|
27 <h3>Global Attributes</h3> |
|
28 <table> |
|
29 <tr><td>HISTORY_VERSION</td></tr> |
|
30 </table> |
|
31 <h3>Classes</h3> |
|
32 <table> |
|
33 <tr> |
|
34 <td><a href="#HistoryEntry">HistoryEntry</a></td> |
|
35 <td>Class implementing a history entry.</td> |
|
36 </tr><tr> |
|
37 <td><a href="#HistoryManager">HistoryManager</a></td> |
|
38 <td>Class implementing the history manager.</td> |
|
39 </tr> |
|
40 </table> |
|
41 <h3>Functions</h3> |
|
42 <table> |
|
43 <tr><td>None</td></tr> |
|
44 </table> |
|
45 <hr /><hr /> |
|
46 <a NAME="HistoryEntry" ID="HistoryEntry"></a> |
|
47 <h2>HistoryEntry</h2> |
|
48 <p> |
|
49 Class implementing a history entry. |
|
50 </p> |
|
51 <h3>Derived from</h3> |
|
52 object |
|
53 <h3>Class Attributes</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#HistoryEntry.__init__">HistoryEntry</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#HistoryEntry.__eq__">__eq__</a></td> |
|
64 <td>Special method determining equality.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#HistoryEntry.__lt__">__lt__</a></td> |
|
67 <td>Special method determining less relation.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#HistoryEntry.userTitle">userTitle</a></td> |
|
70 <td>Public method to get the title of the history entry.</td> |
|
71 </tr> |
|
72 </table> |
|
73 <a NAME="HistoryEntry.__init__" ID="HistoryEntry.__init__"></a> |
|
74 <h4>HistoryEntry (Constructor)</h4> |
|
75 <b>HistoryEntry</b>(<i>url = None, dateTime = None, title = None</i>) |
|
76 <p> |
|
77 Constructor |
|
78 </p><dl> |
|
79 <dt><i>url</i></dt> |
|
80 <dd> |
|
81 URL of the history entry (string) |
|
82 </dd><dt><i>dateTime</i></dt> |
|
83 <dd> |
|
84 date and time this entry was created (QDateTime) |
|
85 </dd><dt><i>title</i></dt> |
|
86 <dd> |
|
87 title string for the history entry (string) |
|
88 </dd> |
|
89 </dl><a NAME="HistoryEntry.__eq__" ID="HistoryEntry.__eq__"></a> |
|
90 <h4>HistoryEntry.__eq__</h4> |
|
91 <b>__eq__</b>(<i>other</i>) |
|
92 <p> |
|
93 Special method determining equality. |
|
94 </p><dl> |
|
95 <dt><i>other</i></dt> |
|
96 <dd> |
|
97 reference to the history entry to compare against (HistoryEntry) |
|
98 </dd> |
|
99 </dl><dl> |
|
100 <dt>Returns:</dt> |
|
101 <dd> |
|
102 flag indicating equality (boolean) |
|
103 </dd> |
|
104 </dl><a NAME="HistoryEntry.__lt__" ID="HistoryEntry.__lt__"></a> |
|
105 <h4>HistoryEntry.__lt__</h4> |
|
106 <b>__lt__</b>(<i>other</i>) |
|
107 <p> |
|
108 Special method determining less relation. |
|
109 </p><p> |
|
110 Note: History is sorted in reverse order by date and time |
|
111 </p><dl> |
|
112 <dt><i>other</i></dt> |
|
113 <dd> |
|
114 reference to the history entry to compare against (HistoryEntry) |
|
115 </dd> |
|
116 </dl><dl> |
|
117 <dt>Returns:</dt> |
|
118 <dd> |
|
119 flag indicating less (boolean) |
|
120 </dd> |
|
121 </dl><a NAME="HistoryEntry.userTitle" ID="HistoryEntry.userTitle"></a> |
|
122 <h4>HistoryEntry.userTitle</h4> |
|
123 <b>userTitle</b>(<i></i>) |
|
124 <p> |
|
125 Public method to get the title of the history entry. |
|
126 </p><dl> |
|
127 <dt>Returns:</dt> |
|
128 <dd> |
|
129 title of the entry (string) |
|
130 </dd> |
|
131 </dl> |
|
132 <div align="right"><a href="#top">Up</a></div> |
|
133 <hr /><hr /> |
|
134 <a NAME="HistoryManager" ID="HistoryManager"></a> |
|
135 <h2>HistoryManager</h2> |
|
136 <p> |
|
137 Class implementing the history manager. |
|
138 </p><h4>Signals</h4> |
|
139 <dl> |
|
140 <dt>entryAdded</dt> |
|
141 <dd> |
|
142 emitted after a history entry has been added |
|
143 </dd><dt>entryRemoved</dt> |
|
144 <dd> |
|
145 emitted after a history entry has been removed |
|
146 </dd><dt>entryUpdated(int)</dt> |
|
147 <dd> |
|
148 emitted after a history entry has been updated |
|
149 </dd><dt>historyCleared()</dt> |
|
150 <dd> |
|
151 emitted after the history has been cleared |
|
152 </dd><dt>historyReset()</dt> |
|
153 <dd> |
|
154 emitted after the history has been reset |
|
155 </dd> |
|
156 </dl> |
|
157 <h3>Derived from</h3> |
|
158 QWebHistoryInterface |
|
159 <h3>Class Attributes</h3> |
|
160 <table> |
|
161 <tr><td>None</td></tr> |
|
162 </table> |
|
163 <h3>Methods</h3> |
|
164 <table> |
|
165 <tr> |
|
166 <td><a href="#HistoryManager.__init__">HistoryManager</a></td> |
|
167 <td>Constructor</td> |
|
168 </tr><tr> |
|
169 <td><a href="#HistoryManager.__checkForExpired">__checkForExpired</a></td> |
|
170 <td>Private slot to check entries for expiration.</td> |
|
171 </tr><tr> |
|
172 <td><a href="#HistoryManager.__load">__load</a></td> |
|
173 <td>Private method to load the saved history entries from disk.</td> |
|
174 </tr><tr> |
|
175 <td><a href="#HistoryManager.__refreshFrequencies">__refreshFrequencies</a></td> |
|
176 <td>Private slot to recalculate the refresh frequencies.</td> |
|
177 </tr><tr> |
|
178 <td><a href="#HistoryManager.__startFrequencyTimer">__startFrequencyTimer</a></td> |
|
179 <td>Private method to start the timer to recalculate the frequencies.</td> |
|
180 </tr><tr> |
|
181 <td><a href="#HistoryManager._addHistoryEntry">_addHistoryEntry</a></td> |
|
182 <td>Protected method to add a history item.</td> |
|
183 </tr><tr> |
|
184 <td><a href="#HistoryManager._removeHistoryEntry">_removeHistoryEntry</a></td> |
|
185 <td>Protected method to remove a history item.</td> |
|
186 </tr><tr> |
|
187 <td><a href="#HistoryManager.addHistoryEntry">addHistoryEntry</a></td> |
|
188 <td>Public method to add a history entry.</td> |
|
189 </tr><tr> |
|
190 <td><a href="#HistoryManager.clear">clear</a></td> |
|
191 <td>Public slot to clear the complete history.</td> |
|
192 </tr><tr> |
|
193 <td><a href="#HistoryManager.close">close</a></td> |
|
194 <td>Public method to close the history manager.</td> |
|
195 </tr><tr> |
|
196 <td><a href="#HistoryManager.daysToExpire">daysToExpire</a></td> |
|
197 <td>Public method to get the days for entry expiration.</td> |
|
198 </tr><tr> |
|
199 <td><a href="#HistoryManager.history">history</a></td> |
|
200 <td>Public method to return the history.</td> |
|
201 </tr><tr> |
|
202 <td><a href="#HistoryManager.historyContains">historyContains</a></td> |
|
203 <td>Public method to check the history for an entry.</td> |
|
204 </tr><tr> |
|
205 <td><a href="#HistoryManager.historyFilterModel">historyFilterModel</a></td> |
|
206 <td>Public method to get a reference to the history filter model.</td> |
|
207 </tr><tr> |
|
208 <td><a href="#HistoryManager.historyModel">historyModel</a></td> |
|
209 <td>Public method to get a reference to the history model.</td> |
|
210 </tr><tr> |
|
211 <td><a href="#HistoryManager.historyTreeModel">historyTreeModel</a></td> |
|
212 <td>Public method to get a reference to the history tree model.</td> |
|
213 </tr><tr> |
|
214 <td><a href="#HistoryManager.preferencesChanged">preferencesChanged</a></td> |
|
215 <td>Public method to indicate a change of preferences.</td> |
|
216 </tr><tr> |
|
217 <td><a href="#HistoryManager.removeHistoryEntry">removeHistoryEntry</a></td> |
|
218 <td>Public method to remove a history entry.</td> |
|
219 </tr><tr> |
|
220 <td><a href="#HistoryManager.save">save</a></td> |
|
221 <td>Public slot to save the history entries to disk.</td> |
|
222 </tr><tr> |
|
223 <td><a href="#HistoryManager.setDaysToExpire">setDaysToExpire</a></td> |
|
224 <td>Public method to set the days for entry expiration.</td> |
|
225 </tr><tr> |
|
226 <td><a href="#HistoryManager.setHistory">setHistory</a></td> |
|
227 <td>Public method to set a new history.</td> |
|
228 </tr><tr> |
|
229 <td><a href="#HistoryManager.updateHistoryEntry">updateHistoryEntry</a></td> |
|
230 <td>Public method to update a history entry.</td> |
|
231 </tr> |
|
232 </table> |
|
233 <a NAME="HistoryManager.__init__" ID="HistoryManager.__init__"></a> |
|
234 <h4>HistoryManager (Constructor)</h4> |
|
235 <b>HistoryManager</b>(<i>parent = None</i>) |
|
236 <p> |
|
237 Constructor |
|
238 </p><dl> |
|
239 <dt><i>parent</i></dt> |
|
240 <dd> |
|
241 reference to the parent object (QObject) |
|
242 </dd> |
|
243 </dl><a NAME="HistoryManager.__checkForExpired" ID="HistoryManager.__checkForExpired"></a> |
|
244 <h4>HistoryManager.__checkForExpired</h4> |
|
245 <b>__checkForExpired</b>(<i></i>) |
|
246 <p> |
|
247 Private slot to check entries for expiration. |
|
248 </p><a NAME="HistoryManager.__load" ID="HistoryManager.__load"></a> |
|
249 <h4>HistoryManager.__load</h4> |
|
250 <b>__load</b>(<i></i>) |
|
251 <p> |
|
252 Private method to load the saved history entries from disk. |
|
253 </p><a NAME="HistoryManager.__refreshFrequencies" ID="HistoryManager.__refreshFrequencies"></a> |
|
254 <h4>HistoryManager.__refreshFrequencies</h4> |
|
255 <b>__refreshFrequencies</b>(<i></i>) |
|
256 <p> |
|
257 Private slot to recalculate the refresh frequencies. |
|
258 </p><a NAME="HistoryManager.__startFrequencyTimer" ID="HistoryManager.__startFrequencyTimer"></a> |
|
259 <h4>HistoryManager.__startFrequencyTimer</h4> |
|
260 <b>__startFrequencyTimer</b>(<i></i>) |
|
261 <p> |
|
262 Private method to start the timer to recalculate the frequencies. |
|
263 </p><a NAME="HistoryManager._addHistoryEntry" ID="HistoryManager._addHistoryEntry"></a> |
|
264 <h4>HistoryManager._addHistoryEntry</h4> |
|
265 <b>_addHistoryEntry</b>(<i>itm</i>) |
|
266 <p> |
|
267 Protected method to add a history item. |
|
268 </p><dl> |
|
269 <dt><i>itm</i></dt> |
|
270 <dd> |
|
271 reference to the history item to add (HistoryEntry) |
|
272 </dd> |
|
273 </dl><a NAME="HistoryManager._removeHistoryEntry" ID="HistoryManager._removeHistoryEntry"></a> |
|
274 <h4>HistoryManager._removeHistoryEntry</h4> |
|
275 <b>_removeHistoryEntry</b>(<i>itm</i>) |
|
276 <p> |
|
277 Protected method to remove a history item. |
|
278 </p><dl> |
|
279 <dt><i>itm</i></dt> |
|
280 <dd> |
|
281 reference to the history item to remove (HistoryEntry) |
|
282 </dd> |
|
283 </dl><a NAME="HistoryManager.addHistoryEntry" ID="HistoryManager.addHistoryEntry"></a> |
|
284 <h4>HistoryManager.addHistoryEntry</h4> |
|
285 <b>addHistoryEntry</b>(<i>url</i>) |
|
286 <p> |
|
287 Public method to add a history entry. |
|
288 </p><dl> |
|
289 <dt><i>url</i></dt> |
|
290 <dd> |
|
291 URL to be added (string) |
|
292 </dd> |
|
293 </dl><a NAME="HistoryManager.clear" ID="HistoryManager.clear"></a> |
|
294 <h4>HistoryManager.clear</h4> |
|
295 <b>clear</b>(<i></i>) |
|
296 <p> |
|
297 Public slot to clear the complete history. |
|
298 </p><a NAME="HistoryManager.close" ID="HistoryManager.close"></a> |
|
299 <h4>HistoryManager.close</h4> |
|
300 <b>close</b>(<i></i>) |
|
301 <p> |
|
302 Public method to close the history manager. |
|
303 </p><a NAME="HistoryManager.daysToExpire" ID="HistoryManager.daysToExpire"></a> |
|
304 <h4>HistoryManager.daysToExpire</h4> |
|
305 <b>daysToExpire</b>(<i></i>) |
|
306 <p> |
|
307 Public method to get the days for entry expiration. |
|
308 </p><dl> |
|
309 <dt>Returns:</dt> |
|
310 <dd> |
|
311 days for entry expiration (integer) |
|
312 </dd> |
|
313 </dl><a NAME="HistoryManager.history" ID="HistoryManager.history"></a> |
|
314 <h4>HistoryManager.history</h4> |
|
315 <b>history</b>(<i></i>) |
|
316 <p> |
|
317 Public method to return the history. |
|
318 </p><dl> |
|
319 <dt>Returns:</dt> |
|
320 <dd> |
|
321 reference to the list of history entries (list of HistoryEntry) |
|
322 </dd> |
|
323 </dl><a NAME="HistoryManager.historyContains" ID="HistoryManager.historyContains"></a> |
|
324 <h4>HistoryManager.historyContains</h4> |
|
325 <b>historyContains</b>(<i>url</i>) |
|
326 <p> |
|
327 Public method to check the history for an entry. |
|
328 </p><dl> |
|
329 <dt><i>url</i></dt> |
|
330 <dd> |
|
331 URL to check for (string) |
|
332 </dd> |
|
333 </dl><dl> |
|
334 <dt>Returns:</dt> |
|
335 <dd> |
|
336 flag indicating success (boolean) |
|
337 </dd> |
|
338 </dl><a NAME="HistoryManager.historyFilterModel" ID="HistoryManager.historyFilterModel"></a> |
|
339 <h4>HistoryManager.historyFilterModel</h4> |
|
340 <b>historyFilterModel</b>(<i></i>) |
|
341 <p> |
|
342 Public method to get a reference to the history filter model. |
|
343 </p><dl> |
|
344 <dt>Returns:</dt> |
|
345 <dd> |
|
346 reference to the history filter model (HistoryFilterModel) |
|
347 </dd> |
|
348 </dl><a NAME="HistoryManager.historyModel" ID="HistoryManager.historyModel"></a> |
|
349 <h4>HistoryManager.historyModel</h4> |
|
350 <b>historyModel</b>(<i></i>) |
|
351 <p> |
|
352 Public method to get a reference to the history model. |
|
353 </p><dl> |
|
354 <dt>Returns:</dt> |
|
355 <dd> |
|
356 reference to the history model (HistoryModel) |
|
357 </dd> |
|
358 </dl><a NAME="HistoryManager.historyTreeModel" ID="HistoryManager.historyTreeModel"></a> |
|
359 <h4>HistoryManager.historyTreeModel</h4> |
|
360 <b>historyTreeModel</b>(<i></i>) |
|
361 <p> |
|
362 Public method to get a reference to the history tree model. |
|
363 </p><dl> |
|
364 <dt>Returns:</dt> |
|
365 <dd> |
|
366 reference to the history tree model (HistoryTreeModel) |
|
367 </dd> |
|
368 </dl><a NAME="HistoryManager.preferencesChanged" ID="HistoryManager.preferencesChanged"></a> |
|
369 <h4>HistoryManager.preferencesChanged</h4> |
|
370 <b>preferencesChanged</b>(<i></i>) |
|
371 <p> |
|
372 Public method to indicate a change of preferences. |
|
373 </p><a NAME="HistoryManager.removeHistoryEntry" ID="HistoryManager.removeHistoryEntry"></a> |
|
374 <h4>HistoryManager.removeHistoryEntry</h4> |
|
375 <b>removeHistoryEntry</b>(<i>url, title = ""</i>) |
|
376 <p> |
|
377 Public method to remove a history entry. |
|
378 </p><dl> |
|
379 <dt><i>url</i></dt> |
|
380 <dd> |
|
381 URL of the entry to remove (QUrl) |
|
382 </dd><dt><i>title</i></dt> |
|
383 <dd> |
|
384 title of the entry to remove (string) |
|
385 </dd> |
|
386 </dl><a NAME="HistoryManager.save" ID="HistoryManager.save"></a> |
|
387 <h4>HistoryManager.save</h4> |
|
388 <b>save</b>(<i></i>) |
|
389 <p> |
|
390 Public slot to save the history entries to disk. |
|
391 </p><a NAME="HistoryManager.setDaysToExpire" ID="HistoryManager.setDaysToExpire"></a> |
|
392 <h4>HistoryManager.setDaysToExpire</h4> |
|
393 <b>setDaysToExpire</b>(<i>limit</i>) |
|
394 <p> |
|
395 Public method to set the days for entry expiration. |
|
396 </p><dl> |
|
397 <dt><i>limit</i></dt> |
|
398 <dd> |
|
399 days for entry expiration (integer) |
|
400 </dd> |
|
401 </dl><a NAME="HistoryManager.setHistory" ID="HistoryManager.setHistory"></a> |
|
402 <h4>HistoryManager.setHistory</h4> |
|
403 <b>setHistory</b>(<i>history, loadedAndSorted = False</i>) |
|
404 <p> |
|
405 Public method to set a new history. |
|
406 </p><dl> |
|
407 <dt><i>history</i></dt> |
|
408 <dd> |
|
409 reference to the list of history entries to be set |
|
410 (list of HistoryEntry) |
|
411 </dd><dt><i>loadedAndSorted</i></dt> |
|
412 <dd> |
|
413 flag indicating that the list is sorted (boolean) |
|
414 </dd> |
|
415 </dl><a NAME="HistoryManager.updateHistoryEntry" ID="HistoryManager.updateHistoryEntry"></a> |
|
416 <h4>HistoryManager.updateHistoryEntry</h4> |
|
417 <b>updateHistoryEntry</b>(<i>url, title</i>) |
|
418 <p> |
|
419 Public method to update a history entry. |
|
420 </p><dl> |
|
421 <dt><i>url</i></dt> |
|
422 <dd> |
|
423 URL of the entry to update (string) |
|
424 </dd><dt><i>title</i></dt> |
|
425 <dd> |
|
426 title of the entry to update (string) |
|
427 </dd> |
|
428 </dl> |
|
429 <div align="right"><a href="#top">Up</a></div> |
|
430 <hr /> |
|
431 </body></html> |