153 self.__updateAllSubscriptions) |
153 self.__updateAllSubscriptions) |
154 menu.addSeparator() |
154 menu.addSeparator() |
155 menu.addAction(self.tr("Learn more about writing rules..."), |
155 menu.addAction(self.tr("Learn more about writing rules..."), |
156 self.__learnAboutWritingFilters) |
156 self.__learnAboutWritingFilters) |
157 |
157 |
158 def addCustomRule(self, filter): |
158 def addCustomRule(self, filterRule): |
159 """ |
159 """ |
160 Public slot to add a custom AdBlock rule. |
160 Public slot to add a custom AdBlock rule. |
161 |
161 |
162 @param filter filter to be added (string) |
162 @param filterRule filter to be added (string) |
163 """ |
163 """ |
164 self.subscriptionsTabWidget.setCurrentIndex( |
164 self.subscriptionsTabWidget.setCurrentIndex( |
165 self.subscriptionsTabWidget.count() - 1) |
165 self.subscriptionsTabWidget.count() - 1) |
166 self.__currentTreeWidget.addRule(filter) |
166 self.__currentTreeWidget.addRule(filterRule) |
167 |
167 |
168 def __addCustomRule(self): |
168 def __addCustomRule(self): |
169 """ |
169 """ |
170 Private slot to add a custom AdBlock rule. |
170 Private slot to add a custom AdBlock rule. |
171 """ |
171 """ |
311 self.__currentSubscription.url().toString().startswith( |
311 self.__currentSubscription.url().toString().startswith( |
312 self.__manager.getDefaultSubscriptionUrl()) |
312 self.__manager.getDefaultSubscriptionUrl()) |
313 self.useLimitedEasyListCheckBox.setVisible(isEasyList) |
313 self.useLimitedEasyListCheckBox.setVisible(isEasyList) |
314 |
314 |
315 @pyqtSlot(str) |
315 @pyqtSlot(str) |
316 def on_searchEdit_textChanged(self, filter): |
316 def on_searchEdit_textChanged(self, filterRule): |
317 """ |
317 """ |
318 Private slot to set a new filter on the current widget. |
318 Private slot to set a new filter on the current widget. |
319 |
319 |
320 @param filter filter to be set (string) |
320 @param filterRule filter to be set (string) |
321 """ |
321 """ |
322 if self.__currentTreeWidget and self.adBlockGroup.isChecked(): |
322 if self.__currentTreeWidget and self.adBlockGroup.isChecked(): |
323 self.__currentTreeWidget.filterString(filter) |
323 self.__currentTreeWidget.filterString(filterRule) |
324 |
324 |
325 @pyqtSlot(bool) |
325 @pyqtSlot(bool) |
326 def on_adBlockGroup_toggled(self, state): |
326 def on_adBlockGroup_toggled(self, state): |
327 """ |
327 """ |
328 Private slot handling the enabling/disabling of AdBlock. |
328 Private slot handling the enabling/disabling of AdBlock. |