toolkit: add NotifiablePluginBrowser
[enigma2-plugins.git] / toolkit / src / NotifiablePluginBrowser.py
1 from Screens import PluginBrowser
2 from Screens.InfoBarGenerics import InfoBarNotifications
3
4 OriginalPluginBrowser = PluginBrowser.PluginBrowser
5 if not issubclass(OriginalPluginBrowser, InfoBarNotifications):
6         class NotifiablePluginBrowser(OriginalPluginBrowser, InfoBarNotifications):
7                 def __init__(self, *args, **kwargs):
8                         OriginalPluginBrowser.__init__(self, *args, **kwargs)
9                         InfoBarNotifications.__init__(self)
10         PluginBrowser.PluginBrowser = NotifiablePluginBrowser
11 else:
12         NotifiablePluginBrowser = OriginalPluginBrowser
13
14 def uninstall():
15         PluginBrowser.PluginBrowser = OriginalPluginBrowser
16
17 __all__ = ['OriginalPluginBrowser', 'NotifiablePluginBrowser', 'uninstall']