7 Module implementing the Flash Cookies Manager configuration page. |
7 Module implementing the Flash Cookies Manager configuration page. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt5.QtCore import pyqtSlot |
12 from E5Gui.E5PathPicker import E5PathPickerModes |
13 |
|
14 from E5Gui.E5Completers import E5DirCompleter |
|
15 from E5Gui import E5FileDialog |
|
16 |
13 |
17 from .ConfigurationPageBase import ConfigurationPageBase |
14 from .ConfigurationPageBase import ConfigurationPageBase |
18 from .Ui_HelpFlashCookieManagerPage import Ui_HelpFlashCookieManagerPage |
15 from .Ui_HelpFlashCookieManagerPage import Ui_HelpFlashCookieManagerPage |
19 |
16 |
20 import Preferences |
17 import Preferences |
21 import Utilities |
|
22 import UI.PixmapCache |
|
23 |
18 |
24 |
19 |
25 class HelpFlashCookieManagerPage(ConfigurationPageBase, |
20 class HelpFlashCookieManagerPage(ConfigurationPageBase, |
26 Ui_HelpFlashCookieManagerPage): |
21 Ui_HelpFlashCookieManagerPage): |
27 """ |
22 """ |
33 """ |
28 """ |
34 super(HelpFlashCookieManagerPage, self).__init__() |
29 super(HelpFlashCookieManagerPage, self).__init__() |
35 self.setupUi(self) |
30 self.setupUi(self) |
36 self.setObjectName("HelpFlashCookieManagerPage") |
31 self.setObjectName("HelpFlashCookieManagerPage") |
37 |
32 |
38 self.flashDataPathButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
33 self.flashDataPathPicker.setMode(E5PathPickerModes.DiretoryMode) |
39 |
|
40 self.flashDataPathCompleter = E5DirCompleter(self.flashDataPathEdit) |
|
41 |
34 |
42 # set initial values |
35 # set initial values |
43 self.flashDataPathEdit.setText( |
36 self.flashDataPathPicker.setText( |
44 Preferences.getHelp("FlashCookiesDataPath")) |
37 Preferences.getHelp("FlashCookiesDataPath")) |
45 self.autoModeGroup.setChecked( |
38 self.autoModeGroup.setChecked( |
46 Preferences.getHelp("FlashCookieAutoRefresh")) |
39 Preferences.getHelp("FlashCookieAutoRefresh")) |
47 self.notificationGroup.setChecked( |
40 self.notificationGroup.setChecked( |
48 Preferences.getHelp("FlashCookieNotify")) |
41 Preferences.getHelp("FlashCookieNotify")) |
52 def save(self): |
45 def save(self): |
53 """ |
46 """ |
54 Public slot to save the Flash Cookies Manager configuration. |
47 Public slot to save the Flash Cookies Manager configuration. |
55 """ |
48 """ |
56 Preferences.setHelp("FlashCookiesDataPath", |
49 Preferences.setHelp("FlashCookiesDataPath", |
57 self.flashDataPathEdit.text()) |
50 self.flashDataPathPicker.text()) |
58 Preferences.setHelp("FlashCookieAutoRefresh", |
51 Preferences.setHelp("FlashCookieAutoRefresh", |
59 self.autoModeGroup.isChecked()) |
52 self.autoModeGroup.isChecked()) |
60 Preferences.setHelp("FlashCookieNotify", |
53 Preferences.setHelp("FlashCookieNotify", |
61 self.notificationGroup.isChecked()) |
54 self.notificationGroup.isChecked()) |
62 Preferences.setHelp("FlashCookiesDeleteOnStartExit", |
55 Preferences.setHelp("FlashCookiesDeleteOnStartExit", |
63 self.deleteGroup.isChecked()) |
56 self.deleteGroup.isChecked()) |
64 |
|
65 @pyqtSlot() |
|
66 def on_flashDataPathButton_clicked(self): |
|
67 """ |
|
68 Private slot to handle the flash data path selection. |
|
69 """ |
|
70 path = E5FileDialog.getExistingDirectory( |
|
71 self, |
|
72 self.tr("Select Flash Cookies Data Path"), |
|
73 self.flashDataPathEdit.text(), |
|
74 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
|
75 |
|
76 if path: |
|
77 self.flashDataPathEdit.setText(Utilities.toNativeSeparators(path)) |
|
78 |
57 |
79 |
58 |
80 def create(dlg): |
59 def create(dlg): |
81 """ |
60 """ |
82 Module function to create the configuration page. |
61 Module function to create the configuration page. |