1 from Screen import Screen
2 from Components.Button import Button
3 from Components.ServiceList import ServiceList
4 from Components.ActionMap import ActionMap
6 from enigma import eServiceReference
8 class ChannelSelection(Screen):
9 def __init__(self, session):
10 Screen.__init__(self, session)
12 self["key_red"] = Button("red")
13 self["key_green"] = Button("green")
14 self["key_yellow"] = Button("yellow")
15 self["key_blue"] = Button("blue")
17 self["list"] = ServiceList()
18 self["list"].setRoot(eServiceReference("""1:0:1:0:0:0:0:0:0:0:(provider=="ARD") && (type == 1)"""))
20 #self["okbutton"] = Button("ok", [self.channelSelected])
22 class ChannelActionMap(ActionMap):
23 def action(self, contexts, action):
24 if action[:7] == "bouquet":
25 print "setting root to " + action[8:]
26 self.csel["list"].setRoot(eServiceReference("1:0:1:0:0:0:0:0:0:0:" + action[8:]))
28 ActionMap.action(self, contexts, action)
30 self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions"],
33 "ok": self.channelSelected,
36 self["actions"].csel = self
39 ref = self["list"].getCurrent()
40 if self["list"].isMarked(ref):
41 self["list"].removeMarked(ref)
43 self["list"].addMarked(ref)
45 def channelSelected(self):
46 self.session.nav.playService(self["list"].getCurrent())
51 self.session.nav.playService(self["list"].getCurrent())
57 self["list"].moveDown()