WebBrowser/AdBlock/AdBlockDialog.py

changeset 6028
859f6894eed9
parent 5605
1950fe1a32c4
child 6048
82ad8ec9548c
--- a/WebBrowser/AdBlock/AdBlockDialog.py	Thu Dec 14 19:25:34 2017 +0100
+++ b/WebBrowser/AdBlock/AdBlockDialog.py	Mon Dec 18 18:09:39 2017 +0100
@@ -28,8 +28,10 @@
         """
         Constructor
         
-        @param manager reference to the AdBlock manager (AdBlockManager)
-        @param parent reference to the parent object (QWidget)
+        @param manager reference to the AdBlock manager
+        @type AdBlockManager
+        @param parent reference to the parent object
+        @type QWidget
         """
         super(AdBlockDialog, self).__init__(parent)
         self.setupUi(self)
@@ -49,6 +51,7 @@
         
         self.adBlockGroup.setChecked(self.__manager.isEnabled())
         self.__manager.requiredSubscriptionLoaded.connect(self.addSubscription)
+        self.__manager.enabledChanged.connect(self.__managerEnabledChanged)
         
         self.__currentTreeWidget = None
         self.__currentSubscription = None
@@ -99,8 +102,10 @@
         Public slot adding a subscription to the list.
         
         @param subscription reference to the subscription to be
-            added (AdBlockSubscription)
-        @param refresh flag indicating to refresh the tree (boolean)
+            added
+        @type AdBlockSubscription
+        @param refresh flag indicating to refresh the tree
+        @type bool
         """
         from .AdBlockTreeWidget import AdBlockTreeWidget
         tree = AdBlockTreeWidget(subscription, self.subscriptionsTabWidget)
@@ -159,7 +164,8 @@
         """
         Public slot to add a custom AdBlock rule.
         
-        @param filterRule filter to be added (string)
+        @param filterRule filter to be added
+        @type string
         """
         self.subscriptionsTabWidget.setCurrentIndex(
             self.subscriptionsTabWidget.count() - 1)
@@ -256,8 +262,9 @@
         Private slot to set the enabled state of a subscription.
         
         @param subscription subscription to set the state for
-            (AdBlockSubscription)
-        @param enable state to set to (boolean)
+        @type AdBlockSubscription
+        @param enable state to set to
+        @type bool
         """
         if enable:
             # enable required one as well
@@ -284,7 +291,8 @@
         """
         Private slot to handle changes of the update period.
         
-        @param value update period (integer)
+        @param value update period
+        @type int
         """
         if value != Preferences.getWebBrowser("AdBlockUpdatePeriod"):
             Preferences.setWebBrowser("AdBlockUpdatePeriod", value)
@@ -299,7 +307,8 @@
         """
         Private slot handling the selection of another tab.
         
-        @param index index of the new current tab (integer)
+        @param index index of the new current tab
+        @type int
         """
         if index != -1:
             self.__currentTreeWidget = \
@@ -317,7 +326,8 @@
         """
         Private slot to set a new filter on the current widget.
         
-        @param filterRule filter to be set (string)
+        @param filterRule filter to be set
+        @type str
         """
         if self.__currentTreeWidget and self.adBlockGroup.isChecked():
             self.__currentTreeWidget.filterString(filterRule)
@@ -327,7 +337,8 @@
         """
         Private slot handling the enabling/disabling of AdBlock.
         
-        @param state state of the toggle (boolean)
+        @param state state of the toggle
+        @type bool
         """
         self.__manager.setEnabled(state)
         
@@ -344,3 +355,13 @@
         """
         self.__manager.setUseLimitedEasyList(
             self.useLimitedEasyListCheckBox.isChecked())
+    
+    @pyqtSlot(bool)
+    def __managerEnabledChanged(self, enabled):
+        """
+        Private slot handling a change of the AdBlock manager enabled state.
+        
+        @param enabled flag indicating the enabled state
+        @type bool
+        """
+        self.adBlockGroup.setChecked(enabled)

eric ide

mercurial