def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): rec1 = beginTime and self.timer.isInTimer(eventId, beginTime, duration, service) # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and isInRemoteTimer(self, beginTime, duration, service) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT | RT_VALIGN_CENTER, self.days[t[6]]), (eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r1.height(), 0, RT_HALIGN_RIGHT | RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d" % (t[2], t[1], t[3], t[4])) ] if rec1 or rec2: if rec1: clock_pic = self.getClockPixmap(service, beginTime, duration, eventId) # maybe Partnerbox too if rec2: clock_pic_partnerbox = getRemoteClockPixmap( self, service, beginTime, duration, eventId) else: clock_pic = getRemoteClockPixmap(self, service, beginTime, duration, eventId) if rec1 and rec2: # Partnerbox and local res.extend( ((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), 4, 21, 21, clock_pic), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + 30, 4, 21, 21, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, r3.left() + 60, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: res.extend( ((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), 4, 21, 21, clock_pic), (eListboxPythonMultiContent.TYPE_TEXT, r3.left() + 30, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: res.append( (eListboxPythonMultiContent.TYPE_TEXT, r3.left(), r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): clock_pic = self.getPixmapForEntry(service, eventId, beginTime, duration) clock_pic_partnerbox = None # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and (isInRemoteTimer(self, beginTime, duration, service)) if rec2: clock_pic_partnerbox = getRemoteClockPixmap( self, service, beginTime, duration, eventId) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, _(strftime("%a", t))), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, strftime("%e/%m, %-H:%M", t)) ] if clock_pic or clock_pic_partnerbox: if clock_pic and clock_pic_partnerbox: # Partnerbox and local res.extend( ((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x + r3.w - 43, (r3.h / 2 - 11), 21, 21, clock_pic), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x + r3.w - 21, (r3.h / 2 - 11), 21, 21, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w - 44, r3.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) elif clock_pic_partnerbox: # Partnerbox and local res.extend( ((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x + r3.w - 21, (r3.h / 2 - 11), 21, 21, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w - 21, r3.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: res.extend( ((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x + r3.w - 21, (r3.h / 2 - 11), 21, 21, clock_pic), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w - 21, r3.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w, r3.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): self.wasEntryAutoTimer = None clock_pic = self.getPixmapForEntry(service, eventId, beginTime, duration) clock_pic_partnerbox = None # Partnerbox if PartnerBoxIconsEnabled: rec2=beginTime and (isInRemoteTimer(self,beginTime, duration, service)) if rec2: clock_pic_partnerbox = getRemoteClockPixmap(self,service, beginTime, duration, eventId) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, _(strftime("%a", t))), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r1.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, strftime("%e/%m, %-H:%M", t)) ] if self.screenwidth and self.screenwidth == 1920: picx = 25 picy = 25 posy = 13 else: picx = 21 picy = 21 posy = 11 if clock_pic or clock_pic_partnerbox: if clock_pic and clock_pic_partnerbox and self.wasEntryAutoTimer: res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx*3, (r3.h/2-posy), picx, picy, self.autotimericon), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx*2, (r3.h/2-posy), picx, picy, self.clocks[clock_pic]), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx, (r3.h/2-posy), picx, picy, self.clocks[clock_pic_partnerbox]), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w-picx*3, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) elif clock_pic and clock_pic_partnerbox: # Partnerbox and local res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx*2, (r3.h/2-posy), picx, picy, self.clocks[clock_pic]), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx, (r3.h/2-posy), picx, picy, self.clocks[clock_pic_partnerbox]), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w-picx*2, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) elif clock_pic_partnerbox: # Partnerbox and local res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx, (r3.h/2-posy), picx, picy, self.clocks[clock_pic_partnerbox]), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w-picx, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) elif self.wasEntryAutoTimer: res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx*2, (r3.h/2-posy), picx, picy, self.autotimericon), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx, (r3.h/2-posy), picx, picy, self.clocks[clock_pic]), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w-picx*2, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-picx, (r3.h/2-posy), picx, picy, self.clocks[clock_pic]), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w-picx, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): rec1 = beginTime and self.timer.isInTimer(eventId, beginTime, duration, service) # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and isInRemoteTimer(self,beginTime, duration, service) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename serviceName = serviceref.getServiceName() + ": " #delete serviceName if set it in setup and it is most matched service if config.plugins.epgsearch.show_sname_in_title.value and service == self.mostSearchService: serviceName = "" res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, self.days[t[6]]), (eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r1.height(), 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4])) ] #add picon if set this option in setup picon = None if config.plugins.epgsearch.show_picon.value: picon = self.piconLoader.getPicon(service) left_pos = r3.left() if picon is not None: res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, left_pos, 2, self._picon_width, r3.height()-3, picon)) left_pos = r3.left() + self._picon_width + self._itemMargin serviceName = "" #if load picon delete servicename if rec1 or rec2: if rec1: clock_pic = self.getClockPixmap(service, beginTime, duration, eventId) # maybe Partnerbox too if rec2: clock_pic_partnerbox = getRemoteClockPixmap(self,service, beginTime, duration, eventId) else: clock_pic = getRemoteClockPixmap(self,service, beginTime, duration, eventId) if rec1 and rec2: # Partnerbox and local res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos + self._iconWidth + self._itemMargin, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, left_pos + self._iconWidth*2 + self._itemMargin*2, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceName + EventName))) else: res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic), (eListboxPythonMultiContent.TYPE_TEXT, left_pos + self._iconWidth + self._itemMargin, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceName + EventName))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, left_pos, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceName + EventName)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): rec1 = beginTime and self.timer.isInTimer(eventId, beginTime, duration, service) # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and isInRemoteTimer(self,beginTime, duration, service) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, self.days[t[6]]), (eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r1.height(), 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4])) ] if rec1 or rec2: if rec1: clock_types = self.getClockTypesForEntry(service, eventId, beginTime, duration) # maybe Partnerbox too if rec2: clock_pic_partnerbox = getRemoteClockPixmap(self,service, beginTime, duration, eventId) else: clock_pic = getRemoteClockPixmap(self,service, beginTime, duration, eventId) if rec1 and rec2: # Partnerbox and local for i in range(len(clock_types)): res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), r3.top(), 21, 21, self.clocks[clock_types[i]])) res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + 25, r3.top()+4, 21, 21, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, r3.left() + 50, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: if rec1: for i in range(len(clock_types)): res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), r3.top(), 21, 21, self.clocks[clock_types[i]])) else: res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), r3.top()+4, 21, 21, clock_pic)) res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left() + 25, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName)) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left(), r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): clock_pic = self.getPixmapForEntry(service, eventId, beginTime, duration) clock_pic_partnerbox = None # Partnerbox if PartnerBoxIconsEnabled: rec2=beginTime and (isInRemoteTimer(self,beginTime, duration, service)) if rec2: clock_pic_partnerbox = getRemoteClockPixmap(self,service, beginTime, duration, eventId) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, _(strftime("%a", t))), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r1.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, strftime("%e/%m, %-H:%M", t)) ] if clock_pic or clock_pic_partnerbox: if clock_pic and clock_pic_partnerbox: # Partnerbox and local res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-43, (r3.h/2-11), 21, 21, clock_pic), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-21, (r3.h/2-11), 21, 21, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w-44, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) elif clock_pic_partnerbox: # Partnerbox and local res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-21, (r3.h/2-11), 21, 21, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w-21, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, r3.x+r3.w-21, (r3.h/2-11), 21, 21, clock_pic), (eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w-21, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w, r3.h, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): lsw = self.l.getItemSize().width() if self.listSizeWidth != lsw: # recalc size if scrollbar is shown self.recalcEntrySize() r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.orbpos_rect r4 = self.descr_rect if eventId < 0: res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r4.x + r4.w - r1.x, r1.h, 0, RT_HALIGN_CENTER | RT_VALIGN_CENTER, EventName) ] return res # Pics in right-to-left order pics = [] # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and (isInRemoteTimer(self, beginTime, duration, service)) if rec2: clock_pic_partnerbox = getRemoteClockPixmap( self, service, beginTime, duration, eventId) if clock_pic_partnerbox: pics.append(self.clocks[clock_pic_partnerbox]) clock_pic = self.getPixmapForEntry(service, eventId, beginTime, duration) if clock_pic: pics.append(self.clocks[clock_pic]) if getattr(self, "wasEntryAutoTimer", False) and hasattr( self, "autotimericon"): pics.append(self.autotimericon) # Timer icons for timers set by IceTV (icetv.com.au) if getattr(self, "wasEntryIceTV", False) and hasattr( self, "icetvicon"): pics.append(self.icetvicon) t = localtime(beginTime) serviceref = ServiceReference( service) # for Servicename and orbital position width = r4.x + r4.w if hasattr(self, "showend"): et = localtime(beginTime + duration) if hasattr(config.usage, "time"): split = int(r2.w * 0.55) res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, strftime(config.usage.date.dayshort.value, t)), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, split, r2.h, 0, RT_HALIGN_RIGHT | RT_VALIGN_CENTER, strftime(config.usage.time.short.value + " -", t)), (eListboxPythonMultiContent.TYPE_TEXT, r2.x + split, r2.y, r2.w - split, r2.h, 0, RT_HALIGN_RIGHT | RT_VALIGN_CENTER, strftime(config.usage.time.short.value, et)) ] else: res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, strftime("%a %d %b", t)), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r2.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, "%s ~ %s" % (strftime("%H:%M", t), strftime("%H:%M", et))) ] else: if hasattr(config.usage, "time"): datetime = "%s, %s" % (strftime( config.usage.date.short.value, t), strftime(config.usage.time.short.value, t)) else: datetime = strftime(_("%e/%m, %H:%M"), t) res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, strftime("%a", t)), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r2.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, datetime) ] if r3.w: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w, r3.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, self.getOrbitalPos(serviceref))) picwidth = 0 for pic in pics: if picwidth: picwidth += (self.picx + self.gap) else: picwidth = self.picx + self.posx res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, width - picwidth, (r4.h / 2 - self.posy), self.picx, self.picy, pic)) if picwidth: picwidth += (self.gap * 2) res.append( (eListboxPythonMultiContent.TYPE_TEXT, r4.x, r4.y, r4.w - picwidth, r4.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): rec1 = self.getClockTypesForEntry(service, eventId, beginTime, duration) # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and isInRemoteTimer(self, beginTime, duration, service) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect dx = self.piconSize[0] + self.piconDistance nowTime = int(time()) remaining = "" if beginTime is not None: if nowTime < beginTime: remaining = _(" (%d min)") % (duration / 60) else: prefix = "+" total = ((beginTime+duration) - nowTime) / 60 if total <= 0: prefix = "" remaining = _(" (%s%d min)") % (prefix, total) t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename if config.plugins.epgsearch.picons.value: if getPiconsName: picon = getPiconName(service) else: picon = self.findPicon(service) if picon != "": self.picon.setPara((self.piconSize[0], self.piconSize[1], 1, 1, False, 1, '#000f0f0f')) self.picon.startDecode(picon, 0, 0, False) png = self.picon.getData() dy = int((self.height - self.piconSize[1])/2.) res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r1.left(), r1.top()+ dy, self.piconSize[0], self.piconSize[1], png), (eListboxPythonMultiContent.TYPE_TEXT, r1.left() + dx, r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT, self.days[t[6]]), (eListboxPythonMultiContent.TYPE_TEXT, r2.left() + dx, r2.top(), r2.width(), r1.height(), 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4])) ] else: res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.left() + dx, r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT, self.days[t[6]]), (eListboxPythonMultiContent.TYPE_TEXT, r2.left() + dx, r2.top(), r2.width(), r1.height(), 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4])) ] else: res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT, self.days[t[6]]), (eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r1.height(), 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4])) ] if config.plugins.epgsearch.picons.value: if rec1 or rec2: if rec1: clock_types = rec1 # maybe Partnerbox too if rec2: if PartnerBoxZapRepIcons: clock_pic_partnerbox = getRemoteClockZapPixmap(self, service, beginTime, duration, eventId) else: clock_pic_partnerbox = getRemoteClockPixmap(self, service, beginTime, duration, eventId) else: if PartnerBoxZapRepIcons: clock_pic = getRemoteClockZapPixmap(self, service, beginTime, duration, eventId) else: clock_pic = getRemoteClockPixmap(self, service, beginTime, duration, eventId) if rec1 and rec2: # Partnerbox and local for i in range(len(clock_types)): res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + i * self.space + dx, r3.top() + self.dy, self.iconSize, self.iconSize, self.clocks[clock_types[i]])) res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + (i + 1) * self.space + dx, r3.top() + self.dy, self.iconSize, self.iconSize, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, r3.left() + (i + 1) * self.space + self.pboxDistance + self.nextIcon, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName + remaining))) else: if rec1: for i in range(len(clock_types)): res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + i * self.space + dx, r3.top() + self.dy, self.iconSize, self.iconSize, self.clocks[clock_types[i]])) res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left() + (i + 1) * self.space + dx + self.nextIcon, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName + remaining)) else: res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + dx, r3.top() + self.dy, self.iconSize, self.iconSize, clock_pic), (eListboxPythonMultiContent.TYPE_TEXT, r3.left() + self.pboxDistance + self.nextIcon, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName + remaining))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left() + dx, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName + remaining)) else: if rec1 or rec2: if rec1: clock_types = rec1 # maybe Partnerbox too if rec2: if PartnerBoxZapRepIcons: clock_pic_partnerbox = getRemoteClockZapPixmap(self, service, beginTime, duration, eventId) else: clock_pic_partnerbox = getRemoteClockPixmap(self, service, beginTime, duration, eventId) else: if PartnerBoxZapRepIcons: clock_pic = getRemoteClockZapPixmap(self, service, beginTime, duration, eventId) else: clock_pic = getRemoteClockPixmap(self, service, beginTime, duration, eventId) if rec1 and rec2: # Partnerbox and local for i in range(len(clock_types)): res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + i * self.space, r3.top() + self.dy, self.iconSize, self.iconSize, self.clocks[clock_types[i]])) res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + (i + 1) * self.space, r3.top() + self.dy, self.iconSize, self.iconSize, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, r3.left() + (i + 1) * self.space + self.nextIcon, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName + remaining))) else: if rec1: for i in range(len(clock_types)): res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + i * self.iconSize, r3.top() + self.dy, self.iconSize, self.iconSize, self.clocks[clock_types[i]])) res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left() + (i + 1) * self.space + self.nextIcon, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName + remaining)) else: res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), r3.top() + self.dy, self.iconSize, self.iconSize, clock_pic), (eListboxPythonMultiContent.TYPE_TEXT, r3.left() + self.space + self.nextIcon, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName + remaining))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left(), r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName + remaining)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): lsw = self.l.getItemSize().width() if self.listSizeWidth != lsw: # recalc size if scrollbar is shown self.recalcEntrySize() r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.orbpos_rect r4 = self.descr_rect if eventId < 0: res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r4.x + r4.w - r1.x, r1.h, 0, RT_HALIGN_CENTER | RT_VALIGN_CENTER, EventName) ] return res # Pics in right-to-left order pics = [] # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and (isInRemoteTimer(self, beginTime, duration, service)) if rec2: clock_pic_partnerbox = getRemoteClockPixmap(self, service, beginTime, duration, eventId) if clock_pic_partnerbox: pics.append(self.clocks[clock_pic_partnerbox]) clock_pic = self.getPixmapForEntry(service, eventId, beginTime, duration) if clock_pic: pics.append(self.clocks[clock_pic]) if getattr(self, "wasEntryAutoTimer", False) and hasattr(self, "autotimericon"): pics.append(self.autotimericon) # Timer icons for timers set by IceTV (icetv.com.au) if getattr(self, "wasEntryIceTV", False) and hasattr(self, "icetvicon"): pics.append(self.icetvicon) t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename and orbital position width = r4.x + r4.w if hasattr(self, "showend"): et = localtime(beginTime + duration) if hasattr(config.usage, "time"): split = int(r2.w * 0.55) res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, strftime(config.usage.date.dayshort.value, t)), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, split, r2.h, 0, RT_HALIGN_RIGHT | RT_VALIGN_CENTER, strftime(config.usage.time.short.value + " -", t)), (eListboxPythonMultiContent.TYPE_TEXT, r2.x + split, r2.y, r2.w - split, r2.h, 0, RT_HALIGN_RIGHT | RT_VALIGN_CENTER, strftime(config.usage.time.short.value, et)) ] else: res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, strftime("%a %d %b", t)), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r2.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, "%s ~ %s" % (strftime("%H:%M", t), strftime("%H:%M", et))) ] else: if hasattr(config.usage, "time"): datetime = "%s, %s" % (strftime(config.usage.date.short.value, t), strftime(config.usage.time.short.value, t)) else: datetime = strftime(_("%e/%m, %H:%M"), t) res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, strftime("%a", t)), (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r2.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, datetime) ] if r3.w: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.x, r3.y, r3.w, r3.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, self.getOrbitalPos(serviceref))) picwidth = 0 for pic in pics: if picwidth: picwidth += (self.picx + self.gap) else: picwidth = self.picx + self.posx res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, width - picwidth, (r4.h / 2 - self.posy), self.picx, self.picy, pic)) if picwidth: picwidth += (self.gap*2) res.append((eListboxPythonMultiContent.TYPE_TEXT, r4.x, r4.y, r4.w - picwidth, r4.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName)) return res
def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): rec1 = beginTime and self.timer.isInTimer(eventId, beginTime, duration, service) # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and isInRemoteTimer(self, beginTime, duration, service) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename res = [ None, # no private data needed ( eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, _(strftime("%a", t)), ), ( eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r1.h, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, strftime("%e/%m, %-H:%M", t), ), ] if rec1 or rec2: if rec1: clock_pic = self.getClockPixmap(service, beginTime, duration, eventId) # maybe Partnerbox too if rec2: clock_pic_partnerbox = getRemoteClockPixmap(self, service, beginTime, duration, eventId) else: clock_pic = getRemoteClockPixmap(self, service, beginTime, duration, eventId) if rec1 and rec2: # Partnerbox and local res.extend( ( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), r3.top(), 21, 21, clock_pic), ( eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left() + 25, r3.top(), 21, 21, clock_pic_partnerbox, ), ( eListboxPythonMultiContent.TYPE_TEXT, r3.left() + 50, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName, ), ) ) else: res.extend( ( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), r3.top(), 21, 21, clock_pic), ( eListboxPythonMultiContent.TYPE_TEXT, r3.left() + 25, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName, ), ) ) else: res.append( ( eListboxPythonMultiContent.TYPE_TEXT, r3.left(), r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceref.getServiceName() + ": " + EventName, ) ) return res