From 92c581769db1ebef1325d175e3b610be25317af1 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Thu, 19 Jan 2006 18:43:25 +0000 Subject: [PATCH] make Multi Bouquets swich useable --- lib/python/Components/UsageConfig.py | 12 +--------- lib/python/Screens/ChannelSelection.py | 32 +++++++++++++++----------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index 027dc3ff..779f5cf3 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -2,19 +2,9 @@ from config import * import os from enigma import * -from Screens.ChannelSelection import USE_MULTIBOUQUETS -global USE_MULTIBOUQUETS - def InitUsageConfig(): config.usage = ConfigSubsection(); config.usage.epgtoggle = configElement("config.usage.epgtoggle", configSelection, 1, (("yes", _("yes")), ("no", _("no"))) ) config.usage.showdish = configElement("config.usage.showdish", configSelection, 1, (("yes", _("yes")), ("no", _("no"))) ) config.usage.multibouquet = configElement("config.usage.multibouquet", configSelection, 1, (("yes", _("yes")), ("no", _("no"))) ) - - def setMultiBouquet(configElement): - if currentConfigSelectionElement(configElement) == "no": - USE_MULTIBOUQUETS = False - else: - USE_MULTIBOUQUETS = True - - config.usage.multibouquet.addNotifier(setMultiBouquet); \ No newline at end of file + diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index a5b6e034..e7c67f3b 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -4,7 +4,7 @@ from Components.ServiceList import ServiceList from Components.ActionMap import NumberActionMap from EpgSelection import EPGSelection from enigma import eServiceReference, eEPGCache, eEPGCachePtr, eServiceCenter, eServiceCenterPtr, iMutableServiceListPtr, iStaticServiceInformationPtr, eTimer -from Components.config import config, configElement, ConfigSubsection, configText +from Components.config import config, configElement, ConfigSubsection, configText, currentConfigSelectionElement from Screens.FixedMenu import FixedMenu from Tools.NumericalTextInput import NumericalTextInput from Components.NimManager import nimmanager @@ -237,8 +237,6 @@ class ChannelSelectionEdit: def doContext(self): self.session.open(ChannelContextMenu, self) -USE_MULTIBOUQUETS = False - MODE_TV = 0 MODE_RADIO = 1 @@ -295,12 +293,21 @@ class ChannelSelectionBase(Screen): offsetCount += 1 return offsetCount - def setTvMode(self): - self.service_types = self.service_types_tv - if USE_MULTIBOUQUETS: - self.bouquet_root = eServiceReference('1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.tv" ORDER BY bouquet') + def recallBouquetMode(self): + if self.mode == MODE_TV: + self.service_types = self.service_types_tv + if currentConfigSelectionElement(config.usage.multibouquet) == "yes": + self.bouquet_root = eServiceReference('1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.tv" ORDER BY bouquet') + else: + self.bouquet_root = eServiceReference('%s FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet'%(self.service_types)) else: - self.bouquet_root = eServiceReference('%s FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet'%(self.service_types)) + self.service_types = self.service_types_radio + if currentConfigSelectionElement(config.usage.multibouquet) == "yes": + self.bouquet_root = eServiceReference('1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.radio" ORDER BY bouquet') + else: + self.bouquet_root = eServiceReference('%s FROM BOUQUET "userbouquet.favourites.radio" ORDER BY bouquet'%(self.service_types)) + + def setTvMode(self): title = self.instance.getTitle() pos = title.find(" (") if pos != -1: @@ -308,13 +315,9 @@ class ChannelSelectionBase(Screen): title += " (TV)" self.instance.setTitle(title) self.mode = MODE_TV + self.recallBouquetMode() def setRadioMode(self): - self.service_types = self.service_types_radio - if USE_MULTIBOUQUETS: - self.bouquet_root = eServiceReference('1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.radio" ORDER BY bouquet') - else: - self.bouquet_root = eServiceReference('%s FROM BOUQUET "userbouquet.favourites.radio" ORDER BY bouquet'%(self.service_types)) title = self.instance.getTitle() pos = title.find(" (") if pos != -1: @@ -322,6 +325,7 @@ class ChannelSelectionBase(Screen): title += " (Radio)" self.instance.setTitle(title) self.mode = MODE_RADIO + self.recallBouquetMode() def setRootBase(self, root, justSet=False): path = root.getPath() @@ -560,7 +564,7 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit): self.session.nav.playService(lastservice) def onShow(self): - self.setTvMode() + self.recallBouquetMode() ref = self.session.nav.getCurrentlyPlayingServiceReference() if ref is not None and ref.valid() and ref.getPath() == "": self.servicelist.setPlayableIgnoreService(ref) -- 2.30.2