|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2015 - 2019 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the Flash Cookies Manager configuration page. |
|
8 """ |
|
9 |
|
10 from __future__ import unicode_literals |
|
11 |
|
12 from E5Gui.E5PathPicker import E5PathPickerModes |
|
13 |
|
14 from .ConfigurationPageBase import ConfigurationPageBase |
|
15 from .Ui_WebBrowserFlashCookieManagerPage import \ |
|
16 Ui_WebBrowserFlashCookieManagerPage |
|
17 |
|
18 import Preferences |
|
19 |
|
20 |
|
21 class WebBrowserFlashCookieManagerPage(ConfigurationPageBase, |
|
22 Ui_WebBrowserFlashCookieManagerPage): |
|
23 """ |
|
24 Class implementing the Flash Cookies Manager configuration page. |
|
25 """ |
|
26 def __init__(self): |
|
27 """ |
|
28 Constructor |
|
29 """ |
|
30 super(WebBrowserFlashCookieManagerPage, self).__init__() |
|
31 self.setupUi(self) |
|
32 self.setObjectName("WebBrowserFlashCookieManagerPage") |
|
33 |
|
34 self.flashDataPathPicker.setMode(E5PathPickerModes.DirectoryMode) |
|
35 |
|
36 # set initial values |
|
37 self.flashDataPathPicker.setText( |
|
38 Preferences.getWebBrowser("FlashCookiesDataPath")) |
|
39 self.autoModeGroup.setChecked( |
|
40 Preferences.getWebBrowser("FlashCookieAutoRefresh")) |
|
41 self.notificationGroup.setChecked( |
|
42 Preferences.getWebBrowser("FlashCookieNotify")) |
|
43 self.deleteGroup.setChecked( |
|
44 Preferences.getWebBrowser("FlashCookiesDeleteOnStartExit")) |
|
45 |
|
46 def save(self): |
|
47 """ |
|
48 Public slot to save the Flash Cookies Manager configuration. |
|
49 """ |
|
50 Preferences.setWebBrowser("FlashCookiesDataPath", |
|
51 self.flashDataPathPicker.text()) |
|
52 Preferences.setWebBrowser("FlashCookieAutoRefresh", |
|
53 self.autoModeGroup.isChecked()) |
|
54 Preferences.setWebBrowser("FlashCookieNotify", |
|
55 self.notificationGroup.isChecked()) |
|
56 Preferences.setWebBrowser("FlashCookiesDeleteOnStartExit", |
|
57 self.deleteGroup.isChecked()) |
|
58 |
|
59 |
|
60 def create(dlg): |
|
61 """ |
|
62 Module function to create the configuration page. |
|
63 |
|
64 @param dlg reference to the configuration dialog |
|
65 @return reference to the instantiated page (ConfigurationPageBase) |
|
66 """ |
|
67 page = WebBrowserFlashCookieManagerPage() |
|
68 return page |