+ if refstr != config.tv.lastservice.value:
+ config.tv.lastservice.value = refstr
+ config.tv.lastservice.save()
+
+ def recallPrevService(self):
+ hlen = len(self.history)
+ if hlen > 1:
+ if self.history_pos == hlen-1:
+ tmp = self.history[self.history_pos]
+ self.history[self.history_pos] = self.history[self.history_pos-1]
+ self.history[self.history_pos-1] = tmp
+ else:
+ tmp = self.history[self.history_pos+1]
+ self.history[self.history_pos+1] = self.history[self.history_pos]
+ self.history[self.history_pos] = tmp
+ self.setHistoryPath()
+
+ def cancel(self):
+ self.close(None)
+ self.restoreRoot()
+ lastservice=eServiceReference(config.tv.lastservice.value)
+ if lastservice.valid() and self.getCurrentSelection() != lastservice:
+ self.setCurrentSelection(lastservice)
+
+from Screens.InfoBarGenerics import InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord
+
+class RadioInfoBar(Screen, InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord):
+ def __init__(self, session):
+ Screen.__init__(self, session)
+ InfoBarEvent.__init__(self)
+ InfoBarServiceName.__init__(self)
+ InfoBarInstantRecord.__init__(self)
+ self["Clock"] = Clock()
+
+class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelectionEPG):
+ def __init__(self, session):
+ ChannelSelectionBase.__init__(self, session)
+ ChannelSelectionEdit.__init__(self)
+ ChannelSelectionEPG.__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(RadioInfoBar)
+
+ self["actions"] = ActionMap(["OkCancelActions", "TvRadioActions"],
+ {
+ "keyTV": self.closeRadio,
+ "keyRadio": self.closeRadio,
+ "cancel": self.closeRadio,
+ "ok": self.channelSelected,
+ })