blob: 6d3ce66a05f5d743bdb85c5f5089991cc6bdad9e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
from Screen import Screen
from Components.MenuList import MenuList
from Components.ActionMap import ActionMap
from Components.PluginComponent import plugins
from Components.PluginList import *
from Components.config import config
class PluginBrowser(Screen):
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
self["list"] = PluginList(self.list)
self.updateList()
self["actions"] = ActionMap(["WizardActions"],
{
"ok": self.save,
"back": self.close,
"up": self.up,
"down": self.down
}, -1)
def save(self):
#self.close()
self.run()
def run(self):
plugin = self.pluginlist[self["list"].l.getCurrentSelectionIndex()]
plugins.runPlugin(plugin, self.session)
def updateList(self):
self.list = []
self.pluginlist = plugins.getPluginList()
for x in self.pluginlist:
self.list.append(PluginEntryComponent(x[0], x[1], x[6]))
self["list"].l.setList(self.list)
def up(self):
self["list"].instance.moveSelection(self["list"].instance.moveUp)
def down(self):
self["list"].instance.moveSelection(self["list"].instance.moveDown)
|