eric6/WebBrowser/AdBlock/AdBlockDialog.py

changeset 8260
2161475d9639
parent 8218
7c09585bd960
equal deleted inserted replaced
8259:2bbec88047dd 8260:2161475d9639
82 return 82 return
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 icon = (
88 icon = UI.PixmapCache.getIcon("adBlockPlus") 88 UI.PixmapCache.getIcon("adBlockPlus")
89 else: 89 if subscription.isEnabled() else
90 icon = UI.PixmapCache.getIcon("adBlockPlusDisabled") 90 UI.PixmapCache.getIcon("adBlockPlusDisabled")
91 )
91 self.subscriptionsTabWidget.addTab( 92 self.subscriptionsTabWidget.addTab(
92 tree, icon, subscription.title()) 93 tree, icon, subscription.title())
93 94
94 self.__loaded = True 95 self.__loaded = True
95 QCoreApplication.processEvents() 96 QCoreApplication.processEvents()
228 requiresSubscriptions = ( 229 requiresSubscriptions = (
229 self.__manager.getRequiresSubscriptions(self.__currentSubscription) 230 self.__manager.getRequiresSubscriptions(self.__currentSubscription)
230 ) 231 )
231 for subscription in requiresSubscriptions: 232 for subscription in requiresSubscriptions:
232 requiresTitles.append(subscription.title()) 233 requiresTitles.append(subscription.title())
233 if requiresTitles: 234 message = (
234 message = self.tr( 235 self.tr(
235 "<p>Do you really want to remove subscription" 236 "<p>Do you really want to remove subscription"
236 " <b>{0}</b> and all subscriptions requiring it?</p>" 237 " <b>{0}</b> and all subscriptions requiring it?</p>"
237 "<ul><li>{1}</li></ul>").format( 238 "<ul><li>{1}</li></ul>").format(
238 self.__currentSubscription.title(), 239 self.__currentSubscription.title(),
239 "</li><li>".join(requiresTitles)) 240 "</li><li>".join(requiresTitles))
240 else: 241 if requiresTitles else
241 message = self.tr( 242 self.tr(
242 "<p>Do you really want to remove subscription" 243 "<p>Do you really want to remove subscription"
243 " <b>{0}</b>?</p>").format(self.__currentSubscription.title()) 244 " <b>{0}</b>?</p>").format(self.__currentSubscription.title())
245 )
244 res = E5MessageBox.yesNo( 246 res = E5MessageBox.yesNo(
245 self, 247 self,
246 self.tr("Remove Subscription"), 248 self.tr("Remove Subscription"),
247 message) 249 message)
248 250

eric ide

mercurial