+
+ def applyButtonState(self, state):
+ if state == 0:
+ self["now_button"].hide()
+ self["now_button_sel"].hide()
+ self["next_button"].hide()
+ self["next_button_sel"].hide()
+ self["more_button"].hide()
+ self["more_button_sel"].hide()
+ self["now_text"].hide()
+ self["next_text"].hide()
+ self["more_text"].hide()
+ self["key_red"].setText("")
+ else:
+ if state == 1:
+ self["key_red"].setText("Zap")
+ self["now_button_sel"].show()
+ self["now_button"].hide()
+ else:
+ self["now_button"].show()
+ self["now_button_sel"].hide()
+ self["key_red"].setText("")
+
+ if state == 2:
+ self["next_button_sel"].show()
+ self["next_button"].hide()
+ else:
+ self["next_button"].show()
+ self["next_button_sel"].hide()
+
+ if state == 3:
+ self["more_button_sel"].show()
+ self["more_button"].hide()
+ else:
+ self["more_button"].show()
+ self["more_button_sel"].hide()
+
+ def onSelectionChanged(self):
+ if self.type == EPG_TYPE_MULTI:
+ count = self["list"].getCurrentChangeCount()
+ if self.ask_time != -1:
+ self.applyButtonState(0)
+ elif count > 1:
+ self.applyButtonState(3)
+ elif count > 0:
+ self.applyButtonState(2)
+ else:
+ self.applyButtonState(1)
+ days = [ _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun") ]
+ datastr = ""
+ event = self["list"].getCurrent()[0]
+ if event is not None:
+ now = time()
+ beg = event.getBeginTime()
+ nowTime = localtime(now)
+ begTime = localtime(beg)
+ if nowTime[2] != begTime[2]:
+ datestr = '%s %d.%d.'%(days[begTime[6]], begTime[2], begTime[1])
+ else:
+ datestr = '%s %d.%d.'%(_("Today"), begTime[2], begTime[1])
+ self["date"].setText(datestr)