aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-01-02 13:08:25 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-01-02 13:08:25 +0000
commit9062e2e8234479445e6c06f8b873d7d866dc8492 (patch)
tree5b2ddcb2f539fada030a59574d1fa9d2584ace13 /lib/python
parentce20861a45fc1fc9b0e2ee7d63c66803dbd8e6db (diff)
downloadenigma2-9062e2e8234479445e6c06f8b873d7d866dc8492.tar.gz
enigma2-9062e2e8234479445e6c06f8b873d7d866dc8492.zip
toggle between epg types with info
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Screens/EpgSelection.py11
-rw-r--r--lib/python/Screens/InfoBarGenerics.py34
2 files changed, 41 insertions, 4 deletions
diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py
index 6f556003..9458e395 100644
--- a/lib/python/Screens/EpgSelection.py
+++ b/lib/python/Screens/EpgSelection.py
@@ -38,16 +38,23 @@ class EPGSelection(Screen):
self["actions"] = ChannelActionMap(["EPGSelectActions", "OkCancelActions"],
{
- "cancel": self.close,
+ "cancel": self.closeClose,
"ok": self.eventSelected,
"timerAdd": self.timerAdd,
"yellow": self.yellowButtonPressed,
- "blue": self.blueButtonPressed
+ "blue": self.blueButtonPressed,
+ "info": self.closeInfo
})
self["actions"].csel = self
self.onLayoutFinish.append(self.onCreate)
+ def closeClose(self):
+ self.close(False)
+
+ def closeInfo(self):
+ self.close(True)
+
#just used in multipeg
def onCreate(self):
l = self["list"]
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index e3fa423f..393f6901 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -358,7 +358,7 @@ class InfoBarEPG:
def __init__(self):
self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions",
{
- "showEPGList": (self.showEPGList, _("show EPG...")),
+ "showEPGList": (self.openSingleServiceEPG, _("show EPG...")),
})
def showEPGList(self):
@@ -374,6 +374,36 @@ class InfoBarEPG:
else: #no bouquets so we open single epg
self.openSingleEPGSelector(self.session.nav.getCurrentlyPlayingServiceReference())
+ def bouquetEPGCallback(self, info):
+ if info:
+ self.openSingleServiceEPG()
+
+ def singleEPGCallback(self, info):
+ if info:
+ self.showEPGList()
+
+ def openSingleServiceEPG(self):
+ ref=self.session.nav.getCurrentlyPlayingServiceReference()
+ ptr=eEPGCache.getInstance()
+ if ptr.startTimeQuery(ref) != -1:
+ self.session.openWithCallback(self.singleEPGCallback, EPGSelection, ref)
+ else: # try to show now/next
+ print 'no epg for service', ref.toString()
+ try:
+ self.epglist = [ ]
+ service = self.session.nav.getCurrentService()
+ info = service.info()
+ ptr=info.getEvent(0)
+ if ptr:
+ self.epglist.append(ptr)
+ ptr=info.getEvent(1)
+ if ptr:
+ self.epglist.append(ptr)
+ if len(self.epglist) > 0:
+ self.session.open(EventView, self.epglist[0], ServiceReference(ref), self.eventViewCallback)
+ except:
+ pass
+
def openBouquetEPG(self, bouquet):
ptr=eEPGCache.getInstance()
services = [ ]
@@ -387,7 +417,7 @@ class InfoBarEPG:
continue
services.append(ServiceReference(service))
if len(services):
- self.session.open(EPGSelection, services)
+ self.session.openWithCallback(self.bouquetEPGCallback, EPGSelection, services)
def openSingleEPGSelector(self, ref):
ptr=eEPGCache.getInstance()