X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/02916ce89bca007f62951f0a130b0c2bc2e22027..aceb62aeebc259a4da520b303a31a6a174d9400a:/lib/python/Screens/ServiceInfo.py diff --git a/lib/python/Screens/ServiceInfo.py b/lib/python/Screens/ServiceInfo.py index 03d03d8e..10f7b28c 100644 --- a/lib/python/Screens/ServiceInfo.py +++ b/lib/python/Screens/ServiceInfo.py @@ -1,7 +1,40 @@ +from Components.HTMLComponent import * +from Components.GUIComponent import * from Screen import Screen from Components.ActionMap import ActionMap from Components.Label import Label from Components.MenuList import MenuList +from ServiceReference import ServiceReference +from enigma import eListboxPythonMultiContent, eListbox, gFont + +RT_HALIGN_LEFT = 0 + +def ServiceInfoListEntry(a, b): + res = [ ] + + #PyObject *px, *py, *pwidth, *pheight, *pfnt, *pstring, *pflags; + res.append((0, 0, 200, 30, 0, RT_HALIGN_LEFT, "")) + res.append((0, 0, 150, 25, 0, RT_HALIGN_LEFT, a)) + res.append((170, 0, 150, 25, 0, RT_HALIGN_LEFT, b)) + + return res + +class ServiceInfoList(HTMLComponent, GUIComponent): + def __init__(self, source): + GUIComponent.__init__(self) + self.l = eListboxPythonMultiContent() + self.list = source + self.l.setList(self.list) + self.l.setFont(0, gFont("Arial", 23)) + + def GUIcreate(self, parent): + self.instance = eListbox(parent) + self.instance.setContent(self.l) + self.instance.setItemHeight(25) + + def GUIdelete(self): + self.instance.setContent(None) + self.instance = None class ServiceInfo(Screen): def __init__(self, session): @@ -13,13 +46,26 @@ class ServiceInfo(Screen): "cancel": self.close }, -1) - Labels = ("Name", "Provider", "VideoPID", "AudioPID", - "PCRPID", "PMTPID", "TXTPID", "Videoformat", - "TSID", "ONID", "SID", "Namespace") + Labels = ( ("Name", "ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference()).getServiceName()"), + ("Provider", ), + ("VideoPID",""), + ("AudioPID",""), + ("PCRPID",""), + ("PMTPID",""), + ("TXTPID",""), + ("Videoformat",""), + ("TSID",""), + ("ONID",""), + ("SID",""), + ("Namespace","")) tlist = [ ] for item in Labels: - tlist.append((item + ":",0)) - - self["infolist"] = MenuList(tlist) + try: + value = str(eval(item[1])) + except: + value = "N/A" + tlist.append(ServiceInfoListEntry(item[0]+":", value)) + + self["infolist"] = ServiceInfoList(tlist)