X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FSubservicesQuickzap.py;h=09f2e727ae956fe74331e062e5f6b708ca035917;hp=14b7b3c1372b0d2bc9ca93e8b94006b031335b8e;hb=e03c732afb410b4d6b9f9540c36c33c941ee38f1;hpb=7ef9c069ca947922cf36b711f81c1450f409bc80 diff --git a/lib/python/Screens/SubservicesQuickzap.py b/lib/python/Screens/SubservicesQuickzap.py index 14b7b3c..09f2e72 100644 --- a/lib/python/Screens/SubservicesQuickzap.py +++ b/lib/python/Screens/SubservicesQuickzap.py @@ -4,15 +4,15 @@ from Components.Label import Label from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox -from InfoBarGenerics import InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarTimeshift, InfoBarSeek, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport +from InfoBarGenerics import InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarTimeshift, InfoBarSeek, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarAudioSelection -class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, Screen): +from enigma import eTimer + +class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarAudioSelection, Screen): def __init__(self, session, subservices): Screen.__init__(self, session) - for x in [InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarSubtitleSupport]: + for x in [InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarSubtitleSupport, InfoBarExtensions, InfoBarAudioSelection]: x.__init__(self) - InfoBarExtensions.__init__(self, useServicePath = False) - self.restoreService = self.session.nav.getCurrentlyPlayingServiceReference() @@ -21,9 +21,11 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info self.updateSubservices() self.currentlyPlayingSubservice = 0 - - self.onLayoutFinish.append(self.playSubservice) - + + self.timer = eTimer() + self.timer.timeout.get().append(self.playSubservice) + self.onLayoutFinish.append(self.onLayoutFinished) + self["actions"] = NumberActionMap( [ "InfobarSubserviceQuickzapActions", "NumberActions", "DirectionActions", "ColorActions" ], { "up": self.showSelection, @@ -44,8 +46,9 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info "0": self.keyNumberGlobal }, -1) - - + def onLayoutFinished(self): + self.timer.start(0,True) + def updateSubservices(self): self.service = self.session.nav.getCurrentService() self.subservices = self.service and self.service.subServices() @@ -53,18 +56,22 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info def nextSubservice(self): self.updateSubservices() - if self.currentlyPlayingSubservice == self.n - 1: - self.playSubservice(0) - else: - self.playSubservice(self.currentlyPlayingSubservice + 1) + if self.n: + if self.currentlyPlayingSubservice >= self.n - 1: + self.playSubservice(0) + else: + self.playSubservice(self.currentlyPlayingSubservice + 1) def previousSubservice(self): self.updateSubservices() - if self.currentlyPlayingSubservice == 0: - self.playSubservice(self.n - 1) - else: - self.playSubservice(self.currentlyPlayingSubservice - 1) - + if self.n: + if self.currentlyPlayingSubservice > self.n: + self.currentlyPlayingSubservice = self.n + if self.currentlyPlayingSubservice == 0: + self.playSubservice(self.n - 1) + else: + self.playSubservice(self.currentlyPlayingSubservice - 1) + def getSubserviceIndex(self, service): self.updateSubservices() for x in range(self.n): @@ -111,6 +118,7 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info del self.subservices del self.service self.lastservice = self.currentlyPlayingSubservice + self.session.nav.stopService() self.session.nav.playService(newservice) self.currentlyPlayingSubservice = number self.currentSubserviceNumberLabel.setText(str(number))