Helpviewer/FlashCookieManager/FlashCookieManagerDialog.py

Tue, 11 Aug 2015 19:49:05 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 11 Aug 2015 19:49:05 +0200
changeset 4361
9eec3a532d59
child 4362
1a171c85b275
permissions
-rw-r--r--

Continued adding code for a Flash cookie manager.

4361
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 # Copyright (c) 2015 Detlev Offenbach <detlev@die-offenbachs.de>
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to manage the flash cookies.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 from PyQt5.QtCore import pyqtSlot, Qt, QPoint, QTimer
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem, QApplication
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_FlashCookieManagerDialog import Ui_FlashCookieManagerDialog
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 import Preferences
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import UI.PixmapCache
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 class FlashCookieManagerDialog(QDialog, Ui_FlashCookieManagerDialog):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 Class implementing a dialog to manage the flash cookies.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 def __init__(self, manager, parent=None):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 Constructor
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 @param manager reference to the Flash cookie manager object
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @type FlashCookieManager
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @param parent reference to the parent widget
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @type QWidget
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 super(FlashCookieManagerDialog, self).__init__(parent)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.setupUi(self)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.setWindowFlags(Qt.Window)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.cookiesList.setContextMenuPolicy(Qt.CustomContextMenu)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.cookiesList.customContextMenuRequested.connect(
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.__cookiesListContextMenuRequested)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.__manager = manager
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 def on_whiteList_itemSelectionChanged(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 def on_blackList_itemSelectionChanged(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 def on_removeWhiteButton_clicked(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 def on_addWhiteButton_clicked(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 def on_removeBlackButton_clicked(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 def on_addBlackButton_clicked(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 @pyqtSlot(str)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 def on_filterEdit_textChanged(self, p0):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 def on_cookiesList_currentItemChanged(self, current, previous):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 def on_cookiesList_itemSelectionChanged(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 @pyqtSlot(QPoint)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 def __cookiesListContextMenuRequested(self, point):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 def on_reloadButton_clicked(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 def on_removeAllButton_clicked(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 def on_removeButton_clicked(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 Slot documentation goes here.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 # TODO: not implemented yet
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 raise NotImplementedError
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 def refreshView(self, forceReload=False):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 Public method to refresh the dialog view.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 @param forceReload flag indicating to reload the cookies
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 @type bool
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 blocked = self.filterEdit.blockSignals(True)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 self.filterEdit.clear()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 self.contentsEdit.clear()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 self.filterEdit.blockSignals(blocked)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 if forceReload:
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 self.__manager.clearCache()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 self.__manager.clearNewOrigins()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 QTimer.singleShot(0, self.__refreshCookiesList)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 QTimer.singleShot(0, self.__refreshFilterLists)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 def showPage(self, index):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 Public method to display a given page.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 @param index index of the page to be shown
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 @type int
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 self.cookiesTabWidget.setCurrentIndex(index)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 def __refreshCookiesList(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 Private slot to refresh the cookies list.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 QApplication.setOverrideCursor(Qt.WaitCursor)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 cookies = self.__manager.flashCookies()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 self.cookiesList.clear()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 counter = 0
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 originDict = {}
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 for cookie in cookies:
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 cookieOrigin = cookie.origin
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 if cookieOrigin.startswith("."):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 cookieOrigin = cookieOrigin[1:]
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 if cookieOrigin in originDict:
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 itm = QTreeWidgetItem(originDict[cookieOrigin])
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 else:
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 newParent = QTreeWidgetItem(self.cookiesList)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 newParent.setText(0, cookieOrigin)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 newParent.setIcon(UI.PixmapCache.getIcon("dirOpen.png"))
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 self.cookiesList.addTopLevelItem(newParent)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 originDict[cookieOrigin] = newParent
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 itm = QTreeWidgetItem(newParent)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 suffix = ""
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 if cookie.path.startswith(
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 self.__manager.flashPlayerDataPath() +
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 "/macromedia.com/support/flashplayer/sys"):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 suffix = self.tr(" (settings)")
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 if cookie.path + "/" + cookie.name in \
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 self.__manager.newCookiesList():
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 suffix += self.tr(" [new]")
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 font = itm.font(0)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 font.setBold(True)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 itm.setFont(font)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 itm.parent().setExpanded(True)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 itm.setText(0, cookie.name + suffix)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 itm.setData(0, Qt.UserRole, cookie)
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 counter += 1
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 if counter > 100:
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 QApplication.processEvents()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 counter = 0
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 QApplication.restoreOverrideCursor()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 @pyqtSlot()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 def __refreshFilterLists(self):
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 Private slot to refresh the white and black lists.
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 """
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 self.whiteList.clear()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 self.blackList.clear()
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 self.whiteList.addItems(Preferences.getHelp("FlashCookiesWhitelist"))
9eec3a532d59 Continued adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 self.blackList.addItems(Preferences.getHelp("FlashCookiesBlacklist"))

eric ide

mercurial