148 self.__updateAllSubscriptions) |
148 self.__updateAllSubscriptions) |
149 menu.addSeparator() |
149 menu.addSeparator() |
150 menu.addAction(self.tr("Learn more about writing rules..."), |
150 menu.addAction(self.tr("Learn more about writing rules..."), |
151 self.__learnAboutWritingFilters) |
151 self.__learnAboutWritingFilters) |
152 |
152 |
153 def addCustomRule(self, filter): |
153 def addCustomRule(self, filterRule): |
154 """ |
154 """ |
155 Public slot to add a custom AdBlock rule. |
155 Public slot to add a custom AdBlock rule. |
156 |
156 |
157 @param filter filter to be added (string) |
157 @param filterRule filter to be added (string) |
158 """ |
158 """ |
159 self.subscriptionsTabWidget.setCurrentIndex( |
159 self.subscriptionsTabWidget.setCurrentIndex( |
160 self.subscriptionsTabWidget.count() - 1) |
160 self.subscriptionsTabWidget.count() - 1) |
161 self.__currentTreeWidget.addRule(filter) |
161 self.__currentTreeWidget.addRule(filterRule) |
162 |
162 |
163 def __addCustomRule(self): |
163 def __addCustomRule(self): |
164 """ |
164 """ |
165 Private slot to add a custom AdBlock rule. |
165 Private slot to add a custom AdBlock rule. |
166 """ |
166 """ |
301 self.subscriptionsTabWidget.widget(index) |
301 self.subscriptionsTabWidget.widget(index) |
302 self.__currentSubscription = \ |
302 self.__currentSubscription = \ |
303 self.__currentTreeWidget.subscription() |
303 self.__currentTreeWidget.subscription() |
304 |
304 |
305 @pyqtSlot(str) |
305 @pyqtSlot(str) |
306 def on_searchEdit_textChanged(self, filter): |
306 def on_searchEdit_textChanged(self, filterRule): |
307 """ |
307 """ |
308 Private slot to set a new filter on the current widget. |
308 Private slot to set a new filter on the current widget. |
309 |
309 |
310 @param filter filter to be set (string) |
310 @param filterRule filter to be set (string) |
311 """ |
311 """ |
312 if self.__currentTreeWidget and self.adBlockGroup.isChecked(): |
312 if self.__currentTreeWidget and self.adBlockGroup.isChecked(): |
313 self.__currentTreeWidget.filterString(filter) |
313 self.__currentTreeWidget.filterString(filterRule) |
314 |
314 |
315 @pyqtSlot(bool) |
315 @pyqtSlot(bool) |
316 def on_adBlockGroup_toggled(self, state): |
316 def on_adBlockGroup_toggled(self, state): |
317 """ |
317 """ |
318 Private slot handling the enabling/disabling of AdBlock. |
318 Private slot handling the enabling/disabling of AdBlock. |