aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2011-03-17 18:46:32 +0100
committerghost <andreas.monzner@multimedia-labs.de>2011-03-17 18:47:34 +0100
commit005321304bec7f71e748db3173d411f5684642e2 (patch)
treee4ea8666e9e766dd425958f2328bb6925013a1d9 /lib/python
parentdd3cf818ebef5c080a8d49f6663200d284840974 (diff)
downloadenigma2-005321304bec7f71e748db3173d411f5684642e2.tar.gz
enigma2-005321304bec7f71e748db3173d411f5684642e2.zip
make new multi epg bouquet handling optional via usage config "Multi-EPG bouquet selection (Yes/No)" option
default is the old behaviour refs bug #453
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/UsageConfig.py2
-rw-r--r--lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py40
-rw-r--r--lib/python/Screens/InfoBarGenerics.py26
3 files changed, 59 insertions, 9 deletions
diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py
index 60827107..90f11fe2 100644
--- a/lib/python/Components/UsageConfig.py
+++ b/lib/python/Components/UsageConfig.py
@@ -9,6 +9,8 @@ def InitUsageConfig():
config.usage = ConfigSubsection();
config.usage.showdish = ConfigYesNo(default = True)
config.usage.multibouquet = ConfigYesNo(default = False)
+ config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)
+
config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
config.usage.e1like_radio_mode = ConfigYesNo(default = False)
config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
diff --git a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
index aed561bf..3635272b 100644
--- a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
+++ b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
@@ -1,8 +1,9 @@
from Plugins.Plugin import PluginDescriptor
from GraphMultiEpg import GraphMultiEPG
-from Screens.ChannelSelection import SilentBouquetSelector
+from Screens.ChannelSelection import BouquetSelector, SilentBouquetSelector
from enigma import eServiceCenter, eServiceReference
from ServiceReference import ServiceReference
+from Components.config import config
Session = None
Servicelist = None
@@ -73,23 +74,46 @@ def changeBouquetCB(direction, epg):
epg_bouquet = bouquet
epg.setServices(services)
+def openAskBouquet(Session, bouquets, cnt):
+ if cnt > 1: # show bouquet list
+ global bouquetSel
+ bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True)
+ dlg_stack.append(bouquetSel)
+ elif cnt == 1:
+ if not openBouquetEPG(bouquets[0][1]):
+ cleanup()
+
+def openSilent(Servicelist, bouquets, cnt):
+ root = Servicelist.getRoot()
+ if cnt > 1: # create bouquet list
+ global bouquetSel
+ current = 0
+ rootstr = root.toCompareString()
+ for bouquet in bouquets:
+ if bouquet[1].toCompareString() == rootstr:
+ break
+ current += 1
+ if current >= cnt:
+ current = 0
+ bouquetSel = SilentBouquetSelector(bouquets, True, current)
+ if cnt >= 1: # open current bouquet
+ if not openBouquetEPG(root):
+ cleanup()
+
def main(session, servicelist, **kwargs):
global Session
Session = session
global Servicelist
Servicelist = servicelist
bouquets = Servicelist.getBouquetList()
- root = Servicelist.getRoot()
if bouquets is None:
cnt = 0
else:
cnt = len(bouquets)
- if cnt > 1: # create bouquet list
- global bouquetSel
- bouquetSel = SilentBouquetSelector(bouquets, True, Servicelist.getBouquetNumOffset(root))
- if cnt >= 1: # open current bouquet
- if not openBouquetEPG(root):
- cleanup()
+ if config.usage.multiepg_ask_bouquet.value:
+ openAskBouquet(session, bouquets, cnt)
+ else:
+ openSilent(servicelist, bouquets, cnt)
def Plugins(**kwargs):
name = _("Graphical Multi EPG")
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 108610e3..5404a4e0 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -555,11 +555,35 @@ class InfoBarEPG:
def openMultiServiceEPG(self, withCallback=True):
bouquets = self.servicelist.getBouquetList()
- root = self.servicelist.getRoot()
if bouquets is None:
cnt = 0
else:
cnt = len(bouquets)
+ if config.usage.multiepg_ask_bouquet.value:
+ self.openMultiServiceEPGAskBouquet(bouquets, cnt, withCallback)
+ else:
+ self.openMultiServiceEPGSilent(bouquets, cnt, withCallback)
+
+ def openMultiServiceEPGAskBouquet(self, bouquets, cnt, withCallback):
+ if cnt > 1: # show bouquet list
+ if withCallback:
+ self.bouquetSel = self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG, enableWrapAround=True)
+ self.dlg_stack.append(self.bouquetSel)
+ else:
+ self.bouquetSel = self.session.open(BouquetSelector, bouquets, self.openBouquetEPG, enableWrapAround=True)
+ elif cnt == 1:
+ self.openBouquetEPG(bouquets[0][1], withCallback)
+
+ def openMultiServiceEPGSilent(self, bouquets, cnt, withCallback):
+ root = self.servicelist.getRoot()
+ rootstr = root.toCompareString()
+ current = 0
+ for bouquet in bouquets:
+ if bouquet[1].toCompareString() == rootstr:
+ break
+ current += 1
+ if current >= cnt:
+ current = 0
if cnt > 1: # create bouquet list for bouq+/-
self.bouquetSel = SilentBouquetSelector(bouquets, True, self.servicelist.getBouquetNumOffset(root))
if cnt >= 1: