+ self.setCurrentSelection(lastservice)
+
+class ServiceInfoWindow(Screen):
+ def __init__(self, session):
+ Screen.__init__(self, session)
+ self["Service_Name"] = ServiceName(self.session.nav)
+ self["Clock"] = Clock()
+ self["Event_Now_StartTime"] = EventInfo(self.session.nav, EventInfo.Now_StartTime)
+ self["Event_Next_StartTime"] = EventInfo(self.session.nav, EventInfo.Next_StartTime)
+ self["Event_Now"] = EventInfo(self.session.nav, EventInfo.Now)
+ self["Event_Next"] = EventInfo(self.session.nav, EventInfo.Next)
+ self["Event_Now_Duration"] = EventInfo(self.session.nav, EventInfo.Now_Duration)
+ self["Event_Next_Duration"] = EventInfo(self.session.nav, EventInfo.Next_Duration)
+
+class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit):
+ def __init__(self, session):
+ ChannelSelectionBase.__init__(self, session)
+ ChannelSelectionEdit.__init__(self)
+
+ config.radio = ConfigSubsection();
+ config.radio.lastservice = configElement("config.radio.lastservice", configText, "", 0);
+ config.radio.lastroot = configElement("config.radio.lastroot", configText, "", 0);
+ self.onLayoutFinish.append(self.onCreate)
+
+ self.info = session.instantiateDialog(ServiceInfoWindow)
+
+ class ChannelActionMap(NumberActionMap):
+ def action(self, contexts, action):
+ if not self.csel.enterBouquet(action):
+ NumberActionMap.action(self, contexts, action)
+ self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions", "ContextMenuActions", "TvRadioActions"],
+ {
+ "keyTV": self.closeRadio,
+ "keyRadio": self.closeRadio,
+ "contextMenu": self.doContext,
+ "cancel": self.closeRadio,
+ "ok": self.channelSelected,
+ "showFavourites": self.showFavourites,
+ "showAllServices": self.showAllServices,
+ "showProviders": self.showProviders,
+ "showSatellites": self.showSatellites,
+ "1": self.keyNumberGlobal,
+ "2": self.keyNumberGlobal,
+ "3": self.keyNumberGlobal,
+ "4": self.keyNumberGlobal,
+ "5": self.keyNumberGlobal,
+ "6": self.keyNumberGlobal,
+ "7": self.keyNumberGlobal,
+ "8": self.keyNumberGlobal,
+ "9": self.keyNumberGlobal,
+ "0": self.keyNumberGlobal
+ })
+ self["actions"].csel = self
+
+ def saveRoot(self):
+ path = ''
+ for i in self.servicePathRadio:
+ path += i.toString()
+ path += ';'
+ if len(path) and path != config.radio.lastroot.value:
+ config.radio.lastroot.value = path
+ config.radio.lastroot.save()
+
+ def restoreRoot(self):
+ self.servicePathRadio = [ ]
+ re = compile('.+?;')
+ tmp = re.findall(config.radio.lastroot.value)
+ cnt = 0
+ for i in tmp:
+ self.servicePathRadio.append(eServiceReference(i[:len(i)-1]))
+ cnt += 1
+ if cnt:
+ path = self.servicePathRadio.pop()
+ self.enterPath(path)
+ else:
+ self.showFavourites()
+ self.saveRoot()
+
+ def onCreate(self):
+ self.setRadioMode()
+ self.restoreRoot()
+ lastservice=eServiceReference(config.radio.lastservice.value)
+ if lastservice.valid():