+
+ def getSimilarEvents(self):
+ # search similar broadcastings
+ refstr = str(self.currentService)
+ id = self.event.getEventId()
+ epgcache = eEPGCache.getInstance()
+ ret = epgcache.search(('NB', 100, eEPGCache.SIMILAR_BROADCASTINGS_SEARCH, refstr, id))
+ if ret is not None:
+ descr = self["epg_description"]
+ text = descr.getText()
+ text += '\n\n' + _('Similar broadcasts:')
+ ret.sort(self.sort_func)
+ for x in ret:
+ t = localtime(x[1])
+ text += '\n%d.%d.%d, %02d:%02d - %s'%(t[2], t[1], t[0], t[3], t[4], x[0])
+ descr.setText(text)
+ self["key_red"].setText(_("Similar"))
+
+ def openSimilarList(self):
+ if self.similarEPGCB is not None and len(self["key_red"].getText()):
+ id = self.event and self.event.getEventId()
+ refstr = str(self.currentService)
+ if id is not None:
+ self.similarEPGCB(id, refstr)
+
+class EventViewSimple(Screen, EventViewBase):
+ def __init__(self, session, Event, Ref, callback=None, similarEPGCB=None):
+ Screen.__init__(self, session)
+ self.skinName = "EventView"
+ EventViewBase.__init__(self, Event, Ref, callback, similarEPGCB)
+
+class EventViewEPGSelect(Screen, EventViewBase):
+ def __init__(self, session, Event, Ref, callback=None, singleEPGCB=None, multiEPGCB=None, similarEPGCB=None):
+ Screen.__init__(self, session)
+ self.skinName = "EventView"
+ EventViewBase.__init__(self, Event, Ref, callback, similarEPGCB)
+ self["key_yellow"].setText(_("Single EPG"))
+ self["key_blue"].setText(_("Multi EPG"))
+ self["epgactions"] = ActionMap(["EventViewEPGActions"],
+ {
+ "openSingleServiceEPG": singleEPGCB,
+ "openMultiServiceEPG": multiEPGCB,
+ })