aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/EpgSelection.py
blob: 9ab18fb0b64004d18f85ec3d5ba214420bff7709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from Screen import Screen
from Components.Button import Button
from Components.EpgList import EPGList
from Components.ActionMap import ActionMap
from Screens.EventView import EventView
from enigma import eServiceReference, eServiceEventPtr
from Screens.FixedMenu import FixedMenu

import xml.dom.minidom

class EPGSelection(Screen):
	def __init__(self, session, root):
		Screen.__init__(self, session)

		self["list"] = EPGList()

		class ChannelActionMap(ActionMap):
			def action(self, contexts, action):
					ActionMap.action(self, contexts, action)

		self["actions"] = ChannelActionMap(["EPGSelectActions", "OkCancelActions"], 
			{
				"cancel": self.close,
				"ok": self.eventSelected,
			})
		self["actions"].csel = self
		self.setRoot(root)

	def eventViewCallback(self, setEvent, val):
		if val == -1:
			self.moveUp()
			setEvent(self["list"].getCurrent())
		elif val == +1:
			self.moveDown()
			setEvent(self["list"].getCurrent())

	def eventSelected(self):
		event = self["list"].getCurrent()
		self.session.open(EventView, event, self.eventViewCallback)
	
	def setRoot(self, root):
		self["list"].setRoot(root)

	def moveUp(self):
		self["list"].moveUp()

	def moveDown(self):
		self["list"].moveDown()