4.3.1r21
[enigma2.git] / usr / lib / enigma2 / python / Plugins / Extensions / Browser / plugin.py
1 from Components.config import config
2 from Plugins.Plugin import PluginDescriptor
3
4 from Browser import Browser
5 from BrowserMenu import BrowserMenu
6
7 def main_widget(session, **kwargs):
8         url = kwargs.get("url", None)
9         session.openWithCallback(main_widget_callback, Browser, config.plugins.WebBrowser.fullscreen.value, url, False)
10
11 def main_widget_callback(session = None, restart = False, url = None):
12         if restart:
13                 main_widget(session, url=url)
14
15 def menu(menuid, **kwargs):
16         if menuid == "mainmenu":
17                 return [(_("Web Browser"), main_widget, "web_browser", 30)]
18         return []
19
20 def downloads(session, **kwargs):
21         session.open(BrowserMenu, None, None, menulist = [(_("Downloads"), BrowserMenu.MENU_DOWNLOADS),])
22
23 def Plugins(**kwargs):
24         return [
25                         PluginDescriptor(name = "Browser", description = _("Browse the web"), where = PluginDescriptor.WHERE_MENU, fnc = menu),
26                         PluginDescriptor(name = "Downloads", description = _("Downloads"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc = downloads),
27                 ]