minimum backward seek is 16X
[enigma2.git] / lib / python / Screens / PluginBrowser.py
1 from Screen import Screen
2
3 from Components.MenuList import MenuList
4 from Components.ActionMap import ActionMap
5 from Components.PluginComponent import plugins
6 from Components.PluginList import *
7 from Components.config import config
8 from Plugins.Plugin import PluginDescriptor
9
10 class PluginBrowser(Screen):
11         def __init__(self, session):
12                 Screen.__init__(self, session)
13                 
14                 self.list = []
15                 self["list"] = PluginList(self.list)
16                 self.updateList()
17                 
18                 self["actions"] = ActionMap(["WizardActions"], 
19                 {
20                         "ok": self.save,
21                         "back": self.close,
22                 })
23                 
24         def save(self):
25                 #self.close()
26                 self.run()
27         
28         def run(self):
29                 plugin = self["list"].l.getCurrentSelection()[0]
30                 
31                 plugin(session=self.session)
32                 
33         def updateList(self):
34                 self.list = [ ]
35                 self.pluginlist = plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU)
36                 for plugin in self.pluginlist:
37                         self.list.append(PluginEntryComponent(plugin))
38                 
39                 self["list"].l.setList(self.list)