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