From 430284954068906c8e2ad3ac4479292f145610c4 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 4 Jul 2006 18:52:17 +0000 Subject: [PATCH] really fix satfinder sync channellist with pip --- .../Plugins/SystemPlugins/Satfinder/plugin.py | 14 +++++-- lib/python/Screens/ChannelSelection.py | 14 +++++++ lib/python/Screens/InfoBarGenerics.py | 40 +++++++++++-------- 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py b/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py index 861db627..fceff4ce 100644 --- a/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py @@ -79,12 +79,18 @@ class Satfinder(ScanSetup): self.feid = feid if not self.openFrontend(): - self.frontend = None + session.nav.stopService() # try to disable foreground service + if not self.openFrontend(): + if session.pipshown: # try to disable pip + session.pipshown = False + del session.pip + if not self.openFrontend(): + self.frontend = None # in normal case this should not happen + self.getFrontend = None ScanSetup.__init__(self, session) - self.session.nav.stopService() self.tuner = Tuner(self.frontend) - + self["snr"] = Label() self["agc"] = Label() self["ber"] = Label() @@ -129,7 +135,7 @@ class Satfinder(ScanSetup): self.list.append(getConfigListEntry(_('Symbol Rate'), config.scan.sat.symbolrate)) self.list.append(getConfigListEntry(_("Polarity"), config.scan.sat.polarization)) self.list.append(getConfigListEntry(_("FEC"), config.scan.sat.fec)) - elif config.tuning.transponder and self.currentConfigSelectionElement(config.tuning.type) == "predefined_transponder": + elif config.tuning.transponder and currentConfigSelectionElement(config.tuning.type) == "predefined_transponder": self.list.append(getConfigListEntry(_("Transponder"), config.tuning.transponder)) self["config"].list = self.list self["config"].l.setList(self.list) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 0870232e..a52fd367 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -1032,6 +1032,20 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect self.lastservice.value = refstr self.lastservice.save() + def setCurrentServicePath(self, path): + hlen = len(self.history) + if hlen > 0: + self.history[self.history_pos] = path + else: + self.history.append(path) + self.setHistoryPath() + + def getCurrentServicePath(self): + hlen = len(self.history) + if hlen > 0: + return self.history[self.history_pos] + return None + def recallPrevService(self): hlen = len(self.history) if hlen > 1: diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index fcce082f..f530dddd 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -1029,7 +1029,7 @@ from Screens.PiPSetup import PiPSetup class InfoBarExtensions: def __init__(self): - self.pipshown = False + self.session.pipshown = False self["InstantExtensionsActions"] = HelpableActionMap(self, "InfobarExtensions", { @@ -1044,9 +1044,9 @@ class InfoBarExtensions: def extensions(self): list = [] - if self.pipshown == False: + if self.session.pipshown == False: list.append((_("Activate Picture in Picture"), self.PIPON)) - elif self.pipshown == True: + elif self.session.pipshown == True: list.append((_("Disable Picture in Picture"), self.PIPOFF)) list.append((_("Move Picture in Picture"), self.MOVEPIP)) list.append((_("Swap services"), self.PIPSWAP)) @@ -1062,26 +1062,32 @@ class InfoBarExtensions: def extensionCallback(self, answer): if answer is not None: if answer[1] == self.PIPON: - self.pip = self.session.instantiateDialog(PictureInPicture) - + self.session.pip = self.session.instantiateDialog(PictureInPicture) newservice = self.session.nav.getCurrentlyPlayingServiceReference() - - if self.pip.playService(newservice): - self.pipshown = True + if self.session.pip.playService(newservice): + self.session.pipshown = True + self.session.pip.servicePath = self.servicelist.getCurrentServicePath() else: - self.pipshown = False - del self.pip + self.session.pipshown = False + del self.session.pip self.session.nav.playService(newservice) elif answer[1] == self.PIPOFF: - del self.pip - self.pipshown = False + del self.session.pip + self.session.pipshown = False elif answer[1] == self.PIPSWAP: - swapservice = self.pip.getCurrentService() - self.pip.playService(self.session.nav.getCurrentlyPlayingServiceReference()) - self.session.nav.playService(swapservice) - + swapservice = self.session.nav.getCurrentlyPlayingServiceReference() + if self.session.pip.servicePath: + servicepath = self.servicelist.getCurrentServicePath() + ref=servicepath[len(servicepath)-1] + pipref=self.session.pip.getCurrentService() + self.session.pip.playService(swapservice) + self.servicelist.setCurrentServicePath(self.session.pip.servicePath) + if pipref.toString() != ref.toString(): # is a subservice ? + self.session.nav.stopService() # stop portal + self.session.nav.playService(pipref) # start subservice + self.session.pip.servicePath=servicepath elif answer[1] == self.MOVEPIP: - self.session.open(PiPSetup, pip = self.pip) + self.session.open(PiPSetup, pip = self.session.pip) elif answer[1] == self.ENABLE_SUBTITLE: self.selected_subtitle = answer[2] self.subtitles_enabled = True -- 2.30.2