Helpviewer/HelpClearPrivateDataDialog.py

Fri, 01 Jan 2016 12:12:12 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 01 Jan 2016 12:12:12 +0100
changeset 4631
5c1a96925da4
parent 4612
c9982bcd00f8
child 5389
9b1c800daff3
permissions
-rw-r--r--

Updated copyright for 2016.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
4631
5c1a96925da4 Updated copyright for 2016.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4612
diff changeset
3 # Copyright (c) 2009 - 2016 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to select which private data to clear.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3145
a9de05d4a22f # __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3057
diff changeset
10 from __future__ import unicode_literals
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
11
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
12 from PyQt5.QtWidgets import QDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
14 from .Ui_HelpClearPrivateDataDialog import Ui_HelpClearPrivateDataDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
16
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 class HelpClearPrivateDataDialog(QDialog, Ui_HelpClearPrivateDataDialog):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 Class implementing a dialog to select which private data to clear.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
21 def __init__(self, parent=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 @param parent reference to the parent widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
27 super(HelpClearPrivateDataDialog, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 self.setupUi(self)
3366
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
29
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
30 msh = self.minimumSizeHint()
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
31 self.resize(max(self.width(), msh.width()), msh.height())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 def getData(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 Public method to get the data from the dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
37 @return tuple with flags indicating which data to clear
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
38 (browsing history, search history, favicons, disk cache, cookies,
4612
c9982bcd00f8 Added capability to remember the zoom values for each site (incl. a dialog to manage these).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
39 passwords, web databases, downloads, flash, zoom values) and the
c9982bcd00f8 Added capability to remember the zoom values for each site (incl. a dialog to manage these).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
40 selected history period in milliseconds (tuple of booleans and
c9982bcd00f8 Added capability to remember the zoom values for each site (incl. a dialog to manage these).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
41 integer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 """
1853
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
43 index = self.historyCombo.currentIndex()
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
44 if index == 0:
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
45 # last hour
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
46 historyPeriod = 60 * 60 * 1000
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
47 elif index == 1:
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
48 # last day
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
49 historyPeriod = 24 * 60 * 60 * 1000
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
50 elif index == 2:
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
51 # last week
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
52 historyPeriod = 7 * 24 * 60 * 60 * 1000
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
53 elif index == 3:
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
54 # last four weeks
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
55 historyPeriod = 4 * 7 * 24 * 60 * 60 * 1000
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
56 elif index == 4:
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
57 # clear all
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
58 historyPeriod = 0
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
59
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
60 return (self.historyCheckBox.isChecked(),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
61 self.searchCheckBox.isChecked(),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
62 self.iconsCheckBox.isChecked(),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
63 self.cacheCheckBox.isChecked(),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
64 self.cookiesCheckBox.isChecked(),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
65 self.passwordsCheckBox.isChecked(),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
66 self.databasesCheckBox.isChecked(),
1853
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
67 self.downloadsCheckBox.isChecked(),
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
68 self.flashCookiesCheckBox.isChecked(),
4612
c9982bcd00f8 Added capability to remember the zoom values for each site (incl. a dialog to manage these).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
69 self.zoomCheckBox.isChecked(),
1853
01812b281a1e Extended the "Clear Private Data" dialog of the web browser to clear flash cookies and to select a browsing history period to clear.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
70 historyPeriod)

eric ide

mercurial