import xml.dom.minidom
class EPGSelection(Screen):
- def __init__(self, session, service, zapFunc=None, eventid=None):
+ def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None):
Screen.__init__(self, session)
- self.asked_specific_time = False
+ self.bouquetChangeCB = bouquetChangeCB
+ self.ask_time = -1 #now
self["key_red"] = Button("")
self.closeRecursive = False
if isinstance(service, str) and eventid != None:
"yellow": self.yellowButtonPressed,
"blue": self.blueButtonPressed,
"info": self.infoKeyPressed,
- "zapTo": self.zapTo,
- "input_date_time": self.enterDateTime
+ "red": self.zapTo,
+ "input_date_time": self.enterDateTime,
+ "nextBouquet": self.nextBouquet,
+ "prevBouquet": self.prevBouquet
})
self["actions"].csel = self
self.onLayoutFinish.append(self.onCreate)
+ def nextBouquet(self):
+ if self.bouquetChangeCB:
+ self.bouquetChangeCB(1, self)
+
+ def prevBouquet(self):
+ if self.bouquetChangeCB:
+ self.bouquetChangeCB(-1, self)
+
def enterDateTime(self):
if self.type == EPG_TYPE_MULTI:
self.session.openWithCallback(self.onDateTimeInputClosed, TimeDateInput)
def onDateTimeInputClosed(self, ret):
if len(ret) > 1:
if ret[0]:
- self.asked_specific_time=True
+ self.ask_time=ret[1]
self["list"].fillMultiEPG(self.services, ret[1])
def closeScreen(self):
def openSimilarList(self, eventid, refstr):
self.session.open(EPGSelection, refstr, None, eventid)
+ def setServices(self, services):
+ self.services = services
+ self.onCreate()
+
#just used in multipeg
def onCreate(self):
l = self["list"]
if self.type == EPG_TYPE_MULTI:
l.recalcEntrySize()
- l.fillMultiEPG(self.services)
+ l.fillMultiEPG(self.services, self.ask_time)
elif self.type == EPG_TYPE_SINGLE:
if SINGLE_CPP == 0:
l.recalcEntrySize()
setEvent(cur[0])
def zapTo(self): # just used in multiepg
- if self.zapFunc != None:
- self.closeRecursive = True
- ref = self["list"].getCurrent()[1]
- self.zapFunc(ref.ref)
+ if self.zapFunc and self["key_red"].getText() == "Zap":
+ lst = self["list"]
+ count = lst.getCurrentChangeCount()
+ if count == 0:
+ self.closeRecursive = True
+ ref = lst.getCurrent()[1]
+ self.zapFunc(ref.ref)
def eventSelected(self):
- if self.type == EPG_TYPE_MULTI:
- self.zapTo()
- else:
- self.infoKeyPressed()
+ self.infoKeyPressed()
def yellowButtonPressed(self):
if self.type == EPG_TYPE_MULTI:
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()
def onSelectionChanged(self):
if self.type == EPG_TYPE_MULTI:
count = self["list"].getCurrentChangeCount()
- if self.asked_specific_time:
+ if self.ask_time != -1:
self.applyButtonState(0)
elif count > 1:
self.applyButtonState(3)