increase keypress time for skip window a bit, add hack for EOF when seeking
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index 0cc610a1a5a164f22cccfbfe6839261f92263400..57c56725d92f0f40ea06968be39bb75d0d3b7057 100644 (file)
@@ -278,8 +278,16 @@ class InfoBarChannelSelection:
                                "switchChannelDown": self.switchChannelDown,
                                "zapUp": (self.zapUp, _("next channel")),
                                "zapDown": (self.zapDown, _("previous channel")),
+                               "historyBack": (self.historyBack, _("previous channel in history")),
+                               "historyNext": (self.historyNext, _("next channel in history"))
                        })
 
+       def historyBack(self):
+               self.servicelist.historyBack()
+
+       def historyNext(self):
+               self.servicelist.historyNext()
+
        def switchChannelUp(self):
                self.servicelist.moveUp()
                self.session.execDialog(self.servicelist)
@@ -336,7 +344,7 @@ class InfoBarEPG:
                        self.servicelist.setCurrentSelection(service) #select the service in servicelist
                        self.servicelist.zap()
 
-       def openBouquetEPG(self, bouquet):
+       def openBouquetEPG(self, bouquet, withCallback=True):
                ptr=eEPGCache.getInstance()
                services = [ ]
                servicelist = eServiceCenter.getInstance().list(bouquet)
@@ -350,22 +358,28 @@ class InfoBarEPG:
                                services.append(ServiceReference(service))
                if len(services):
                        self.epg_bouquet = bouquet
-                       self.session.openWithCallback(self.closed, EPGSelection, services, self.zapToService)
+                       if withCallback:
+                               self.session.openWithCallback(self.closed, EPGSelection, services, self.zapToService)
+                       else:
+                               self.session.open(EPGSelection, services, self.zapToService)
 
        def closed(self, ret):
                if ret:
                        self.close(ret)
 
-       def openMultiServiceEPG(self):
+       def openMultiServiceEPG(self, withCallback=True):
                bouquets = self.servicelist.getBouquetList()
                if bouquets is None:
                        cnt = 0
                else:
                        cnt = len(bouquets)
                if cnt > 1: # show bouquet list
-                       self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG)
+                       if withCallback:
+                               self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG)
+                       else:
+                               self.session.open(BouquetSelector, bouquets, self.openBouquetEPG)
                elif cnt == 1: 
-                       self.openBouquetEPG(bouquets[0][1])
+                       self.openBouquetEPG(bouquets[0][1], withCallback)
 
        def openSingleServiceEPG(self):
                ref=self.session.nav.getCurrentlyPlayingServiceReference()
@@ -395,7 +409,7 @@ class InfoBarEPG:
                        self.session.open(EventViewEPGSelect, self.epglist[0], ServiceReference(ref), self.eventViewCallback, self.openSingleServiceEPG, self.openMultiServiceEPG)
                else:
                        print "no epg for the service avail.. so we show multiepg instead of eventinfo"
-                       self.openMultiServiceEPG()
+                       self.openMultiServiceEPG(False)
 
        def eventViewCallback(self, setEvent, setService, val): #used for now/next displaying
                if len(self.epglist) > 1:
@@ -625,12 +639,12 @@ class InfoBarSeek:
        def seekFwd(self):
                print "start fwd timer"
                self.fwdtimer = True
-               self.fwdKeyTimer.start(500)
+               self.fwdKeyTimer.start(1000)
 
        def seekBack(self):
                print "start rewind timer"
                self.rwdtimer = True
-               self.rwdKeyTimer.start(500)
+               self.rwdKeyTimer.start(1000)
 
        def seekFwdUp(self):
                print "seekFwdUp"
@@ -716,7 +730,13 @@ class InfoBarSeek:
                        self.lockedBecauseOfSkipping = True
 
        def __evEOF(self):
-               self.setSeekState(self.SEEK_STATE_PAUSE)
+               if self.seekstate != self.SEEK_STATE_PLAY:
+                       self.setSeekState(self.SEEK_STATE_PAUSE)
+                       # HACK
+                       self.getSeek().seekRelative(1, -90000)
+                       self.setSeekState(self.SEEK_STATE_PLAY)
+               else:
+                       self.setSeekState(self.SEEK_STATE_PAUSE)
        
        def __evSOF(self):
                self.setSeekState(self.SEEK_STATE_PLAY)
@@ -1024,19 +1044,27 @@ class InfoBarAdditionalInfo:
                
                self["ButtonRed"] = PixmapConditional(withTimer = False)
                self["ButtonRed"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
-               self.onShown.append(self["ButtonRed"].update)
+               self.onLayoutFinish.append(self["ButtonRed"].update)
                self["ButtonRedText"] = LabelConditional(text = _("Record"), withTimer = False)
                self["ButtonRedText"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
-               self.onShown.append(self["ButtonRedText"].update)
+               self.onLayoutFinish.append(self["ButtonRedText"].update)
 
                self["ButtonGreen"] = Pixmap()
                self["ButtonGreenText"] = Label(_("Subservices"))
 
                self["ButtonYellow"] = PixmapConditional(withTimer = False)
-               self["ButtonYellow"].setConnect(lambda: False)
+               self["ButtonYellow"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
+               self["ButtonYellowText"] = LabelConditional(text = _("Timeshifting"), withTimer = False)
+               self["ButtonYellowText"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
+               self.onLayoutFinish.append(self["ButtonYellow"].update)
+               self.onLayoutFinish.append(self["ButtonYellowText"].update)
 
                self["ButtonBlue"] = PixmapConditional(withTimer = False)
                self["ButtonBlue"].setConnect(lambda: False)
+               self["ButtonBlueText"] = LabelConditional(text = _("Extensions"), withTimer = False)
+               self["ButtonBlueText"].setConnect(lambda: False)
+               self.onLayoutFinish.append(self["ButtonBlue"].update)
+               self.onLayoutFinish.append(self["ButtonBlueText"].update)
 
                self.session.nav.event.append(self.gotServiceEvent) # we like to get service events