use MultiContent wraps in plugin list
[enigma2.git] / lib / python / Components / PluginList.py
1 from HTMLComponent import *
2 from GUIComponent import *
3
4 from MenuList import MenuList
5
6 from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
7 from Components.MultiContent import RT_HALIGN_LEFT, MultiContentEntryText, MultiContentEntryPixmap
8
9 from enigma import *
10
11 def PluginEntryComponent(plugin):
12         res = [ plugin ]
13         
14         res.append(MultiContentEntryText(pos=(80, 5), size=(300, 25), font=0, text=plugin.name))
15         res.append(MultiContentEntryText(pos=(80, 26), size=(300, 17), font=1, text=plugin.description))
16
17         if plugin.icon is None:
18                 png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "/plugin.png"))
19         else:
20                 png = plugin.icon
21         res.append(MultiContentEntryPixmap(pos=(10, 5), size=(60, 40), png = png))
22         
23         return res
24
25 class PluginList(HTMLComponent, GUIComponent, MenuList):
26         def __init__(self, list):
27                 GUIComponent.__init__(self)
28                 self.l = eListboxPythonMultiContent()
29                 self.list = list
30                 self.l.setList(list)
31                 self.l.setFont(0, gFont("Regular", 20))
32                 self.l.setFont(1, gFont("Regular", 14))
33         
34         def GUIcreate(self, parent):
35                 self.instance = eListbox(parent)
36                 self.instance.setContent(self.l)
37                 self.instance.setItemHeight(50)