add invalidate to eListboxPythonStringContent
[enigma2.git] / lib / python / Screens / InfoBar.py
index 28bb39df8f0b7b75b2faacaf9b6472512432b452..c10dad2d6a8573ec47916b02c344ffd7e1884837 100644 (file)
@@ -33,6 +33,11 @@ class InfoBar(Screen):
                self.volumeBar = VolumeBar()            
                
                self.state = self.STATE_HIDDEN
+               
+               self.hideTimer = eTimer()
+               self.hideTimer.timeout.get().append(self.doTimerHide)
+               #self.hideTimer.start(1000)
+
 
                self["actions"] = ActionMap( [ "InfobarActions" ], 
                        {
@@ -87,13 +92,23 @@ class InfoBar(Screen):
        def hide(self): 
                self.instance.hide()
 
+       def doTimerHide(self):
+               if self.state == self.STATE_SHOWN:
+                       self.instance.hide()
+                       self.state = self.STATE_HIDDEN
+
        def toggleShow(self):
                if self.state == self.STATE_SHOWN:
-#                      self.instance.hide()
-                       self.startHide()
+                       self.instance.hide()
+                       #pls check animation support, sorry
+#                      self.startHide()
+                       self.state = self.STATE_HIDDEN
                else:
-#                      self.instance.show()
-                       self.startShow()
+                       self.instance.show()
+#                      self.startShow()
+                       self.state = self.STATE_SHOWN
+                       #TODO: make it customizable
+                       self.hideTimer.start(5000)
 
        def     zapUp(self):
                self.servicelist.moveUp()
@@ -140,16 +155,16 @@ class InfoBar(Screen):
                        
                        # try to get event info
                        epg = None
-                       service = self.session.nav.getCurrentService()
-                       if service != None:
-                               info = iServiceInformationPtr()
-                               if not service.info(info):
-                                       ev = eServiceEventPtr()
-                                       if info.getEvent(ev, 0) == 0:
-                                               epg = ev
+                       try:
+                               service = self.session.nav.getCurrentService()
+                               info = service.info()
+                               ev = info.getEvent(0)
+                               epg = ev
+                       except:
+                               pass
+                       
                        # fix me, description. 
                        self.recording = self.session.nav.recordWithTimer(time.time(), time.time() + 30, serviceref, epg, "instant record")
        
        def showMovies(self):
                self.session.open(MovieSelection)
-