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, iSubserviceListPtr, eServiceEventPtrPtr
7 class SubserviceSelection(Screen):
9 selection = self["subservices"].getCurrent()
10 self.close(selection[1])
13 def __init__(self, session, subservices, parent=None):
14 Screen.__init__(self, session)
16 self["actions"] = ActionMap(["OkCancelActions"],
18 "cancel": self.Cancel,
22 self.subservices = subservices
26 if isinstance(subservices, iSubserviceListPtr):
27 n = subservices.getNumberOfSubservices()
29 i = subservices.getSubservice(x)
30 tlist.append((i.getName(), i))
31 elif isinstance(subservices, eServiceEventPtrPtr):
32 n = subservices.getNumOfLinkageServices()
34 i = subservices.getLinkageService(parent, x)
35 tlist.append((i.getName(), i))
37 print "unknown type of subservices"
39 self["subservices"] = MenuList(tlist)