6 """ |
6 """ |
7 Module implementing a dialog to select which private data to clear. |
7 Module implementing a dialog to select which private data to clear. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt6.QtWidgets import QDialog |
10 from PyQt6.QtWidgets import QDialog |
|
11 |
|
12 from eric7.SystemUtilities import QtUtilities |
11 |
13 |
12 from .Ui_WebBrowserClearPrivateDataDialog import Ui_WebBrowserClearPrivateDataDialog |
14 from .Ui_WebBrowserClearPrivateDataDialog import Ui_WebBrowserClearPrivateDataDialog |
13 |
15 |
14 |
16 |
15 class WebBrowserClearPrivateDataDialog(QDialog, Ui_WebBrowserClearPrivateDataDialog): |
17 class WebBrowserClearPrivateDataDialog(QDialog, Ui_WebBrowserClearPrivateDataDialog): |
25 @type QWidget |
27 @type QWidget |
26 """ |
28 """ |
27 super().__init__(parent) |
29 super().__init__(parent) |
28 self.setupUi(self) |
30 self.setupUi(self) |
29 |
31 |
|
32 self.permissionsCheckBox.setEnabled(QtUtilities.qVersionTuple() >= (6, 8, 0)) |
|
33 |
30 msh = self.minimumSizeHint() |
34 msh = self.minimumSizeHint() |
31 self.resize(max(self.width(), msh.width()), msh.height()) |
35 self.resize(max(self.width(), msh.width()), msh.height()) |
32 |
36 |
33 def getData(self): |
37 def getData(self): |
34 """ |
38 """ |
35 Public method to get the data from the dialog. |
39 Public method to get the data from the dialog. |
36 |
40 |
37 @return tuple with flags indicating which data to clear |
41 @return tuple with flags indicating which data to clear |
38 (browsing history, search history, favicons, disk cache, cookies, |
42 (browsing history, search history, favicons, disk cache, cookies, |
39 passwords, downloads, zoom values, SSL certificate error exceptions) and |
43 passwords, downloads, zoom values, SSL certificate error exceptions, |
40 the selected history period in milliseconds |
44 website permissions) and the selected history period in milliseconds |
41 @rtype tuple of (bool, bool, bool, bool, bool, bool, bool, bool, bool, int) |
45 @rtype tuple of (bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, |
|
46 int) |
42 """ |
47 """ |
43 index = self.historyCombo.currentIndex() |
48 index = self.historyCombo.currentIndex() |
44 if index == 0: |
49 if index == 0: |
45 # last hour |
50 # last hour |
46 historyPeriod = 60 * 60 * 1000 |
51 historyPeriod = 60 * 60 * 1000 |
65 self.cookiesCheckBox.isChecked(), |
70 self.cookiesCheckBox.isChecked(), |
66 self.passwordsCheckBox.isChecked(), |
71 self.passwordsCheckBox.isChecked(), |
67 self.downloadsCheckBox.isChecked(), |
72 self.downloadsCheckBox.isChecked(), |
68 self.zoomCheckBox.isChecked(), |
73 self.zoomCheckBox.isChecked(), |
69 self.sslExceptionsCheckBox.isChecked(), |
74 self.sslExceptionsCheckBox.isChecked(), |
|
75 self.permissionsCheckBox.isChecked() |
|
76 if QtUtilities.qVersionTuple() >= (6, 8, 0) |
|
77 else False, |
70 historyPeriod, |
78 historyPeriod, |
71 ) |
79 ) |