display serviername in ServiceInfo
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sat, 12 Nov 2005 22:59:26 +0000 (22:59 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sat, 12 Nov 2005 22:59:26 +0000 (22:59 +0000)
lib/python/Screens/ServiceInfo.py

index 03d03d8..f57c1cd 100644 (file)
@@ -2,6 +2,7 @@ from Screen import Screen
 from Components.ActionMap import ActionMap
 from Components.Label import Label
 from Components.MenuList import MenuList
+from ServiceReference import ServiceReference
 
 class ServiceInfo(Screen):
        def __init__(self, session):
@@ -13,13 +14,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))
+                       try:
+                               value = str(eval(item[1]))
+                       except:
+                               value = "N/A"
+                       tlist.append((item[0] + ": " + value,0))
                
                self["infolist"] = MenuList(tlist)