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