eric6/WebBrowser/AdBlock/AdBlockDialog.py

changeset 7533
88261c96484b
parent 7360
9190402e4505
child 7781
607a6098cb44
equal deleted inserted replaced
7532:1358e9d67a1c 7533:88261c96484b
36 self.setupUi(self) 36 self.setupUi(self)
37 self.setWindowFlags(Qt.Window) 37 self.setWindowFlags(Qt.Window)
38 38
39 self.__manager = manager 39 self.__manager = manager
40 40
41 self.iconLabel.setPixmap(UI.PixmapCache.getPixmap("adBlockPlus48.png")) 41 self.iconLabel.setPixmap(UI.PixmapCache.getPixmap("adBlockPlus48"))
42 42
43 self.updateSpinBox.setValue( 43 self.updateSpinBox.setValue(
44 Preferences.getWebBrowser("AdBlockUpdatePeriod")) 44 Preferences.getWebBrowser("AdBlockUpdatePeriod"))
45 45
46 self.useLimitedEasyListCheckBox.setChecked(Preferences.getWebBrowser( 46 self.useLimitedEasyListCheckBox.setChecked(Preferences.getWebBrowser(
57 self.__loaded = False 57 self.__loaded = False
58 58
59 menu = QMenu(self) 59 menu = QMenu(self)
60 menu.aboutToShow.connect(self.__aboutToShowActionMenu) 60 menu.aboutToShow.connect(self.__aboutToShowActionMenu)
61 self.actionButton.setMenu(menu) 61 self.actionButton.setMenu(menu)
62 self.actionButton.setIcon(UI.PixmapCache.getIcon("adBlockAction.png")) 62 self.actionButton.setIcon(UI.PixmapCache.getIcon("adBlockAction"))
63 self.actionButton.setPopupMode(QToolButton.InstantPopup) 63 self.actionButton.setPopupMode(QToolButton.InstantPopup)
64 64
65 self.__load() 65 self.__load()
66 66
67 self.buttonBox.setFocus() 67 self.buttonBox.setFocus()
83 83
84 from .AdBlockTreeWidget import AdBlockTreeWidget 84 from .AdBlockTreeWidget import AdBlockTreeWidget
85 for subscription in self.__manager.subscriptions(): 85 for subscription in self.__manager.subscriptions():
86 tree = AdBlockTreeWidget(subscription, self.subscriptionsTabWidget) 86 tree = AdBlockTreeWidget(subscription, self.subscriptionsTabWidget)
87 if subscription.isEnabled(): 87 if subscription.isEnabled():
88 icon = UI.PixmapCache.getIcon("adBlockPlus.png") 88 icon = UI.PixmapCache.getIcon("adBlockPlus")
89 else: 89 else:
90 icon = UI.PixmapCache.getIcon("adBlockPlusDisabled.png") 90 icon = UI.PixmapCache.getIcon("adBlockPlusDisabled")
91 self.subscriptionsTabWidget.addTab( 91 self.subscriptionsTabWidget.addTab(
92 tree, icon, subscription.title()) 92 tree, icon, subscription.title())
93 93
94 self.__loaded = True 94 self.__loaded = True
95 QCoreApplication.processEvents() 95 QCoreApplication.processEvents()
276 """ 276 """
277 if enable: 277 if enable:
278 # enable required one as well 278 # enable required one as well
279 sub = self.__manager.subscription(subscription.requiresLocation()) 279 sub = self.__manager.subscription(subscription.requiresLocation())
280 requiresSubscriptions = [] if sub is None else [sub] 280 requiresSubscriptions = [] if sub is None else [sub]
281 icon = UI.PixmapCache.getIcon("adBlockPlus.png") 281 icon = UI.PixmapCache.getIcon("adBlockPlus")
282 else: 282 else:
283 # disable dependent ones as well 283 # disable dependent ones as well
284 requiresSubscriptions = ( 284 requiresSubscriptions = (
285 self.__manager.getRequiresSubscriptions(subscription) 285 self.__manager.getRequiresSubscriptions(subscription)
286 ) 286 )
287 icon = UI.PixmapCache.getIcon("adBlockPlusDisabled.png") 287 icon = UI.PixmapCache.getIcon("adBlockPlusDisabled")
288 requiresSubscriptions.append(subscription) 288 requiresSubscriptions.append(subscription)
289 for sub in requiresSubscriptions: 289 for sub in requiresSubscriptions:
290 sub.setEnabled(enable) 290 sub.setEnabled(enable)
291 291
292 for index in range(self.subscriptionsTabWidget.count()): 292 for index in range(self.subscriptionsTabWidget.count()):

eric ide

mercurial