Sat, 04 Aug 2012 13:46:18 +0200
Fixed an issue remembering the enabled state of AdBlock subscriptions.
--- a/Documentation/Source/eric5.Helpviewer.AdBlock.AdBlockSubscription.html Sat Aug 04 13:30:04 2012 +0200 +++ b/Documentation/Source/eric5.Helpviewer.AdBlock.AdBlockSubscription.html Sat Aug 04 13:46:18 2012 +0200 @@ -49,6 +49,9 @@ <dt>changed()</dt> <dd> emitted after the subscription has changed +</dd><dt>enabledChanged(bool)</dt> +<dd> +emitted after the enabled state was changed </dd><dt>rulesChanged()</dt> <dd> emitted after the subscription's rules have changed
--- a/Helpviewer/AdBlock/AdBlockManager.py Sat Aug 04 13:30:04 2012 +0200 +++ b/Helpviewer/AdBlock/AdBlockManager.py Sat Aug 04 13:46:18 2012 +0200 @@ -223,6 +223,7 @@ subscription.rulesChanged.connect(self.rulesChanged) subscription.changed.connect(self.rulesChanged) + subscription.enabledChanged.connect(self.rulesChanged) self.rulesChanged.emit() @@ -284,7 +285,8 @@ else: subscriptions.append(self.__customSubscriptionUrlString) else: - subscriptions = [self.__defaultSubscriptionUrlString, self.__customSubscriptionUrlString] + subscriptions = [self.__defaultSubscriptionUrlString, + self.__customSubscriptionUrlString] for subscription in subscriptions: url = QUrl.fromEncoded(subscription.encode()) adBlockSubscription = AdBlockSubscription(url, @@ -293,6 +295,7 @@ subscription.startswith(self.__defaultSubscriptionUrlString)) adBlockSubscription.rulesChanged.connect(self.rulesChanged) adBlockSubscription.changed.connect(self.rulesChanged) + adBlockSubscription.enabledChanged.connect(self.rulesChanged) self.__subscriptions.append(adBlockSubscription) self.__subscriptionsLoaded = True
--- a/Helpviewer/AdBlock/AdBlockSubscription.py Sat Aug 04 13:30:04 2012 +0200 +++ b/Helpviewer/AdBlock/AdBlockSubscription.py Sat Aug 04 13:46:18 2012 +0200 @@ -30,9 +30,11 @@ @signal changed() emitted after the subscription has changed @signal rulesChanged() emitted after the subscription's rules have changed + @signal enabledChanged(bool) emitted after the enabled state was changed """ changed = pyqtSignal() rulesChanged = pyqtSignal() + enabledChanged = pyqtSignal(bool) def __init__(self, url, custom, parent=None, default=False): """ @@ -99,10 +101,6 @@ lastUpdateByteArray = url.encodedQueryItemValue("lastUpdate") lastUpdateString = QUrl.fromPercentEncoding(lastUpdateByteArray) self.__lastUpdate = QDateTime.fromString(lastUpdateString, Qt.ISODate) -## if lastUpdateString: -## self.__lastUpdate = QDateTime.fromString(lastUpdateString, Qt.ISODate) -## else: -## self.__lastUpdate = QDateTime.currentDateTime() self.__loadRules() @@ -148,6 +146,7 @@ return self.__enabled = enabled + self.enabledChanged.emit(enabled) def title(self): """