generic show/hide support for GUIComponents
[enigma2.git] / lib / python / Components / ServiceName.py
index c96b79f4e246d436521e7911fda0f80b20780ee3..c3cd8f03e1113ab64b63f99ea58b59cfd19b9a49 100644 (file)
@@ -1,22 +1,25 @@
 from PerServiceDisplay import *
 
-from enigma import pNavigation, iServiceInformationPtr
+#from enigma import iPlayableService, iServiceInformationPtr
+from enigma import *
 
 class ServiceName(PerServiceDisplay):
        def __init__(self, navcore):
                PerServiceDisplay.__init__(self, navcore,
                        {
-                               pNavigation.evNewService: self.newService,
-                               pNavigation.evStopService: self.stopEvent
+                               iPlayableService.evStart: self.newService,
+                               iPlayableService.evEnd: self.stopEvent
                        })
 
        def newService(self):
-               info = iServiceInformationPtr()
                service = self.navcore.getCurrentService()
                
-               if service != None:
-                       if not service.info(info):
-                               self.setText(info.getName())
+               if service is not None:
+                       info = service.info()
+                       if info is not None:
+                               name = info.getName()
+                               self.setText(name)
+                               setLCD(name)
        
        def stopEvent(self):
                        self.setText("");