wizardize the start wizard
[enigma2.git] / lib / python / Screens / SubserviceSelection.py
1 from Screen import Screen
2 from Components.ActionMap import ActionMap
3 from Components.MenuList import MenuList
4 from Components.Label import Label
5 from enigma import eServiceReferencePtr, eServiceReference
6
7 class SubserviceSelection(Screen):
8         def KeyOk(self):
9                 selection = self["subservices"].getCurrent()
10                 self.close(selection[1])
11         def Cancel(self):
12                 self.close(None)
13         def __init__(self, session, subservices):
14                 Screen.__init__(self, session)
15
16                 self["actions"] = ActionMap(["OkCancelActions"], 
17                         {
18                                 "cancel": self.Cancel,
19                                 "ok": self.KeyOk,
20                         })
21
22                 self.subservices = subservices
23
24                 tlist = []
25                 n = subservices.getNumberOfSubservices()
26                 for x in range(n):
27                         i = subservices.getSubservice(x)
28                         tlist.append((i.getName(), i))
29
30                 self["subservices"] = MenuList(tlist)