1 from HTMLComponent import *
2 from GUIComponent import *
4 from enigma import eListboxPythonMultiContent, eListbox, gFont
6 from enigma import eServiceReference, eServiceCenter, \
7 eServiceCenterPtr, iListableServicePtr, \
8 iStaticServiceInformationPtr
25 def MovieListEntry(serviceref, serviceHandler):
28 info = serviceHandler.info(serviceref)
31 # ignore service which refuse to info
34 len = info.getLength(serviceref)
36 len = "%d:%02d" % (len / 60, len % 60)
40 res.append((0, 0, 400, 30, 0, RT_HALIGN_LEFT, info.getName(serviceref)))
41 res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, "Toller Film"))
42 res.append((0, 50, 200, 20, 1, RT_HALIGN_LEFT, "Aufgenommen: irgendwann"))
43 res.append((200, 50, 200, 20, 1, RT_HALIGN_RIGHT, len))
47 class MovieList(HTMLComponent, GUIComponent):
48 def __init__(self, root):
49 GUIComponent.__init__(self)
50 self.l = eListboxPythonMultiContent()
52 self.l.setList(self.list)
53 self.l.setFont(0, gFont("Arial", 30))
54 self.l.setFont(1, gFont("Arial", 18))
57 return self.l.getCurrentSelection()
59 def GUIcreate(self, parent):
60 self.instance = eListbox(parent)
61 self.instance.setContent(self.l)
62 self.instance.setItemHeight(75)
65 self.instance.setContent(None)
69 # this lists our root service, then building a
74 serviceHandler = eServiceCenter.getInstance()
75 list = serviceHandler.list(root)
78 raise "listing of movies failed"
90 self.list.append(MovieListEntry(ref, serviceHandler))