Helpviewer/AdBlock/AdBlockSubscription.py

changeset 1971
a68d78702c98
parent 1970
02cf3bac079b
child 1994
84d55b34ba5a
equal deleted inserted replaced
1970:02cf3bac079b 1971:a68d78702c98
28 """ 28 """
29 Class implementing the AdBlock subscription. 29 Class implementing the AdBlock subscription.
30 30
31 @signal changed() emitted after the subscription has changed 31 @signal changed() emitted after the subscription has changed
32 @signal rulesChanged() emitted after the subscription's rules have changed 32 @signal rulesChanged() emitted after the subscription's rules have changed
33 @signal enabledChanged(bool) emitted after the enabled state was changed
33 """ 34 """
34 changed = pyqtSignal() 35 changed = pyqtSignal()
35 rulesChanged = pyqtSignal() 36 rulesChanged = pyqtSignal()
37 enabledChanged = pyqtSignal(bool)
36 38
37 def __init__(self, url, custom, parent=None, default=False): 39 def __init__(self, url, custom, parent=None, default=False):
38 """ 40 """
39 Constructor 41 Constructor
40 42
97 self.__requiresLocation, self.__requiresTitle) 99 self.__requiresLocation, self.__requiresTitle)
98 100
99 lastUpdateByteArray = url.encodedQueryItemValue("lastUpdate") 101 lastUpdateByteArray = url.encodedQueryItemValue("lastUpdate")
100 lastUpdateString = QUrl.fromPercentEncoding(lastUpdateByteArray) 102 lastUpdateString = QUrl.fromPercentEncoding(lastUpdateByteArray)
101 self.__lastUpdate = QDateTime.fromString(lastUpdateString, Qt.ISODate) 103 self.__lastUpdate = QDateTime.fromString(lastUpdateString, Qt.ISODate)
102 ## if lastUpdateString:
103 ## self.__lastUpdate = QDateTime.fromString(lastUpdateString, Qt.ISODate)
104 ## else:
105 ## self.__lastUpdate = QDateTime.currentDateTime()
106 104
107 self.__loadRules() 105 self.__loadRules()
108 106
109 def url(self): 107 def url(self):
110 """ 108 """
146 """ 144 """
147 if self.__enabled == enabled: 145 if self.__enabled == enabled:
148 return 146 return
149 147
150 self.__enabled = enabled 148 self.__enabled = enabled
149 self.enabledChanged.emit(enabled)
151 150
152 def title(self): 151 def title(self):
153 """ 152 """
154 Public method to get the subscription title. 153 Public method to get the subscription title.
155 154

eric ide

mercurial