X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FSubservicesQuickzap.py;h=3bcc3c4641d571f6370141f84db2cdc623b3de16;hp=448b4b44410ab5a99918cee652f8505f3c66689f;hb=0a62b65175152c42976d4cb04fb7026d9f910915;hpb=6f73e6abddf4170357c490966d0e1c622eb376f5 diff --git a/lib/python/Screens/SubservicesQuickzap.py b/lib/python/Screens/SubservicesQuickzap.py index 448b4b4..3bcc3c4 100644 --- a/lib/python/Screens/SubservicesQuickzap.py +++ b/lib/python/Screens/SubservicesQuickzap.py @@ -4,14 +4,22 @@ 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, InfoBarAudioSelection +from InfoBarGenerics import InfoBarShowHide, InfoBarMenu, InfoBarInstantRecord, InfoBarTimeshift, InfoBarSeek, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarAudioSelection +from Components.ServiceEventTracker import InfoBarBase from enigma import eTimer -class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarAudioSelection, Screen): +class SubservicesQuickzap(InfoBarBase, InfoBarShowHide, InfoBarMenu, \ + 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, InfoBarExtensions, InfoBarAudioSelection]: + for x in InfoBarBase, InfoBarShowHide, InfoBarMenu, \ + InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, \ + InfoBarTimeshiftState, InfoBarSubtitleSupport, \ + InfoBarExtensions, InfoBarAudioSelection: x.__init__(self) self.restoreService = self.session.nav.getCurrentlyPlayingServiceReference() @@ -45,6 +53,11 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info "9": self.keyNumberGlobal, "0": self.keyNumberGlobal }, 0) + + self.onClose.append(self.__onClose) + + def __onClose(self): + self.session.nav.playService(self.restoreService, False) def onLayoutFinished(self): self.timer.start(0,True) @@ -91,12 +104,15 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info def showSelection(self): self.updateSubservices() tlist = [] - if self.n is not None: - for x in range(self.n): - i = self.subservices.getSubservice(x) - tlist.append((i.getName(), x)) + n = self.n or 0 + if n: + idx = 0 + while idx < n: + i = self.subservices.getSubservice(idx) + tlist.append((i.getName(), idx)) + idx += 1 - keys = [ "", "1", "2", "3", "4", "5", "6", "7", "8", "9" ] + [""] * self.n + keys = [ "", "1", "2", "3", "4", "5", "6", "7", "8", "9" ] + [""] * n self.session.openWithCallback(self.subserviceSelected, ChoiceBox, title=_("Please select a subservice..."), list = tlist, selection = self.currentlyPlayingSubservice, keys = keys) def subserviceSelected(self, service): @@ -112,7 +128,6 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info def quit(self, answer): if answer: - self.session.nav.playService(self.restoreService) self.close() def playSubservice(self, number = 0): @@ -121,7 +136,7 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info del self.subservices del self.service self.lastservice = self.currentlyPlayingSubservice - self.session.nav.playService(newservice) + self.session.nav.playService(newservice, False) self.currentlyPlayingSubservice = number self.currentSubserviceNumberLabel.setText(str(number)) self.doShow()