aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2011-09-13 10:50:43 +0200
committerghost <andreas.monzner@multimedia-labs.de>2011-09-13 10:50:43 +0200
commit804ad88e6679853bd2db717fc542263d48075631 (patch)
tree87e2fb5558b79ef89154176f5efdda3921ee8f03 /lib/python/Screens
parent64d399c3d183fa3f7d02fb73e474e42583538def (diff)
parent005321304bec7f71e748db3173d411f5684642e2 (diff)
downloadenigma2-804ad88e6679853bd2db717fc542263d48075631.tar.gz
enigma2-804ad88e6679853bd2db717fc542263d48075631.zip
Merge remote-tracking branch 'origin/bug_453_multiepg_no_more_ask_bouquet'
Diffstat (limited to 'lib/python/Screens')
-rw-r--r--lib/python/Screens/ChannelSelection.py18
-rw-r--r--lib/python/Screens/InfoBarGenerics.py23
2 files changed, 40 insertions, 1 deletions
diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py
index c07e3495..912d6784 100644
--- a/lib/python/Screens/ChannelSelection.py
+++ b/lib/python/Screens/ChannelSelection.py
@@ -65,6 +65,24 @@ class BouquetSelector(Screen):
def cancelClick(self):
self.close(False)
+class SilentBouquetSelector:
+ def __init__(self, bouquets, enableWrapAround=False, current=0):
+ self.bouquets = [b[1] for b in bouquets]
+ self.pos = current
+ self.count = len(bouquets)
+ self.enableWrapAround = enableWrapAround
+
+ def up(self):
+ if self.pos > 0 or self.enableWrapAround:
+ self.pos = (self.pos - 1) % self.count
+
+ def down(self):
+ if self.pos < (self.count - 1) or self.enableWrapAround:
+ self.pos = (self.pos + 1) % self.count
+
+ def getCurrent(self):
+ return self.bouquets[self.pos]
+
# csel.bouquet_mark_edit values
OFF = 0
EDIT_BOUQUET = 1
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 2e97b59d..93a47886 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -1,4 +1,4 @@
-from ChannelSelection import ChannelSelection, BouquetSelector
+from ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.ActionMap import NumberActionMap
@@ -559,6 +559,12 @@ class InfoBarEPG:
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)
@@ -568,6 +574,21 @@ class InfoBarEPG:
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:
+ self.openBouquetEPG(root, withCallback)
+
def changeServiceCB(self, direction, epg):
if self.serviceSel:
if direction > 0: