def readTimer(self, showTitle=True):
		current_time = int(time.time())
		deltimer = 0
		timerList = []

		timers = self.database.getAllTimer(current_time if self.filter else None)
		for timer in timers:
			(serie, staffel, episode, title, start_time, stbRef, webChannel, eit, activeTimer) = timer
			if int(start_time) < int(current_time):
				deltimer += 1
				timerList.append((serie, staffel, episode, title, start_time, webChannel, "1", 0, bool(activeTimer)))
			else:
				timerList.append((serie, staffel, episode, title, start_time, webChannel, "0", eit, bool(activeTimer)))

		if showTitle:
			self['title'].instance.setForegroundColor(parseColor("foreground"))
			if self.filter:
				self['title'].setText("Timer-Liste: %s ausstehende Timer" % len(timerList))
			else:
				self['title'].setText("Timer-Liste: %s abgeschlossene und %s ausstehende Timer" % (deltimer, len(timerList ) -deltimer))

		if config.plugins.serienRec.recordListView.value == 0:
			timerList.sort(key=lambda t : t[4])
		elif config.plugins.serienRec.recordListView.value == 1:
			timerList.sort(key=lambda t : t[4])
			timerList.reverse()

		self.chooseMenuList.setList(map(self.buildList, timerList))
		if len(timerList) == 0:
			if showTitle:
				self['title'].instance.setForegroundColor(parseColor("foreground"))
				self['title'].setText("Serien Timer - 0 Serien in der Aufnahmeliste.")

		self.getCover()
Ejemplo n.º 2
0
	def __init__(self):
		Renderer.__init__(self)
		self.backgroundColor = parseColor("transparent")
		self.nocColor = parseColor("#00aaaaaa")
		self.emmColor = parseColor("#00aaaaaa")
		self.ecmColor = parseColor("#0056c856")
		self.font = gFont("Pro_Display", 17)
Ejemplo n.º 3
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, value) in self.skinAttributes:
			if attrib == "NumberOfItems":
				self.numberOfItems = int(value)
				attribs.append((attrib, value))
			if attrib == "noLabel":
				self.hideLabel = int(value)
				attribs.append((attrib, value))
			if attrib == "numOfSpaces":
				self.numOfSpaces = int(value)
				attribs.append((attrib, value))
			if attrib == "timeColor":
				self.timecolor = self.hex2strColor(parseColor(value).argb())
				attribs.append((attrib, value))
			if attrib == "labelColor":
				self.labelcolor = self.hex2strColor(parseColor(value).argb())
				attribs.append((attrib, value))
			if attrib == "foregroundColor":
				self.foregroundColor = self.hex2strColor(parseColor(value).argb())
				attribs.append((attrib, value))
		for (attrib, value) in attribs:
			self.skinAttributes.remove((attrib, value))
		self.timecolor = self.formatColorString(self.timecolor)
		self.labelcolor  = self.formatColorString(self.labelcolor)
		self.foregroundColor  = self.formatColorString(self.foregroundColor)
		return Renderer.applySkin(self, desktop, parent)
Ejemplo n.º 4
0
 def setPreviewFont(self, myIndex):
     if not 'font' in self.root[self.currentScreenID][myIndex].attrib:
         self["PreviewFont"].setText('')
         return
     #### Now we know we have font, so we can preview it :)
     myfont = self.root[self.currentScreenID][myIndex].attrib['font']
     #print myfont
     try:
         self["PreviewFont"].instance.setFont(gFont(myfont.split(';')[0], int(myfont.split(';')[1])))
     except:
         printDEBUG("Missing font '%s' definition in skin.xml" % self.root[self.currentScreenID][myIndex].attrib['font'])
     if 'text' in self.root[self.currentScreenID][myIndex].attrib:
         self["PreviewFont"].setText('%s' % self.root[self.currentScreenID][myIndex].attrib['text'])
     else:
         self["PreviewFont"].setText(_('Sample Text'))
     if 'foregroundColor' in self.root[self.currentScreenID][myIndex].attrib:
         try:
             self["PreviewFont"].instance.setForegroundColor(parseColor(self.root[self.currentScreenID][myIndex].attrib['foregroundColor']))            
         except:
             printDEBUG("Missing color '%s' definition in skin.xml" % self.root[self.currentScreenID][myIndex].attrib['foregroundColor'])
     else:
         self["PreviewFont"].instance.setForegroundColor(parseColor("#00ffffff"))            
     if 'backgroundColor' in self.root[self.currentScreenID][myIndex].attrib:
         try:
             self["PreviewFont"].instance.setBackgroundColor(parseColor(self.root[self.currentScreenID][myIndex].attrib['backgroundColor']))            
         except:
             printDEBUG("Missing color '%s' definition in skin.xml" % self.root[self.currentScreenID][myIndex].attrib['backgroundColor'])
Ejemplo n.º 5
0
	def applySkin(self, desktop, screen):
		if self.skinAttributes is not None:
			foregroundColor = None
			backgroundColor = None
			attribs = [ ]
			for (attrib, value) in self.skinAttributes:
				if attrib == "foregroundColors":
					colors = value.split(',')
					for color in colors:
						self.foreColors.append(parseColor(color))
					if not foregroundColor:
						foregroundColor = colors[0]
				elif attrib == "backgroundColors":
					colors = value.split(',')
					for color in colors:
						self.backColors.append(parseColor(color))
					if not backgroundColor:
						backgroundColor = colors[0]
				elif attrib == "backgroundColor":
					backgroundColor = value
				elif attrib == "foregroundColor":
					foregroundColor = value
				else:
					attribs.append((attrib,value))
			if foregroundColor:
				attribs.append(("foregroundColor",foregroundColor))
			if backgroundColor:
				attribs.append(("backgroundColor",backgroundColor))
			self.skinAttributes = attribs
		return GUIComponent.applySkin(self, desktop, screen)
	def applySkin(self, desktop, parent):
		attribs = []
		if self.skinAttributes is not None:
			for (attrib, value) in self.skinAttributes:
				if attrib == "posFont":
					self.posFont = parseFont(value, ((1,1),(1,1)))
					self.l.setFont(0, self.posFont)
				elif attrib == "nameFont":
					self.nameFont = parseFont(value, ((1,1),(1,1)))
					self.l.setFont(1, self.nameFont)
				elif attrib == "posWidth":
					self.posWidth = int(value)
				elif attrib == "nameWidth":
					self.nameWidth = int(value)
				elif attrib == "posColor":
					self.posColor = parseColor(value).argb()
				elif attrib == "posColorSel":
					self.posColorSel = parseColor(value).argb()
				elif attrib == "nameColor":
					self.nameColor = parseColor(value).argb()
				elif attrib == "nameColorSel":
					self.nameColorSel = parseColor(value).argb()
				elif attrib == "itemHeight":
					self.itemHeight = int(value)
				else:
					attribs.append((attrib, value))
		self.readPlaylist()
		self.refreshList()
		self.setItemHeight()
		self.skinAttributes = attribs
		return GUIComponent.applySkin(self, desktop, parent)
Ejemplo n.º 7
0
 def __init__(self):
     Renderer.__init__(self)
     self.foregroundColor = parseColor('#ffffff')
     self.backgroundColor = parseColor('#171717')
     self.emmColor = parseColor('#f23d21')
     self.ecmColor = parseColor('#389416')
     self.font = gFont('Regular', 20)
Ejemplo n.º 8
0
 def go(self):
     if len(self.subtitle) == 0:
         printDEBUG("Subtitles not loaded, timer disabled.")
     else:
         printDEBUG("Enable loaded %d subtitles" % len(self.subtitle))
         self.enablesubtitle = True
         self.timer = eTimer()
         self.timer.callback.append(self.timerEvent)
         self.timer.start(200, False)
     printDEBUG("Playing: " + str(self.rootID) + ":0:0:0:0:0:0:0:0:0:" + self.openmovie)
     root = eServiceReference(self.rootID, 0, self.openmovie)
     root.setName (self.movieTitle)
     self.session.nav.playService(root)
     myConfig.PlayerOn.value = True
     self.stateplay = "Play"
     self["afpSubtitles"].instance.move(ePoint(0,self.fontpos))
     self["afpSubtitles"].instance.setForegroundColor(parseColor(self.fontcolor_list[self.fontcolor_nr]))
     self["afpSubtitles"].instance.setBackgroundColor(parseColor(self.backgroundcolor_list[self.fontbackground_nr]))
     self["afpSubtitles"].instance.setFont(gFont(self.fonttype_list[self.fonttype_nr], self.fontsize))
     self.SubtitleLineHeight = int(fontRenderClass.getInstance().getLineHeight(self["afpSubtitles"].instance.getFont()))
     if self.SubtitleLineHeight > self.fontsize:
         printDEBUG("SubtitleLineHeight calculated: %d" % self.SubtitleLineHeight)
     else:
         self.SubtitleLineHeight = int(self.fontsize * 1.1)
         printDEBUG("SubtitleLineHeight assumed: %d" % self.SubtitleLineHeight)
     self.ToggleInfobar()
	def keyOK(self):
		if self.modus == "list":
			if self.loading:
				return

			check = self['menu_list'].getCurrent()
			if check is None:
				return

			(serien_name, serien_id) = self.getSeriesNameID()
			if config.plugins.serienRec.activateNewOnThisSTBOnly.value:
				boxID = None
			else:
				boxID = config.plugins.serienRec.BoxID.value

			if self.database.addMarker(str(serien_id), serien_name, '', boxID, 0):
				SRLogger.writeLog("\nSerien Marker für ' %s ' wurde angelegt" % serien_name, True)
				self['title'].setText("Serie '- %s -' zum Serien Marker hinzugefügt." % serien_name)
				self['title'].instance.setForegroundColor(parseColor("green"))
				if config.plugins.serienRec.tvplaner_full_check.value:
					config.plugins.serienRec.tvplaner_last_full_check.value = int(0)
					config.plugins.serienRec.tvplaner_last_full_check.save()
					SerienRecorder.configfile.save()
				if config.plugins.serienRec.openMarkerScreen.value:
					from SerienRecorderMarkerScreen import serienRecMarker
					self.session.open(serienRecMarker, serien_name)
			else:
				self['title'].setText("Serie '- %s -' existiert bereits im Serien Marker." % serien_name)
				self['title'].instance.setForegroundColor(parseColor("red"))
Ejemplo n.º 10
0
	def __init__(self):
		Renderer.__init__(self)
		self.backgroundColor = parseColor("#ff000000")
		self.nocColor = parseColor("#008f8f8f")
		self.emmColor = parseColor("#00bab329")
		self.ecmColor = parseColor("#00009a00")
		self.font = gFont("Regular", 20)
Ejemplo n.º 11
0
	def __init__(self):
		Renderer.__init__(self)
		self.backgroundColor = parseColor("#ff000000")
		self.nocColor = parseColor("#00aaaaaa")
		self.emmColor = parseColor("#00aaaaaa")
		self.ecmColor = parseColor("#0056c856")
		self.font = gFont("Regular", 20)
Ejemplo n.º 12
0
	def applySkin(self, desktop, parent):

		attribs = [ ]
		from enigma import eSize

		def parseSize(str):
			x, y = str.split(',')
			return eSize(int(x), int(y))

		for (attrib, value) in self.skinAttributes:
			if attrib == "size":
				self.instance.setSize(parseSize(value))
				attribs.append((attrib,value))
			elif attrib == "nocColor":
			        self.nocColor = parseColor(value)
			elif attrib == "emmColor":
				self.emmColor = parseColor(value)
			elif attrib == "ecmColor":
				self.ecmColor = parseColor(value)
			elif attrib == "font":
				self.font = parseFont(value, ((1,1),(1,1)))
			elif attrib == "backgroundColor":
				self.backgroundColor = parseColor(value)
				self.instance.clear(self.backgroundColor)
				attribs.append((attrib,value))
			else:
				attribs.append((attrib,value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Ejemplo n.º 13
0
	def applySkin(self, desktop, parent):
		attribs = [ ]
		if self.skinAttributes is not None:
			attribs = [ ]
			for (attrib, value) in self.skinAttributes:
				if attrib == "foregroundColorMarked":
					self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value))
				elif attrib == "foregroundColorMarkedSelected":
					self.l.setColor(eListboxServiceContent.markedForegroundSelected, parseColor(value))
				elif attrib == "backgroundColorMarked":
					self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value))
				elif attrib == "backgroundColorMarkedSelected":
					self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value))
				elif attrib == "foregroundColorServiceNotAvail":
					self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value))
				elif attrib == "serviceItemHeight":
					self.ItemHeight = int(value)
				elif attrib == "serviceNameFont":
					self.ServiceNameFont = parseFont(value, ((1,1),(1,1)))
				elif attrib == "serviceInfoFont":
					self.ServiceInfoFont = parseFont(value, ((1,1),(1,1)))
				elif attrib == "serviceNumberFont":
					self.ServiceNumberFont = parseFont(value, ((1,1),(1,1)))
				else:
					attribs.append((attrib, value))
		self.skinAttributes = attribs
		return GUIComponent.applySkin(self, desktop, parent)
Ejemplo n.º 14
0
 def __init__(self):
     Renderer.__init__(self)
     self.backgroundColor = parseColor('#ff000000')
     self.emmColor = parseColor('#00aaaaaa')
     self.clGrey = parseColor('#00aaaaaa')
     self.ecmColor = parseColor('#0056c856')
     self.font = gFont('Regular', 20)
	def buildList(self, entry):
		(Serie, Staffel, Sender, UTCTime, ID, MarkerFlag) = entry

		icon = imageNone = "%simages/black.png" % SerienRecorder.serienRecMainPath
		imageNeu = "%simages/neu.png" % SerienRecorder.serienRecMainPath

		if MarkerFlag == 1:
			setFarbe = parseColor('green').argb()
		elif MarkerFlag == 2:
			setFarbe = parseColor('red').argb()
		else:
			setFarbe = parseColor('foreground').argb()

		if str(Staffel).isdigit() and int(Staffel) == 1:
			icon = imageNeu

		foregroundColor = parseColor('foreground').argb()

		Staffel = "Staffel %s" % str(Staffel)
		WochenTag = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"]
		xtime = time.strftime(WochenTag[time.localtime(int(UTCTime)).tm_wday]+ ", %d.%m.%Y", time.localtime(int(UTCTime)))

		if config.plugins.serienRec.showPicons.value != "0":
			picon = loadPNG(imageNone)
			if Sender and self.serviceRefs.get(Sender):
				# Get picon by reference or by name
				piconPath = self.piconLoader.getPicon(self.serviceRefs.get(Sender)[0] if config.plugins.serienRec.showPicons.value == "1" else self.serviceRefs.get(Sender)[1])
				if piconPath:
					self.picloader = PicLoader(80 * skinFactor, 40 * skinFactor)
					picon = self.picloader.load(piconPath)
					self.picloader.destroy()

			return [entry,
					(eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 10, 5, 80 * skinFactor, 40 * skinFactor, picon),
					(eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 340 * skinFactor, 15 * skinFactor, 30
					 * skinFactor, 30 * skinFactor, loadPNG(icon)),
					(eListboxPythonMultiContent.TYPE_TEXT, 110 * skinFactor, 3, 200 * skinFactor, 26 * skinFactor, 0,
					 RT_HALIGN_LEFT | RT_VALIGN_CENTER, Sender, foregroundColor, foregroundColor),
					(eListboxPythonMultiContent.TYPE_TEXT, 110 * skinFactor, 29 * skinFactor, 200 * skinFactor, 18
					 * skinFactor, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, xtime),
					(eListboxPythonMultiContent.TYPE_TEXT, 375 * skinFactor, 3, 500 * skinFactor, 26 * skinFactor, 0,
					 RT_HALIGN_LEFT | RT_VALIGN_CENTER, Serie, setFarbe, setFarbe),
					(eListboxPythonMultiContent.TYPE_TEXT, 375 * skinFactor, 29 * skinFactor, 500 * skinFactor, 18
					 * skinFactor, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, Staffel)
					]
		else:
			return [entry,
					(eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 15, 15 * skinFactor, 30 * skinFactor, 30
					 * skinFactor, loadPNG(icon)),
					(eListboxPythonMultiContent.TYPE_TEXT, 50 * skinFactor, 3, 200 * skinFactor, 26 * skinFactor, 0,
					 RT_HALIGN_LEFT | RT_VALIGN_CENTER, Sender, foregroundColor, foregroundColor),
					(eListboxPythonMultiContent.TYPE_TEXT, 50 * skinFactor, 29 * skinFactor, 200 * skinFactor, 18
					 * skinFactor, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, xtime),
					(eListboxPythonMultiContent.TYPE_TEXT, 300 * skinFactor, 3, 500 * skinFactor, 26 * skinFactor, 0,
					 RT_HALIGN_LEFT | RT_VALIGN_CENTER, Serie, setFarbe, setFarbe),
					(eListboxPythonMultiContent.TYPE_TEXT, 300 * skinFactor, 29 * skinFactor, 500 * skinFactor, 18
					 * skinFactor, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, Staffel)
					]
Ejemplo n.º 16
0
	def applySkin(self, desktop, screen):
		if self.skinAttributes is not None:
			attribs = [ ]
			for (attrib, value) in self.skinAttributes:
				if attrib == "EntryForegroundColor":
					self.foreColor = parseColor(value)
				elif attrib == "EntryForegroundColorSelected":
					self.foreColorSelected = parseColor(value)
				elif attrib == "EntryActiveBackgroundColor":
					self.backColorActive = parseColor(value)
				elif attrib == "EntryActiveBackgroundColorSelected":
					self.backColorActiveSelected = parseColor(value)
				elif attrib == "EntryBorderColor":
					self.borderColor = parseColor(value)
				elif attrib == "EntryBackgroundColor":
					self.backColor = parseColor(value)
				elif attrib == "EntryBackgroundColorSelected":
					self.backColorSelected = parseColor(value)
				elif attrib == "ServiceNameForegroundColor":
					self.foreColorService = parseColor(value)
				elif attrib == "ServiceNameBackgroundColor":
					self.backColorService = parseColor(value)
				elif attrib == "EntryFont":
					self.l.setFont(1, gFont(value.split(";")[0], int(value.split(";")[1])))
				elif attrib == "ServiceFont":
					self.l.setFont(0, gFont(value.split(";")[0], int(value.split(";")[1])))
				else:
					attribs.append((attrib,value))
			self.skinAttributes = attribs
		return GUIComponent.applySkin(self, desktop, screen)
Ejemplo n.º 17
0
	def setListSorted(self, newEntry = None):
		if not self.birthdaytimer.getSize():
			return
			
		if config.plugins.birthdayreminder.sortby.value == "1": # sort by name
			self["name"].instance.setForegroundColor(parseColor("yellow"))
			self["birthday"].instance.setForegroundColor(parseColor("white"))
			self["age"].instance.setForegroundColor(parseColor("white"))
			self.birthdaytimer.bDayList.sort(key = lambda t : tuple(t[0].lower()))
		elif config.plugins.birthdayreminder.sortby.value == "2": # sort by upcoming birthday
			self["name"].instance.setForegroundColor(parseColor("white"))
			self["birthday"].instance.setForegroundColor(parseColor("yellow"))
			self["age"].instance.setForegroundColor(parseColor("white"))
			self.birthdaytimer.bDayList.sort(key = itemgetter(1), cmp = self.compareDates)
		else: # sort by age
			self["name"].instance.setForegroundColor(parseColor("white"))
			self["birthday"].instance.setForegroundColor(parseColor("white"))
			self["age"].instance.setForegroundColor(parseColor("yellow"))
			self.birthdaytimer.bDayList.sort(key = itemgetter(1), cmp = self.compareAges)
			
		self["list"].setList(self.birthdaytimer.getBirthdayList())
		
		if newEntry:
			newIdx = self["list"].getIndexForEntry(newEntry)
			self["list"].setIndex(newIdx)
Ejemplo n.º 18
0
	def calendar(self):
		monthname = (
		_('January'),
		_('February'),
		_('March'),
		_('April'),
		_('May'),
		_('June'),
		_('July'),
		_('August'),
		_('September'),
		_('October'),
		_('November'),
		_('December'))

		i = 1
		ir = 0
		d1 = datetime.date(self.year, self.month, 1)
		d2 = d1.weekday()

		if self.month == 12:
			sdt1 = datetime.date(self.year + 1, 1, 1) - datetime.timedelta(1)
		else:
			sdt1 = datetime.date(self.year, self.month + 1, 1) - datetime.timedelta(1)
		self.monthday = int(sdt1.day)
		self.monthname = monthname[self.month - 1]
		self["monthname"].setText(str(self.year)+' '+str(self.monthname))

		for x in range(42):
			self['d' + str(x)].setText('')
			self['d' + str(x)].instance.clearForegroundColor()
			self['d' + str(x)].instance.clearBackgroundColor()
			if (x + 7) % 7 == 0:
				ir += 1
				self['wn' + str(ir)].setText('')
			if x >= d2 and i <= self.monthday:
				r = datetime.datetime(self.year, self.month, i)
				wn1 = r.isocalendar()[1]
				self['wn' + str(ir - 1)].setText('%0.2d' % wn1)
				self['d' + str(x)].setText(str(i))
				self['d' + str(x)].instance.setForegroundColor(parseColor('white'))
				if datetime.date(self.year, self.month, i) == datetime.date.today():
					self['d' + str(x)].instance.setBackgroundColor(parseColor('green'))
				if datetime.date(self.year, self.month, i).weekday() == 5:
					self['d' + str(x)].instance.setForegroundColor(parseColor('yellow'))
				if datetime.date(self.year, self.month, i).weekday() == 6:
					self['d' + str(x)].instance.setForegroundColor(parseColor('red'))
				i = i + 1

		self.date()
		self.datepeople()
		self.monthpeople()
		self.sign()
		self.holiday()
		self.description()
Ejemplo n.º 19
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, what) in self.skinAttributes:
			if (attrib == 'foregroundColor'):
				self.fColor = parseColor(what)
			elif (attrib == 'backgroundColor'):
				self.bColor = parseColor(what)
			else:
				attribs.append((attrib, what))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Ejemplo n.º 20
0
	def setHorMenuElements(self, depth):
		self.depth = depth

		self.setRangeList()

		highlighted = parseColor("#e17e76")
		normal = parseColor("#ffffff")

		for i in self.rangeList:
			self[str(i)] = MultiColorLabel()
			self[str(i)].foreColors = [highlighted, normal]
			self[str(i)].show()
Ejemplo n.º 21
0
 def applySkin(self, desktop, parent):
     attribs = []
     for None in self.skinAttributes:
         (attrib, what) = None
         if attrib == 'foregroundColor':
             self.fColor = parseColor(what)
             continue
         if attrib == 'backgroundColor':
             self.bColor = parseColor(what)
             continue
         attribs.append((attrib, what))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
Ejemplo n.º 22
0
	def setMultiLevelElements(self, levels):
		printl("", self, "S")
		self.levels = levels

		highlighted = parseColor(getSkinHighlightedColor())
		normal = parseColor(getSkinNormalColor())

		for i in range(1,int(levels)+1):
			self["L"+str(i)] = MultiColorLabel()
			self["L"+str(i)].foreColors = [highlighted, normal]
			self["L"+str(i)].setText(str(i))

		printl("", self, "C")
Ejemplo n.º 23
0
	def applySkin(self, desktop, screen):
		if self.skinAttributes:
			attribs = [ ]
			for (attrib, value) in self.skinAttributes:
				if attrib == "backgroundColors":
					for color in value.split(','):
						self.backColors.append(parseColor(color))
				elif attrib == "foregroundColors":
					for color in value.split(','):
						self.foreColors.append(parseColor(color))
				else:
					attribs.append((attrib,value))
			self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, screen)
Ejemplo n.º 24
0
 def updateSubtitle(self, sub, active):
     if sub is None:
         self['subtitle'].setText("")
         return
     st = sub['start'] * self.engine.fpsRatio / 90000
     et = sub['end'] * self.engine.fpsRatio / 90000
     stStr = "%d:%02d:%02d" % ((st / 3600, st % 3600 / 60, st % 60))
     etStr = "%d:%02d:%02d" % ((et / 3600, et % 3600 / 60, et % 60))
     if active:
         self['subtitle'].instance.setForegroundColor(parseColor("#F7A900"))
         self['subtitle'].setText("%s ----> %s" % (stStr, etStr))
     else:
         self['subtitle'].instance.setForegroundColor(parseColor("#aaaaaa"))
         self['subtitle'].setText("%s ----> %s" % (stStr, etStr))
Ejemplo n.º 25
0
	def previewSkin(self):
		self.bgtext = "..."
		self.fgtext = "Skin CyberLCD"
		self.fglogo = "CyberLCD"
		self.bgColor1 = "#0%s" % config.skin.cyberlcd.colorbackground1.value
		self.bgColor4 = "#0%s" % config.skin.cyberlcd.colorbackground4.value

		self.fgColor1 = "#0%s" % config.skin.cyberlcd.colorforeground1.value
		self.fgColor2 = "#0%s" % config.skin.cyberlcd.colorforeground2.value
		self.fgColor3 = "#0%s" % config.skin.cyberlcd.colorforeground3.value
		self.fgColor4 = "#0%s" % config.skin.cyberlcd.colorforeground4.value

	# Background
		self["bgcolor1a"].setText(_(self.bgtext))
		self["bgcolor1a"].instance.setBackgroundColor(parseColor(self.bgColor1))
		self["bgcolor1a"].instance.setForegroundColor(parseColor(self.bgColor1))
	# Progress
		self["bgcolor4a"].setText(_(self.bgtext))
		self["bgcolor4a"].instance.setBackgroundColor(parseColor(self.bgColor4))
		self["bgcolor4a"].instance.setForegroundColor(parseColor(self.bgColor4))
	# Title
		self["fgcolor1a"].setText(_(self.fgtext))
		self["fgcolor1a"].instance.setForegroundColor(parseColor(self.fgColor1))
	# Font 1
		self["fgcolor2a"].setText(_(self.fgtext))
		self["fgcolor2a"].instance.setForegroundColor(parseColor(self.fgColor2))
	# Font 2
		self["fgcolor3a"].setText(_(self.fgtext))
		self["fgcolor3a"].instance.setForegroundColor(parseColor(self.fgColor3))
	# Indication
		self["fgcolor4a"].setText(_(self.fgtext))
		self["fgcolor4a"].instance.setForegroundColor(parseColor(self.fgColor4))
Ejemplo n.º 26
0
 def applySkin(self, desktop, parent):
     attribs = []
     if self.skinAttributes is not None:
         attribs = []
         for (attrib, value) in self.skinAttributes:
             if attrib == "foregroundColorMarked":
                 self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value))
             elif attrib == "foregroundColorMarkedSelected":
                 self.l.setColor(eListboxServiceContent.markedForegroundSelected, parseColor(value))
             elif attrib == "backgroundColorMarked":
                 self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value))
             elif attrib == "backgroundColorMarkedSelected":
                 self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value))
             elif attrib == "foregroundColorServiceNotAvail":
                 self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value))
             elif attrib == "foregroundColorEvent" or attrib == "colorServiceDescription":
                 self.l.setColor(eListboxServiceContent.eventForeground, parseColor(value))
             elif attrib == "foregroundColorEventSelected" or attrib == "colorServiceDescriptionSelected":
                 self.l.setColor(eListboxServiceContent.eventForegroundSelected, parseColor(value))
             elif attrib == "foregroundColorEventborder":
                 self.l.setColor(eListboxServiceContent.eventborderForeground, parseColor(value))
             elif attrib == "foregroundColorEventborderSelected":
                 self.l.setColor(eListboxServiceContent.eventborderForegroundSelected, parseColor(value))
             elif attrib == "colorEventProgressbar":
                 self.l.setColor(eListboxServiceContent.serviceEventProgressbarColor, parseColor(value))
             elif attrib == "colorEventProgressbarSelected":
                 self.l.setColor(eListboxServiceContent.serviceEventProgressbarColorSelected, parseColor(value))
             elif attrib == "colorEventProgressbarBorder":
                 self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value))
             elif attrib == "colorEventProgressbarBorderSelected":
                 self.l.setColor(
                     eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value)
                 )
             elif attrib == "picServiceEventProgressbar":
                 pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, value))
                 if pic:
                     self.l.setPixmap(self.l.picServiceEventProgressbar, pic)
             elif attrib == "serviceItemHeight":
                 self.ItemHeight = int(value)
             elif attrib == "serviceNameFont":
                 font = parseFont(value, ((1, 1), (1, 1)))
                 self.ServiceNameFontName = font.family
                 self.ServiceNameFontSize = font.pointSize
             elif attrib == "serviceInfoFont":
                 font = parseFont(value, ((1, 1), (1, 1)))
                 self.ServiceInfoFontName = font.family
                 self.ServiceInfoFontSize = font.pointSize
             elif attrib == "serviceNumberFont":
                 font = parseFont(value, ((1, 1), (1, 1)))
                 self.ServiceNumberFontName = font.family
                 self.ServiceNumberFontSize = font.pointSize
             else:
                 attribs.append((attrib, value))
         self.skinAttributes = attribs
         self.setServiceFontsize()
     rc = GUIComponent.applySkin(self, desktop, parent)
     self.listHeight = self.instance.size().height()
     self.listWidth = self.instance.size().width()
     self.setItemsPerPage()
     return rc
Ejemplo n.º 27
0
	def setHorMenuElements(self, depth):
		printl("", self, "S")
		self.depth = depth

		self.setRangeList()

		highlighted = parseColor(self.highlightedColor)
		normal = parseColor(self.normalColor)

		for i in self.rangeList:
			self[str(i)] = MultiColorLabel()
			self[str(i)].foreColors = [highlighted, normal]
			self[str(i)].show()

		printl("", self, "C")
Ejemplo n.º 28
0
	def applySkin(self, desktop, screen):
		if self.skinAttributes is not None:
			attribs = [ ]
			for (attrib, value) in self.skinAttributes:
				if   attrib == "foregroundColor":
					self.foreColor = parseColor(value).argb()
				elif attrib == "backgroundColor":
					self.backColor = parseColor(value).argb()
				elif attrib == "font":
					self.font = parseFont(value,  ((1, 1), (1, 1)) )
				else:
					attribs.append((attrib,value))
			self.skinAttributes = attribs
		self.l.setFont(0, self.font)
		return GUIComponent.applySkin(self, desktop, screen)
Ejemplo n.º 29
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, what,) in self.skinAttributes:
			if (attrib == 'hColor'):
				self.fColorh = parseColor(what)
			elif (attrib == 'mColor'):
				self.fColorm = parseColor(what)
			elif (attrib == 'sColor'):
				self.fColors = parseColor(what)
			elif (attrib == 'linewidth'):
				self.linewidth = int(what)
			else:
				attribs.append((attrib, what))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Ejemplo n.º 30
0
	def applySkin(self, desktop, parent):
		attribs = [ ] 
		if self.skinAttributes is not None:
			for (attrib, value) in self.skinAttributes:
				if attrib == "font":
					self.l.setFont(0, parseFont(value, ((1,1),(1,1))))
				elif attrib == "itemHeight":
					self.l.setItemHeight(int(value))
				elif attrib == "selectedColor":
					self.selectedColor = parseColor(value).argb()
				elif attrib == "hiddenColor":
					self.hiddenColor = int(parseColor(value))
				else:
					attribs.append((attrib, value))
		self.skinAttributes = attribs
		return MenuList.applySkin(self, desktop, parent)
    def processPlanerData(self, data, useCache=False):
        if not data or len(data) == 0:
            self['title'].setText("Fehler beim Abrufen der SerienPlaner-Daten")
            return
        if useCache:
            (headDate, self.daylist) = data
        else:
            self.daylist = [[]]
            headDate = [data["date"]]

            markers = self.database.getAllMarkerStatusForBoxID(
                config.plugins.serienRec.BoxID.value)
            timers = self.database.getTimer(self.page)

            for event in data["events"]:
                aufnahme = False
                serieAdded = 0
                start_h = event["time"][:+2]
                start_m = event["time"][+3:]
                start_time = TimeHelpers.getUnixTimeWithDayOffset(
                    start_h, start_m, self.page)

                serien_name = event["name"].encode("utf-8")
                serien_name_lower = serien_name.lower()
                serien_id = int(event["id"])
                sender = event["channel"]
                title = event["title"].encode("utf-8")
                staffel = event["season"]
                episode = event["episode"]
                self.ErrorMsg = "%s - S%sE%s - %s (%s)" % \
                (serien_name, str(staffel).zfill(2), str(episode).zfill(2), title, sender)

                serienTimers = [
                    timer for timer in timers if timer[0] == serien_name_lower
                ]
                serienTimersOnChannel = [
                    serienTimer for serienTimer in serienTimers
                    if serienTimer[2] == sender.lower()
                ]
                for serienTimerOnChannel in serienTimersOnChannel:
                    if (int(serienTimerOnChannel[1]) >=
                        (int(start_time) - 300)) and (int(
                            serienTimerOnChannel[1]) <
                                                      (int(start_time) + 300)):
                        aufnahme = True

                # 0 = no marker, 1 = active marker, 2 = deactive marker
                if serien_id in markers:
                    serieAdded = 1 if markers[serien_id] else 2

                staffel = str(staffel).zfill(2)
                episode = str(episode).zfill(2)

                ##############################
                #
                # CHECK
                #
                # ueberprueft anhand des Seriennamen, Season, Episode ob die serie bereits auf der HDD existiert
                #
                seasonEpisodeString = "S%sE%s" % (str(staffel).zfill(2),
                                                  str(episode).zfill(2))

                bereits_vorhanden = False
                if config.plugins.serienRec.sucheAufnahme.value:
                    (dirname,
                     dirname_serie) = getDirname(self.database, serien_name,
                                                 staffel)
                    if str(episode).isdigit():
                        if int(episode) == 0:
                            bereits_vorhanden = STBHelpers.countEpisodeOnHDD(
                                dirname, seasonEpisodeString, serien_name,
                                False, title) > 0 and True or False
                        else:
                            bereits_vorhanden = STBHelpers.countEpisodeOnHDD(
                                dirname, seasonEpisodeString, serien_name,
                                False) > 0 and True or False
                    else:
                        bereits_vorhanden = STBHelpers.countEpisodeOnHDD(
                            dirname, seasonEpisodeString, serien_name,
                            False) > 0 and True or False

                title = "%s - %s" % (seasonEpisodeString, title)
                regional = False
                paytv = False
                neu = event["new"]
                prime = False
                transmissionTime = event["time"]
                url = ''
                self.daylist[0].append(
                    (regional, paytv, neu, prime, transmissionTime, url,
                     serien_name, sender, staffel, episode, title, aufnahme,
                     serieAdded, bereits_vorhanden, serien_id))

            print "[SerienRecorder] Es wurden %s Serie(n) gefunden" % len(
                self.daylist[0])

            if headDate:
                d = headDate[0].split(',')
                d.reverse()
                key = d[0].strip()
                cache = serienRecSeriesPlanner.loadPlanerData(1)
                cache.update({key: (headDate, self.daylist)})
                if config.plugins.serienRec.planerCacheEnabled.value:
                    serienRecSeriesPlanner.writePlanerData(1, cache)

        self.loading = False

        if len(self.daylist[0]) != 0:
            if headDate:
                self['title'].setText(
                    "Es wurden für - %s - %s Serie(n) gefunden." %
                    (headDate[0], len(self.daylist[0])))
                self['title'].instance.setForegroundColor(
                    parseColor("foreground"))
            else:
                self['title'].setText(
                    "Es wurden für heute %s Serie(n) gefunden." %
                    len(self.daylist[0]))
                self['title'].instance.setForegroundColor(
                    parseColor("foreground"))
            self.chooseMenuList.setList(
                map(self.buildPlanerList, self.daylist[0]))
            self.ErrorMsg = "'getCover()'"
            self.getCover()
        else:
            if int(self.page) < 1 and not int(self.page) == 0:
                self.page -= 1
            self['title'].setText("Es wurden für heute %s Serie(n) gefunden." %
                                  len(self.daylist[0]))
            self['title'].instance.setForegroundColor(parseColor("foreground"))
            print "[SerienRecorder] Wunschliste Serien-Planer -> LISTE IST LEER !!!!"
            self.chooseMenuList.setList(
                map(self.buildPlanerList, self.daylist[0]))
Ejemplo n.º 32
0
 def setStatus(self, text, color='green'):
     self['status'].setText(text)
     self['status'].instance.setForegroundColor(parseColor(color))
     self.show()
     self.delayTimer.start(self.delayTimerDelay, True)
    def buildPlanerList(self, entry):
        (regional, paytv, neu, prime, transmissionTime, url, serien_name,
         sender, staffel, episode, title, aufnahme, serieAdded,
         bereits_vorhanden, serien_id) = entry

        imageNone = "%simages/black.png" % SerienRecorder.serienRecMainPath
        imageNeu = "%simages/neu.png" % SerienRecorder.serienRecMainPath
        imageTimer = "%simages/timer.png" % SerienRecorder.serienRecMainPath
        imageHDD = "%simages/hdd_icon.png" % SerienRecorder.serienRecMainPath

        if serieAdded == 1:
            seriesColor = parseColor('green').argb()
        elif serieAdded == 2:
            seriesColor = parseColor('red').argb()
        else:
            seriesColor = None
        if aufnahme:
            seriesColor = parseColor('blue').argb()

        titleColor = timeColor = parseColor('foreground').argb()

        if int(neu) == 0:
            imageNeu = imageNone

        if bereits_vorhanden:
            imageHDDTimer = imageHDD
        elif aufnahme:
            imageHDDTimer = imageTimer
        else:
            imageHDDTimer = imageNone

        if config.plugins.serienRec.showPicons.value != "0":
            picon = loadPNG(imageNone)
            if sender and self.serviceRefs.get(sender):
                # Get picon by reference or name
                piconPath = self.piconLoader.getPicon(
                    self.serviceRefs.get(sender)[0] if config.plugins.
                    serienRec.showPicons.value ==
                    "1" else self.serviceRefs.get(sender)[1])
                if piconPath:
                    self.picloader = PicLoader(80 * skinFactor,
                                               40 * skinFactor)
                    picon = self.picloader.load(piconPath)
                    self.picloader.destroy()

            return [
                entry,
                (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5,
                 5 * skinFactor, 80 * skinFactor, 40 * skinFactor, picon),
                (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST,
                 330 * skinFactor, 7 * skinFactor, 30 * skinFactor,
                 22 * skinFactor, loadPNG(imageNeu)),
                (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST,
                 330 * skinFactor, 30 * skinFactor, 30 * skinFactor,
                 22 * skinFactor, loadPNG(imageHDDTimer)),
                (eListboxPythonMultiContent.TYPE_TEXT, 100 * skinFactor, 3,
                 200 * skinFactor, 26 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, sender),
                (eListboxPythonMultiContent.TYPE_TEXT, 100 * skinFactor,
                 29 * skinFactor, 150 * skinFactor, 18 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, transmissionTime,
                 timeColor, timeColor),
                (eListboxPythonMultiContent.TYPE_TEXT, 365 * skinFactor, 3,
                 500 * skinFactor, 26 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, serien_name, seriesColor,
                 seriesColor),
                (eListboxPythonMultiContent.TYPE_TEXT, 365 * skinFactor,
                 29 * skinFactor, 500 * skinFactor, 18 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, title, titleColor,
                 titleColor)
            ]
        else:
            return [
                entry,
                (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5, 7,
                 30 * skinFactor, 22 * skinFactor, loadPNG(imageNeu)),
                (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5,
                 30 * skinFactor, 30 * skinFactor, 22 * skinFactor,
                 loadPNG(imageHDDTimer)),
                (eListboxPythonMultiContent.TYPE_TEXT, 40 * skinFactor, 3,
                 280 * skinFactor, 26 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, sender),
                (eListboxPythonMultiContent.TYPE_TEXT, 40 * skinFactor,
                 29 * skinFactor, 150 * skinFactor, 18 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, transmissionTime,
                 timeColor, timeColor),
                (eListboxPythonMultiContent.TYPE_TEXT, 340 * skinFactor, 3,
                 520 * skinFactor, 26 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, serien_name, seriesColor,
                 seriesColor),
                (eListboxPythonMultiContent.TYPE_TEXT, 340 * skinFactor,
                 29 * skinFactor, 520 * skinFactor, 18 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, title, titleColor,
                 titleColor)
            ]
Ejemplo n.º 34
0
 def foregroundColorNextEvent(value):
     self.l.setColor(eListboxServiceContent.eventNextForeground,
                     parseColor(value))
Ejemplo n.º 35
0
 def applySkin(self, desktop, parent):
     attribs = []
     for (attrib, value) in self.skinAttributes:
         if attrib == "foregroundColorMarked":
             self.markedForeground = parseColor(value)
         elif attrib == "foregroundColorMarkedSelected":
             self.markedForegroundSelected = parseColor(value)
         elif attrib == "backgroundColorMarked":
             self.markedBackground = parseColor(value)
         elif attrib == "backgroundColorMarkedSelected":
             self.markedBackgroundSelected = parseColor(value)
         elif attrib == "foregroundColorServiceNotAvail":
             self.serviceNotAvail = parseColor(value)
         elif attrib == "colorEventProgressbar":
             self.serviceEventProgressbarColor = parseColor(value)
         elif attrib == "colorEventProgressbarSelected":
             self.serviceEventProgressbarColorSelected = parseColor(value)
         elif attrib == "forgroundColorEventProgressbarBorder":
             self.serviceEventProgressbarBackColor = parseColor(value)
         elif attrib == "backgroundColorEventProgressbarBorderSelected":
             self.serviceEventProgressbarBackColorSelected = parseColor(
                 value)
         elif attrib == "colorEventProgressbarBorder":
             self.serviceEventProgressbarBorderColor = parseColor(value)
         elif attrib == "colorEventProgressbarBorderSelected":
             self.serviceEventProgressbarBorderColorSelected = parseColor(
                 value)
         elif attrib == "colorServiceDescription":
             self.serviceDescriptionColor = parseColor(value)
         elif attrib == "colorServiceDescriptionSelected":
             self.serviceDescriptionColorSelected = parseColor(value)
         elif attrib == "colorRecording":
             self.recordingColor = parseColor(value)
         elif attrib == "colorRecordingSelected":
             self.recordingColorSelected = parseColor(value)
         elif attrib == "colorAdditionalInfo":
             self.additionalInfoColor = parseColor(value)
         elif attrib == "colorAdditionalInfoSelected":
             self.additionalInfoColorSelected = parseColor(value)
         elif attrib == "picServiceEventProgressbar":
             pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value))
             if pic:
                 self.picServiceEventProgressbar = pic
         elif attrib == "serviceItemHeight":
             self.itemHeight = int(value)
         elif attrib == "serviceItemHeightHigh":
             self.itemHeightHigh = int(value)
         elif attrib == "serviceNameFont":
             self.l.setFont(2, parseFont(value, ((1, 1), (1, 1))))
             self.serviceNameFont = parseFont(value, ((1, 1), (1, 1)))
         elif attrib == "serviceInfoFont":
             self.l.setFont(3, parseFont(value, ((1, 1), (1, 1))))
             name, size = value.split(';')
             self.serviceInfoFontHeight = int(size)
         elif attrib == "serviceNumberFont":
             self.l.setFont(1, parseFont(value, ((1, 1), (1, 1))))
         elif attrib == "additionalInfoFont":
             self.l.setFont(0, parseFont(value, ((1, 1), (1, 1))))
             self.additionalInfoFont = parseFont(value, ((1, 1), (1, 1)))
         elif attrib == "selectionPixmap":
             pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value))
             if pic:
                 self.selectionPixmapStandard = pic
                 if not config.usage.configselection_bigpicons.value:
                     self.instance.setSelectionPicture(
                         self.selectionPixmapStandard)
         elif attrib == "selectionPixmapHigh":
             pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value))
             if pic:
                 self.selectionPixmapBig = pic
                 if config.usage.configselection_bigpicons.value:
                     self.instance.setSelectionPicture(
                         self.selectionPixmapBig)
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     return GUIComponent.applySkin(self, desktop, parent)
Ejemplo n.º 36
0
    def buildList(self, entry):
        (series, season, channel, utc_time, ID, marker_flag, fs_id,
         info) = entry

        serienRecMainPath = os.path.dirname(__file__)
        icon = imageNone = "%s/images/black.png" % serienRecMainPath
        imageNeu = "%s/images/neu.png" % serienRecMainPath

        if marker_flag == 1:
            setFarbe = parseColor('green').argb()
        elif marker_flag == 2:
            setFarbe = parseColor('red').argb()
        else:
            setFarbe = parseColor('foreground').argb()

        if str(season).isdigit() and int(season) == 1:
            icon = imageNeu

        foregroundColor = parseColor('foreground').argb()

        season = "Staffel %s" % str(season)
        weekdays = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"]
        xtime = time.strftime(
            weekdays[time.localtime(int(utc_time)).tm_wday] + ", %d.%m.%Y",
            time.localtime(int(utc_time)))

        if config.plugins.serienRec.showPicons.value != "0":
            picon = loadPNG(imageNone)
            if channel and self.serviceRefs.get(channel):
                # Get picon by reference or by name
                piconPath = self.piconLoader.getPicon(
                    self.serviceRefs.get(channel)[0] if config.plugins.
                    serienRec.showPicons.value ==
                    "1" else self.serviceRefs.get(channel)[1])
                if piconPath:
                    self.picloader = PicLoader(80 * skinFactor,
                                               40 * skinFactor)
                    picon = self.picloader.load(piconPath)
                    self.picloader.destroy()

            return [
                entry,
                (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 10, 5,
                 80 * skinFactor, 40 * skinFactor, picon),
                (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST,
                 340 * skinFactor, 15 * skinFactor, 30 * skinFactor,
                 30 * skinFactor, loadPNG(icon)),
                (eListboxPythonMultiContent.TYPE_TEXT, 110 * skinFactor, 3,
                 230 * skinFactor, 26 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, channel, foregroundColor,
                 foregroundColor),
                (eListboxPythonMultiContent.TYPE_TEXT, 110 * skinFactor,
                 29 * skinFactor, 200 * skinFactor, 18 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, xtime),
                (eListboxPythonMultiContent.TYPE_TEXT, 375 * skinFactor, 3,
                 500 * skinFactor, 26 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, series, setFarbe,
                 setFarbe),
                (eListboxPythonMultiContent.TYPE_TEXT, 375 * skinFactor,
                 29 * skinFactor, 500 * skinFactor, 18 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, season)
            ]
        else:
            return [
                entry,
                (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 15,
                 15 * skinFactor, 30 * skinFactor, 30 * skinFactor,
                 loadPNG(icon)),
                (eListboxPythonMultiContent.TYPE_TEXT, 50 * skinFactor, 3,
                 230 * skinFactor, 26 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, channel, foregroundColor,
                 foregroundColor),
                (eListboxPythonMultiContent.TYPE_TEXT, 50 * skinFactor,
                 29 * skinFactor, 200 * skinFactor, 18 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, xtime),
                (eListboxPythonMultiContent.TYPE_TEXT, 300 * skinFactor, 3,
                 500 * skinFactor, 26 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, series, setFarbe,
                 setFarbe),
                (eListboxPythonMultiContent.TYPE_TEXT, 300 * skinFactor,
                 29 * skinFactor, 500 * skinFactor, 18 * skinFactor, 0,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, season)
            ]
Ejemplo n.º 37
0
 def colorServiceNextDescriptionSelectedFallback(value):
     self.l.setColor(
         eListboxServiceContent.eventNextForegroundSelectedFallback,
         parseColor(value))
Ejemplo n.º 38
0
 def foregroundColorServiceNotAvail(value):
     self.l.setColor(eListboxServiceContent.serviceNotAvail,
                     parseColor(value))
Ejemplo n.º 39
0
	def buildTimerEntry(self, timer, processed):
		width = self.l.getItemSize().width()
		offsetLeft = 5 # 5 = left border
		offsetRight = self.maxWidth - 5 # 5 = right border
		secondLineColor = 0x00909090 # grey
		border = int(config.plugins.merlinEpgCenter.listItemHeight.value) / 2
		timeString = strftime("%H:%M", localtime(timer.begin)) + "-" + strftime("%H:%M", localtime(timer.end))

		if not processed:
			if timer.state == TimerEntry.StateWaiting:
				state = _("waiting")
				color = 0x00ffed00 # yellow
			elif timer.state == TimerEntry.StatePrepared:
				state = _("about to start")
				color = parseColor("red").argb()
			elif timer.state == TimerEntry.StateRunning:
				if timer.justplay:
					state = _("zapped")
				else:
					state = _("recording...")
				color = parseColor("red").argb()
			elif timer.state == TimerEntry.StateEnded:
				state = _("done!")
				color = parseColor("green").argb()
			else:
				state = _("<unknown>")
				color = parseColor("red").argb()
		else:
			state = _("done!")
			color = parseColor("green").argb()
		
		if timer.disabled:
			state = _("disabled")
			color = 0x009a9a9a
			
		if timer.justplay:
			state = "(ZAP) " + state
			
		res = [ None ]
		
		if config.plugins.merlinEpgCenter.showListNumbers.value:
			number = str(self.instance.getCurrentIndex() + 1)
			width = self.maxWidth * 3 / 100
			# 30 breite
			res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, 0, width, self.itemHeight, 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, number))
			offsetLeft = offsetLeft + width + 5 # abstand
			
		if config.plugins.merlinEpgCenter.showPicons.value:
			width = self.piconSize.width()
			height = self.piconSize.height()
			picon = self.piconLoader.getPicon(str(timer.service_ref))
			if picon:
				res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetLeft, (self.itemHeight - self.baseHeight) / 2, width, height, picon))
			offsetLeft = offsetLeft + width + 5 # abstand
			
		if config.plugins.merlinEpgCenter.showServiceName.value:
			if self.videoMode == MODE_SD:
				width = self.maxWidth * 12 / 100
			elif self.videoMode == MODE_XD:
				width = self.maxWidth * 14 / 100
			elif self.videoMode == MODE_HD:
				width = self.maxWidth * 16 / 100
				
			res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, 0, width, self.itemHeight, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, timer.service_ref.getServiceName()))
			offsetLeft = offsetLeft + width + 5 # abstand
			
		if self.videoMode == MODE_SD:
			width = self.maxWidth * 18 / 100
		else:
			width = self.maxWidth * 14 / 100
		fd = getFuzzyDay(timer.begin)
		
		res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, border, width, self.halfItemHeight - border, 1, RT_HALIGN_LEFT|RT_VALIGN_TOP, timeString))
		res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, self.halfItemHeight, width, self.halfItemHeight - border, 2, RT_HALIGN_CENTER|RT_VALIGN_TOP, fd, secondLineColor))
			
		offsetLeft = offsetLeft + width + 5 # abstand
		
		width = self.maxWidth * 22 / 100
		offsetRight = offsetRight - width
		res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, 0, offsetRight - offsetLeft, self.itemHeight, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, timer.name))
		res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetRight, 0, width, self.itemHeight, 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, state, color))
		
		return res
Ejemplo n.º 40
0
 def colorEventProgressbar(value):
     self.l.setColor(
         eListboxServiceContent.serviceEventProgressbarColor,
         parseColor(value))
Ejemplo n.º 41
0
 def foregroundColorEventborderSelected(value):
     self.l.setColor(
         eListboxServiceContent.eventborderForegroundSelected,
         parseColor(value))
Ejemplo n.º 42
0
 def colorEventProgressbarBorderSelected(value):
     self.l.setColor(
         eListboxServiceContent.
         serviceEventProgressbarBorderColorSelected, parseColor(value))
Ejemplo n.º 43
0
 def colorServiceRecorded(value):
     self.l.setColor(eListboxServiceContent.serviceRecorded,
                     parseColor(value))
Ejemplo n.º 44
0
 def colorFallbackItem(value):
     self.l.setColor(eListboxServiceContent.serviceItemFallback,
                     parseColor(value))
Ejemplo n.º 45
0
    def layoutFinish(self):
        if config.plugins.MyMetrix.Color.Selection.value == "CUSTOM":
            _selection = getHexColor(
                config.plugins.MyMetrix.Color.Selection_Custom.value,
                config.plugins.MyMetrix.Color.SelectionTransparency.value)
        else:
            _selection = config.plugins.MyMetrix.Color.Selection.value.replace(
                "#00", "#" + str(
                    hex(
                        int(config.plugins.MyMetrix.Color.
                            SelectionTransparency.value))))

        if config.plugins.MyMetrix.Color.Background2.value == "CUSTOM":
            _background2 = getHexColor(
                config.plugins.MyMetrix.Color.Background2_Custom.value,
                config.plugins.MyMetrix.Color.BackgroundTransparency.value)
        else:
            _background2 = config.plugins.MyMetrix.Color.Background2.value.replace(
                "#00", "#" + getHex(config.plugins.MyMetrix.Color.
                                    BackgroundTransparency.value))

        if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
            _background = getHexColor(
                config.plugins.MyMetrix.Color.Background_Custom.value,
                config.plugins.MyMetrix.Color.BackgroundTransparency.value)
        else:
            _background = config.plugins.MyMetrix.Color.Background.value.replace(
                "#00", "#" + getHex(config.plugins.MyMetrix.Color.
                                    BackgroundTransparency.value))

        if config.plugins.MyMetrix.Color.BackgroundText.value == "CUSTOM":
            _BackgroundText = getHexColor(
                config.plugins.MyMetrix.Color.BackgroundText_Custom.value,
                config.plugins.MyMetrix.Color.BackgroundTextTransparency.value)
        else:
            _BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace(
                "#00", "#" + getHex(config.plugins.MyMetrix.Color.
                                    BackgroundTextTransparency.value))

        if config.plugins.MyMetrix.Color.Foreground.value == "CUSTOM":
            _Foreground = getHexColor(
                config.plugins.MyMetrix.Color.Foreground_Custom.value)
        else:
            _Foreground = config.plugins.MyMetrix.Color.Foreground.value

        if config.plugins.MyMetrix.Color.Accent1.value == "CUSTOM":
            _Accent1 = getHexColor(
                config.plugins.MyMetrix.Color.Accent1_Custom.value)
        else:
            _Accent1 = config.plugins.MyMetrix.Color.Accent1.value

        if config.plugins.MyMetrix.Color.Accent2.value == "CUSTOM":
            _Accent2 = getHexColor(
                config.plugins.MyMetrix.Color.Accent2_Custom.value)
        else:
            _Accent2 = config.plugins.MyMetrix.Color.Accent2.value

        if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
            _transparent = getHexColor(
                config.plugins.MyMetrix.Color.Background_Custom.value, "255")
        else:
            _transparent = config.plugins.MyMetrix.Color.Background.value.replace(
                "#00", "#ff")

        self["InfoBar_BG"].instance.setBackgroundColor(parseColor(_background))
        self["WeatherWidget_BG"].instance.setBackgroundColor(
            parseColor(_background))
        self["WeatherWidget_BG2"].instance.setBackgroundColor(
            parseColor(_background2))
        self["EPGNow_BG"].instance.setBackgroundColor(parseColor(_background))
        self["EPGNext_BG"].instance.setBackgroundColor(
            parseColor(_background2))
        self["ClockWidget_BG"].instance.setBackgroundColor(
            parseColor(_background))
        self["Clock"].instance.setForegroundColor(parseColor(_Foreground))
        self["Clock"].instance.setBackgroundColor(parseColor(_background))
        self["Clock_Day"].instance.setForegroundColor(parseColor(_Accent1))
        self["Clock_Day"].instance.setBackgroundColor(parseColor(_background))
        self["Clock_Date"].instance.setForegroundColor(parseColor(_Accent1))
        self["Clock_Date"].instance.setBackgroundColor(parseColor(_background))

        self["Event_Now"].instance.setForegroundColor(parseColor(_Foreground))
        self["Event_Now"].instance.setBackgroundColor(parseColor(_background))
        self["Event_Next"].instance.setForegroundColor(parseColor(_Accent1))
        self["Event_Next"].instance.setBackgroundColor(
            parseColor(_background2))

        self["Now"].instance.setForegroundColor(parseColor(_Foreground))
        self["Now"].instance.setBackgroundColor(parseColor(_background))
        self["Next"].instance.setForegroundColor(parseColor(_Accent1))
        self["Next"].instance.setBackgroundColor(parseColor(_background))

        self["Event_No"].instance.setForegroundColor(parseColor(_Foreground))
        self["Event_No"].instance.setBackgroundColor(parseColor(_background))
        self["Event_Ne"].instance.setForegroundColor(parseColor(_Accent1))
        self["Event_Ne"].instance.setBackgroundColor(parseColor(_background2))

        self["Now_Time"].instance.setForegroundColor(parseColor(_Foreground))
        self["Now_Time"].instance.setBackgroundColor(parseColor(_background))
        self["Now_Timer"].instance.setForegroundColor(parseColor(_Foreground))
        self["Now_Timer"].instance.setBackgroundColor(parseColor(_background))

        self["Next_Timer"].instance.setForegroundColor(parseColor(_Accent1))
        self["Next_Timer"].instance.setBackgroundColor(parseColor(_background))

        self["Channelname"].instance.setForegroundColor(
            parseColor(_BackgroundText))

        self["ProgressBar"].instance.setBackgroundColor(
            parseColor(config.plugins.MyMetrix.Color.ProgressBar.value))
        self["ProgressBarBack"].instance.setBackgroundColor(
            parseColor(_Accent1))

        self["Temp"].instance.setForegroundColor(parseColor(_Foreground))
        self["Temp"].instance.setBackgroundColor(parseColor(_background))
        self["TempC"].instance.setForegroundColor(parseColor(_Foreground))
        self["TempC"].instance.setBackgroundColor(parseColor(_background))
        self["TempA"].instance.setForegroundColor(parseColor(_Accent1))
        self["TempA"].instance.setBackgroundColor(parseColor(_background))
        self["TempB"].instance.setForegroundColor(parseColor(_Accent2))
        self["TempB"].instance.setBackgroundColor(parseColor(_background))
        self["TempCode"].instance.setForegroundColor(parseColor(_Foreground))
        self["TempCode"].instance.setBackgroundColor(parseColor(_background))

        self["TempC2"].instance.setForegroundColor(parseColor(_Accent1))
        self["TempC2"].instance.setBackgroundColor(parseColor(_background2))
        self["TempD"].instance.setForegroundColor(parseColor(_Accent2))
        self["TempD"].instance.setBackgroundColor(parseColor(_background2))
        self["TempCode2"].instance.setForegroundColor(parseColor(_Accent1))
        self["TempCode2"].instance.setBackgroundColor(parseColor(_background2))
        self["Crypt"].instance.setBackgroundColor(parseColor(_selection))

        self["B"].instance.setForegroundColor(parseColor(_Foreground))
        self["B"].instance.setBackgroundColor(parseColor(_background))

        self["I"].instance.setForegroundColor(parseColor(_Accent1))
        self["I"].instance.setBackgroundColor(parseColor(_background))

        self["S"].instance.setForegroundColor(parseColor(_Accent1))
        self["S"].instance.setBackgroundColor(parseColor(_background))

        self["V"].instance.setForegroundColor(parseColor(_Accent1))
        self["V"].instance.setBackgroundColor(parseColor(_background))

        self["N"].instance.setForegroundColor(parseColor(_Foreground))
        self["N"].instance.setBackgroundColor(parseColor(_background))

        self["CW"].instance.setForegroundColor(parseColor(_Accent1))
        self["CW"].instance.setBackgroundColor(parseColor(_background))

        self["ND"].instance.setForegroundColor(parseColor(_Foreground))
        self["ND"].instance.setBackgroundColor(parseColor(_background))

        self["CO"].instance.setForegroundColor(parseColor(_Accent1))
        self["CO"].instance.setBackgroundColor(parseColor(_background))

        self.instance.setBackgroundColor(parseColor(_transparent))
Ejemplo n.º 46
0
 def backgroundColorMarkedSelected(value):
     self.l.setColor(eListboxServiceContent.markedBackgroundSelected,
                     parseColor(value))
Ejemplo n.º 47
0
 def foregroundColorMarked(value):
     self.l.setColor(eListboxServiceContent.markedForeground,
                     parseColor(value))
	def buildList(entry):
		from SerienRecorder import serienRecMainPath
		(webSender, stbSender, altstbSender, status) = entry
		if int(status) == 0:
			imageStatus = "%simages/minus.png" % serienRecMainPath
		else:
			imageStatus = "%simages/plus.png" % serienRecMainPath

		return [entry,
			(eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 10, 7 * skinFactor, 16 * skinFactor, 16 * skinFactor, loadPNG(imageStatus)),
			(eListboxPythonMultiContent.TYPE_TEXT, 40 * skinFactor, 0, 300 * skinFactor, 26 * skinFactor, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, webSender),
			(eListboxPythonMultiContent.TYPE_TEXT, 350 * skinFactor, 0, 250 * skinFactor, 26 * skinFactor, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, stbSender),
			(eListboxPythonMultiContent.TYPE_TEXT, 600 * skinFactor, 0, 250 * skinFactor, 26 * skinFactor, 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, altstbSender, parseColor('yellow').argb())
			]
Ejemplo n.º 49
0
 def applySkin(self, desktop, parent):
     attribs = []
     if self.skinAttributes is not None:
         attribs = []
         for (attrib, value) in self.skinAttributes:
             if attrib == "foregroundColorMarked":
                 self.l.setColor(eListboxServiceContent.markedForeground,
                                 parseColor(value))
             elif attrib == "foregroundColorMarkedSelected":
                 self.l.setColor(
                     eListboxServiceContent.markedForegroundSelected,
                     parseColor(value))
             elif attrib == "backgroundColorMarked":
                 self.l.setColor(eListboxServiceContent.markedBackground,
                                 parseColor(value))
             elif attrib == "backgroundColorMarkedSelected":
                 self.l.setColor(
                     eListboxServiceContent.markedBackgroundSelected,
                     parseColor(value))
             elif attrib == "foregroundColorServiceNotAvail":
                 self.l.setColor(eListboxServiceContent.serviceNotAvail,
                                 parseColor(value))
             elif attrib == "foregroundColorEvent" or attrib == "colorServiceDescription":
                 self.l.setColor(eListboxServiceContent.eventForeground,
                                 parseColor(value))
             elif attrib == "foregroundColorEventSelected" or attrib == "colorServiceDescriptionSelected":
                 self.l.setColor(
                     eListboxServiceContent.eventForegroundSelected,
                     parseColor(value))
             elif attrib == "foregroundColorEventborder":
                 self.l.setColor(
                     eListboxServiceContent.eventborderForeground,
                     parseColor(value))
             elif attrib == "foregroundColorEventborderSelected":
                 self.l.setColor(
                     eListboxServiceContent.eventborderForegroundSelected,
                     parseColor(value))
             elif attrib == "colorEventProgressbar":
                 self.l.setColor(
                     eListboxServiceContent.serviceEventProgressbarColor,
                     parseColor(value))
             elif attrib == "colorEventProgressbarSelected":
                 self.l.setColor(
                     eListboxServiceContent.
                     serviceEventProgressbarColorSelected,
                     parseColor(value))
             elif attrib == "colorEventProgressbarBorder":
                 self.l.setColor(
                     eListboxServiceContent.
                     serviceEventProgressbarBorderColor, parseColor(value))
             elif attrib == "colorEventProgressbarBorderSelected":
                 self.l.setColor(
                     eListboxServiceContent.
                     serviceEventProgressbarBorderColorSelected,
                     parseColor(value))
             elif attrib == "colorServiceRecorded":
                 self.l.setColor(eListboxServiceContent.serviceRecorded,
                                 parseColor(value))
             elif attrib == "colorServicePseudoRecorded":
                 self.l.setColor(
                     eListboxServiceContent.servicePseudoRecorded,
                     parseColor(value))
             elif attrib == "colorServiceStreamed":
                 self.l.setColor(eListboxServiceContent.serviceStreamed,
                                 parseColor(value))
             elif attrib == "colorFallbackItem":
                 self.l.setColor(eListboxServiceContent.serviceItemFallback,
                                 parseColor(value))
             elif attrib == "colorServiceSelectedFallback":
                 self.l.setColor(
                     eListboxServiceContent.serviceSelectedFallback,
                     parseColor(value))
             elif attrib == "colorServiceDescriptionFallback":
                 self.l.setColor(
                     eListboxServiceContent.eventForegroundFallback,
                     parseColor(value))
             elif attrib == "colorServiceDescriptionSelectedFallback":
                 self.l.setColor(
                     eListboxServiceContent.eventForegroundSelectedFallback,
                     parseColor(value))
             elif attrib == "picServiceEventProgressbar":
                 pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, value))
                 if pic:
                     self.l.setPixmap(self.l.picServiceEventProgressbar,
                                      pic)
             elif attrib == "serviceItemHeight":
                 self.ItemHeight = int(value)
             elif attrib == "serviceNameFont":
                 font = parseFont(value, ((1, 1), (1, 1)))
                 self.ServiceNameFontName = font.family
                 self.ServiceNameFontSize = font.pointSize
             elif attrib == "serviceInfoFont":
                 font = parseFont(value, ((1, 1), (1, 1)))
                 self.ServiceInfoFontName = font.family
                 self.ServiceInfoFontSize = font.pointSize
             elif attrib == "serviceNumberFont":
                 font = parseFont(value, ((1, 1), (1, 1)))
                 self.ServiceNumberFontName = font.family
                 self.ServiceNumberFontSize = font.pointSize
             elif attrib == "progressbarHeight":
                 self.l.setProgressbarHeight(int(value))
             elif attrib == "progressbarBorderWidth":
                 self.l.setProgressbarBorderWidth(int(value))
             else:
                 attribs.append((attrib, value))
         self.skinAttributes = attribs
         self.setServiceFontsize()
     rc = GUIComponent.applySkin(self, desktop, parent)
     self.listHeight = self.instance.size().height()
     self.listWidth = self.instance.size().width()
     self.setItemsPerPage()
     return rc
Ejemplo n.º 50
0
 def colorServiceDescriptionFallback(value):
     self.l.setColor(eListboxServiceContent.eventForegroundFallback,
                     parseColor(value))
Ejemplo n.º 51
0
 def colorServiceDescriptionSelected(value):
     self.l.setColor(eListboxServiceContent.eventForegroundSelected,
                     parseColor(value))
    def applySkin(self, desktop, screen):
        def retValue(val, limit, default, Min=False):
            try:
                if Min:
                    x = min(limit, int(val))
                else:
                    x = max(limit, int(val))
            except:
                x = default
            return x

        self.halign = valign = eLabel.alignLeft
        if self.skinAttributes:
            attribs = []
            for (attrib, value) in self.skinAttributes:
                if attrib == "font":
                    self.txfont = parseFont(value, ((1, 1), (1, 1)))
                elif attrib == "foregroundColor":
                    self.fcolor = parseColor(value)
                elif attrib == "backgroundColor":
                    self.bcolor = parseColor(value)
                elif attrib == "shadowColor":
                    self.scolor = parseColor(value)
                elif attrib == "shadowOffset":
                    x, y = value.split(',')
                    self.soffset = (int(x), int(y))
                elif attrib == "valign" and value in ("top", "center",
                                                      "bottom"):
                    valign = {
                        "top": eLabel.alignTop,
                        "center": eLabel.alignCenter,
                        "bottom": eLabel.alignBottom
                    }[value]
                    self.txtflags |= {
                        "top": RT_VALIGN_TOP,
                        "center": RT_VALIGN_CENTER,
                        "bottom": RT_VALIGN_BOTTOM
                    }[value]
                elif attrib == "halign" and value in ("left", "center",
                                                      "right", "block"):
                    self.halign = {
                        "left": eLabel.alignLeft,
                        "center": eLabel.alignCenter,
                        "right": eLabel.alignRight,
                        "block": eLabel.alignBlock
                    }[value]
                    self.txtflags |= {
                        "left": RT_HALIGN_LEFT,
                        "center": RT_HALIGN_CENTER,
                        "right": RT_HALIGN_RIGHT,
                        "block": RT_HALIGN_BLOCK
                    }[value]
                elif attrib == "noWrap":
                    if value == "0":
                        self.txtflags |= RT_WRAP
                    else:
                        self.txtflags &= ~RT_WRAP
                elif attrib == "options":
                    options = value.split(',')
                    for opt in options:
                        val = ''
                        pos = opt.find('=')
                        if pos != -1:
                            val = opt[pos + 1:].strip()
                            opt = opt[:pos].strip()
                        if opt == "wrap":
                            if val == "0":
                                self.txtflags &= ~RT_WRAP
                            else:
                                self.txtflags |= RT_WRAP
                        elif opt == "nowrap":
                            if val == "0":
                                self.txtflags |= RT_WRAP
                            else:
                                self.txtflags &= ~RT_WRAP
                        elif opt == "movetype" and val in ("none", "running",
                                                           "swimming"):
                            self.type = {
                                "none": NONE,
                                "running": RUNNING,
                                "swimming": SWIMMING
                            }[val]
                        elif opt == "direction" and val in ("left", "right",
                                                            "top", "bottom"):
                            self.direction = {
                                "left": LEFT,
                                "right": RIGHT,
                                "top": TOP,
                                "bottom": BOTTOM
                            }[val]
                        elif opt == "step" and val:
                            #retValue(val, limit, default, Min=False)
                            self.mStep = retValue(val, 1, self.mStep)
                        elif opt == "steptime" and val:
                            self.mStepTimeout = retValue(
                                val, 25, self.mStepTimeout)
                        elif opt == "startdelay" and val:
                            self.mStartDelay = retValue(
                                val, 0, self.mStartDelay)
                        elif opt == "pause" and val:
                            self.mLoopTimeout = retValue(
                                val, 0, self.mLoopTimeout)
                        elif opt == "oneshot" and val:
                            self.mOneShot = retValue(val, 0, self.mOneShot)
                        elif opt == "repeat" and val:
                            self.mRepeat = retValue(val, 0, self.mRepeat)
                        elif opt == "always" and val:
                            self.mAlways = retValue(val, 0, self.mAlways)
                        elif opt == "startpoint" and val:
                            self.mStartPoint = int(val)
                else:
                    attribs.append((attrib, value))
            self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, screen)
        #if self.type == RUNNING and self.direction in (LEFT,RIGHT):
        #	self.halign = eLabel.alignLeft
        #	self.txtflags = RT_HALIGN_LEFT | (self.txtflags & RT_WRAP)
        if self.mOneShot: self.mOneShot = max(self.mStepTimeout, self.mOneShot)
        if self.mLoopTimeout:
            self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout)

        self.test_label.setFont(self.txfont)
        #self.test_label.setForegroundColor(self.fcolor)
        #self.test_label.setBackgroundColor(self.bcolor)
        #if not self.scolor is None:
        #	self.test_label.setShadowColor(self.scolor)
        #	self.test_label.setShadowOffset(ePoint(self.soffset[0], self.soffset[1]))
        if not (self.txtflags & RT_WRAP):
            self.test_label.setNoWrap(1)
        self.test_label.setVAlign(valign)
        self.test_label.setHAlign(self.halign)
        self.test_label.move(ePoint(self.W, self.H))
        self.test_label.resize(eSize(self.W, self.H))
        #self.test_label.hide()
        #self.changed((self.CHANGED_DEFAULT,))
        return ret
Ejemplo n.º 53
0
 def __init__(self):
     Renderer.__init__(self)
     self.backgroundColor = parseColor("#ff000000")
     self.emmColor = parseColor("#00aaaaaa")
     self.ecmColor = parseColor("#0056c856")
     self.font = gFont("Regular", 20)
Ejemplo n.º 54
0
 def foregroundColorEventNextSelected(value):
     self.l.setColor(eListboxServiceContent.eventForegroundNextSelected,
                     parseColor(value))
Ejemplo n.º 55
0
	def applySkin(self, desktop, screen):

		def retValue(val, limit, default, Min = False):
			try:
				if Min:
					x = min(limit, int(val))
				else:
					x = max(limit, int(val))
			except:
				x = default

			return x

		def setWrapFlag(attrib, value):
			if attrib.lower() == 'wrap' and value == '0' or attrib.lower() == 'nowrap' and value != '0':
				self.txtflags &= ~RT_WRAP
			else:
				self.txtflags |= RT_WRAP

		self.halign = valign = eLabel.alignLeft
		if self.skinAttributes:
			attribs = []
			for attrib, value in self.skinAttributes:
				if attrib == 'font':
					self.txfont = parseFont(value, ((1, 1), (1, 1)))
				elif attrib == 'foregroundColor':
					self.scroll_label.setForegroundColor(parseColor(value))
				elif attrib in ('shadowColor', 'borderColor'):
					self.scroll_label.setShadowColor(parseColor(value))
				elif attrib == 'shadowOffset':
					x, y = value.split(',')
					self.soffset = (int(x), int(y))
					self.scroll_label.setShadowOffset(ePoint(self.soffset))
				elif attrib == 'borderWidth':
					self.soffset = (-int(value), -int(value))
				elif attrib == 'valign' and value in ('top', 'center', 'bottom'):
					valign = {'top': eLabel.alignTop,
					 'center': eLabel.alignCenter,
					 'bottom': eLabel.alignBottom}[value]
					self.txtflags |= {'top': RT_VALIGN_TOP,
					 'center': RT_VALIGN_CENTER,
					 'bottom': RT_VALIGN_BOTTOM}[value]
				elif attrib == 'halign' and value in ('left', 'center', 'right', 'block'):
					self.halign = {'left': eLabel.alignLeft,
					 'center': eLabel.alignCenter,
					 'right': eLabel.alignRight,
					 'block': eLabel.alignBlock}[value]
					self.txtflags |= {'left': RT_HALIGN_LEFT,
					 'center': RT_HALIGN_CENTER,
					 'right': RT_HALIGN_RIGHT,
					 'block': RT_HALIGN_BLOCK}[value]
				elif attrib == 'noWrap':
					setWrapFlag(attrib, value)
				elif attrib == 'options':
					options = value.split(',')
					for o in options:
						if o.find('=') != -1:
							opt, val = (x.strip() for x in o.split('=', 1))
						else:
							opt, val = o.strip(), ''
						if opt == '':
							continue
						elif opt in ('wrap', 'nowrap'):
							setWrapFlag(opt, val)
						elif opt == 'movetype' and val in ('none', 'running', 'swimming'):
							self.type = {'none': NONE,
							 'running': RUNNING,
							 'swimming': SWIMMING}[val]
						elif opt == 'direction' and val in ('left', 'right', 'top', 'bottom'):
							self.direction = {'left': LEFT,
							 'right': RIGHT,
							 'top': TOP,
							 'bottom': BOTTOM}[val]
						elif opt == 'step' and val:
							self.mStep = retValue(val, 1, self.mStep)
						elif opt == 'steptime' and val:
							self.mStepTimeout = retValue(val, 25, self.mStepTimeout)
						elif opt == 'startdelay' and val:
							self.mStartDelay = retValue(val, 0, self.mStartDelay)
						elif opt == 'pause' and val:
							self.mLoopTimeout = retValue(val, 0, self.mLoopTimeout)
						elif opt == 'oneshot' and val:
							self.mOneShot = retValue(val, 0, self.mOneShot)
						elif opt == 'repeat' and val:
							self.mRepeat = retValue(val, 0, self.mRepeat)
						elif opt == 'always' and val:
							self.mAlways = retValue(val, 0, self.mAlways)
						elif opt == 'startpoint' and val:
							self.mStartPoint = int(val)
						elif opt == 'pagedelay' and val:
							self.mPageDelay = retValue(val, 0, self.mPageDelay)
						elif opt == 'pagelength' and val:
							self.mPageLength = retValue(val, 0, self.mPageLength)

				else:
					attribs.append((attrib, value))
					if attrib == 'backgroundColor':
						self.scroll_label.setBackgroundColor(parseColor(value))
					elif attrib == 'transparent':
						self.scroll_label.setTransparent(int(value))

			self.skinAttributes = attribs
		ret = Renderer.applySkin(self, desktop, screen)
		if self.mOneShot:
			self.mOneShot = max(self.mStepTimeout, self.mOneShot)
		if self.mLoopTimeout:
			self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout)
		if self.mPageDelay:
			self.mPageDelay = max(self.mStepTimeout, self.mPageDelay)
		self.scroll_label.setFont(self.txfont)
		if not self.txtflags & RT_WRAP:
			self.scroll_label.setNoWrap(1)
		self.scroll_label.setVAlign(valign)
		self.scroll_label.setHAlign(self.halign)
		self.scroll_label.move(ePoint(0, 0))
		self.scroll_label.resize(eSize(self.W, self.H))
		if self.direction in (TOP, BOTTOM):
			from enigma import fontRenderClass
			flh = int(fontRenderClass.getInstance().getLineHeight(self.txfont) or self.txfont.pointSize / 6 + self.txfont.pointSize)
			self.scroll_label.setText('WQq')
			if flh > self.scroll_label.calculateSize().height():
				self.lineHeight = flh
			self.scroll_label.setText('')
		return ret
Ejemplo n.º 56
0
 def applySkin(self, desktop, parent):
     attribs = []
     if self.skinAttributes is not None:
         attribs = []
         for (attrib, value) in self.skinAttributes:
             if attrib == "foregroundColorMarked":
                 self.l.setColor(eListboxServiceContent.markedForeground,
                                 parseColor(value))
             elif attrib == "foregroundColorMarkedSelected":
                 self.l.setColor(
                     eListboxServiceContent.markedForegroundSelected,
                     parseColor(value))
             elif attrib == "backgroundColorMarked":
                 self.l.setColor(eListboxServiceContent.markedBackground,
                                 parseColor(value))
             elif attrib == "backgroundColorMarkedSelected":
                 self.l.setColor(
                     eListboxServiceContent.markedBackgroundSelected,
                     parseColor(value))
             elif attrib == "foregroundColorServiceNotAvail":
                 self.l.setColor(eListboxServiceContent.serviceNotAvail,
                                 parseColor(value))
             elif attrib == "foregroundColorEvent" or attrib == "colorServiceDescription":
                 self.l.setColor(eListboxServiceContent.eventForeground,
                                 parseColor(value))
             elif attrib == "foregroundColorEventSelected" or attrib == "colorServiceDescriptionSelected":
                 self.l.setColor(
                     eListboxServiceContent.eventForegroundSelected,
                     parseColor(value))
             elif attrib == "foregroundColorEventborder":
                 self.l.setColor(
                     eListboxServiceContent.eventborderForeground,
                     parseColor(value))
             elif attrib == "foregroundColorEventborderSelected":
                 self.l.setColor(
                     eListboxServiceContent.eventborderForegroundSelected,
                     parseColor(value))
             elif attrib == "colorEventProgressbar":
                 self.l.setColor(
                     eListboxServiceContent.serviceEventProgressbarColor,
                     parseColor(value))
             elif attrib == "colorEventProgressbarSelected":
                 self.l.setColor(
                     eListboxServiceContent.
                     serviceEventProgressbarColorSelected,
                     parseColor(value))
             elif attrib == "colorEventProgressbarBorder":
                 self.l.setColor(
                     eListboxServiceContent.
                     serviceEventProgressbarBorderColor, parseColor(value))
             elif attrib == "colorEventProgressbarBorderSelected":
                 self.l.setColor(
                     eListboxServiceContent.
                     serviceEventProgressbarBorderColorSelected,
                     parseColor(value))
             elif attrib == "picServiceEventProgressbar":
                 pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN,
                                                  value))
                 if pic:
                     self.l.setPixmap(self.l.picServiceEventProgressbar,
                                      pic)
             elif attrib == "serviceItemHeight":
                 self.ItemHeight = int(value)
             elif attrib == "serviceNameFont":
                 self.ServiceNameFont = parseFont(value, ((1, 1), (1, 1)))
             elif attrib == "serviceInfoFont":
                 self.ServiceInfoFont = parseFont(value, ((1, 1), (1, 1)))
             elif attrib == "serviceNumberFont":
                 self.ServiceNumberFont = parseFont(value, ((1, 1), (1, 1)))
             else:
                 attribs.append((attrib, value))
     self.skinAttributes = attribs
     return GUIComponent.applySkin(self, desktop, parent)
Ejemplo n.º 57
0
	def buildEpgEntry(self, ignoreMe, eventid, sRef, begin, duration, title, short, desc):
		progressPixmap = None
		offsetLeft = 5
		offsetRight = self.maxWidth - 5 - 8 # 8 = timer pixmap width, 5 = border
		secondLineColor = 0x00909090 # grey
		border = int(config.plugins.merlinEpgCenter.listItemHeight.value) / 2
		percent = 0
		
		if begin != None and duration != None:
			timeString = strftime("%H:%M", localtime(begin)) + "-" + strftime("%H:%M", localtime(begin + duration))
			now = int(time())
			if now > begin:
				percent = (now - begin) * 100 / duration
				
			if self.mode == MULTI_EPG_NOW:
				timeValue = (begin + duration - now) / 60 +1
			elif self.mode == MULTI_EPG_NEXT or self.mode == UPCOMING:
				timeValue = (now - begin) /  60
			elif self.mode == MULTI_EPG_PRIMETIME or self.mode == EPGSEARCH_RESULT:
				if now >= begin:
					timeValue = (begin + duration - now) /  60 + 1
				else:
					timeValue = (now - begin) /  60
			elif self.mode == SINGLE_EPG:
				if self.instance.getCurrentIndex() == 0:
					timeValue = (begin + duration - now) /  60 + 1
				else:
					timeValue = (now - begin) /  60
				
			if (KEEP_OUTDATED_TIME == None and (begin + duration) > now) or (KEEP_OUTDATED_TIME != None and (begin + duration) > now):
				if config.plugins.merlinEpgCenter.showDuration.value:
					remainBeginString = " I "
				else:
					remainBeginString = ""
					
				if timeValue >= 0:
					remainBeginString += "+"
				if fabs(timeValue) >= 120 and fabs(timeValue) < 1440:
					timeValue /= 60
					remainBeginString += "%0dh" % timeValue
				elif fabs(timeValue) >= 1440:
					timeValue = (timeValue / 1440) +1
					remainBeginString += "%02dd" % timeValue
				else:
					if timeValue < 0:
						remainBeginString += "%03d" % timeValue
					else:
						remainBeginString += "%02d" % timeValue
			else:
				if config.plugins.merlinEpgCenter.showDuration.value:
					remainBeginString = " I <->"
				else:
					remainBeginString = "<->"
				
			if config.plugins.merlinEpgCenter.showDuration.value:
				duraString = "%d" % (duration / 60)
				
			if self.mode == MULTI_EPG_NOW:
				if config.plugins.merlinEpgCenter.listProgressStyle.value == STYLE_MULTI_PIXMAP:
					part = int(round(percent / 25)) + 1
					progressPixmap = eval('self.progressPixmap_' + str(part))
				elif config.plugins.merlinEpgCenter.listProgressStyle.value == STYLE_PIXMAP_BAR:
					progressPixmap = self.progressPixmap
		else:
			timeString = ""
			duraString = ""
			remainBeginString = ""
			
		if remainBeginString.endswith('>'): # KEEP_OUTDATED_TIME
			outdated = True
			try:
				progColor = parseColor("eventNotAvailable").argb()
			except:
				progColor = 0x777777
		elif config.plugins.merlinEpgCenter.showColoredEpgTimes.value:
			outdated = False
			if remainBeginString.endswith('h'): # begins in... hours
				progColor = 0x00ef7f1a # brown
			elif remainBeginString.endswith('d'): # begins in... days
				progColor = 0x00e31e24 # red
			elif remainBeginString.startswith(' I +') or remainBeginString.startswith('+'): # already running
				progColor = 0x00009846 # green
			elif remainBeginString.startswith(' I -') or remainBeginString.startswith('-'): # begins in... minutes
				progColor = 0x00ffed00 # yellow
			else: # undefined, shouldn't happen
				progColor = 0x00ffffff # white
		else:
			outdated = False
			progColor = 0x00ffed00 # yellow
			
		if outdated:
			textColor = progColor
		elif self.epgList != None:
			textColor = self.epgList.getColorEventAvailable(sRef, begin, duration)
		else:
			textColor = None
			
		res = [ None ]
		
		if config.plugins.merlinEpgCenter.showListNumbers.value:
			if ((self.mode == SINGLE_EPG and not self.similarShown) or self.mode == UPCOMING) and self.instance.getCurrentIndex() != 0:
				chNumber = ""
			else:
				# check if the service is found in our bouquets (or don't show the channel number if not found)
				if self.mode == EPGSEARCH_RESULT:
					if sRef in EpgCenterList.allServicesNameDict:
						i = 0
						while i < len(EpgCenterList.bouquetServices):
							if sRef in EpgCenterList.bouquetServices[i]:
								chOffset = EpgCenterList.bouquetIndexRanges[i]
								chNumber = str(EpgCenterList.bouquetServices[i].index(sRef) + chOffset)
								break
							i += 1
					else:
						chNumber = ""
				else:
					if sRef in EpgCenterList.bouquetServices[EpgCenterList.currentBouquetIndex]:
						chOffset = EpgCenterList.bouquetIndexRanges[EpgCenterList.currentBouquetIndex]
						chNumber = str(EpgCenterList.bouquetServices[EpgCenterList.currentBouquetIndex].index(sRef) + chOffset)
					else:
						chNumber = ""
						
			width = self.maxWidth * 3 / 100
			# 30 breite
			res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, 0, width, self.itemHeight, 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, chNumber))
			offsetLeft = offsetLeft + width + 5 # abstand
			
		if config.plugins.merlinEpgCenter.showPicons.value:
			if ((self.mode == SINGLE_EPG and not self.similarShown) or self.mode == UPCOMING) and self.instance.getCurrentIndex() != 0:
				picon = None
			else:
				picon = self.piconLoader.getPicon(sRef)
				
			width = self.piconSize.width()
			if picon:
				res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetLeft, (self.itemHeight - self.baseHeight) / 2, width, self.itemHeight, picon))
			offsetLeft = offsetLeft + width + 5 # abstand
			
		if config.plugins.merlinEpgCenter.showServiceName.value:
			if self.videoMode == MODE_SD:
				width = self.maxWidth * 12 / 100
			elif self.videoMode == MODE_XD:
				width = self.maxWidth * 14 / 100
			elif self.videoMode == MODE_HD:
				width = self.maxWidth * 16 / 100
				
			if not (((self.mode == SINGLE_EPG and not self.similarShown) or self.mode == UPCOMING) and self.instance.getCurrentIndex() != 0):
				if sRef in EpgCenterList.allServicesNameDict:
					serviceName = EpgCenterList.allServicesNameDict[sRef]
				else:
					serviceName = ServiceReference(sRef).getServiceName()
					
				res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, 0, width, self.itemHeight, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceName))
			offsetLeft = offsetLeft + width + 5 # abstand
			
		if self.mode == MULTI_EPG_NOW and not self.similarShown:
			if self.videoMode == MODE_SD:
				width = self.maxWidth * 18 / 100
			else:
				width = self.maxWidth * 14 / 100
			progressHeight = 6
			
			res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, border, width, self.halfItemHeight - border + (self.singleLineBorder * 2), 1, RT_HALIGN_CENTER|RT_VALIGN_TOP, timeString))
			if config.plugins.merlinEpgCenter.listProgressStyle.value == STYLE_MULTI_PIXMAP and progressPixmap is not None:
				res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetLeft, self.halfItemHeight + (self.halfItemHeight- progressHeight) / 2 + self.singleLineBorder, width, progressHeight, progressPixmap))
			elif config.plugins.merlinEpgCenter.listProgressStyle.value == STYLE_SIMPLE_BAR:
				res.append((eListboxPythonMultiContent.TYPE_PROGRESS, offsetLeft, self.halfItemHeight + (self.halfItemHeight- progressHeight) / 2 + self.singleLineBorder, width, progressHeight, percent, 1, secondLineColor))
			elif config.plugins.merlinEpgCenter.listProgressStyle.value == STYLE_PIXMAP_BAR and progressPixmap is not None:
				res.append((eListboxPythonMultiContent.TYPE_PROGRESS_PIXMAP, offsetLeft, self.halfItemHeight + (self.halfItemHeight- progressHeight) / 2 + self.singleLineBorder, width, progressHeight, percent, progressPixmap, 0))
			offsetLeft = offsetLeft + width + 5 # abstand
		else:
			if self.videoMode == MODE_SD:
				width = self.maxWidth * 18 / 100
			else:
				width = self.maxWidth * 14 / 100
			if self.mode == SINGLE_EPG or self.mode == EPGSEARCH_RESULT or self.similarShown:
				fd = getFuzzyDay(begin)
				res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, border, width, self.halfItemHeight - border, 1, RT_HALIGN_CENTER|RT_VALIGN_TOP, timeString, textColor))
				res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, self.halfItemHeight, width, self.halfItemHeight - border, 2, RT_HALIGN_CENTER|RT_VALIGN_TOP, fd, secondLineColor))
			else:
				res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, 0, width, self.itemHeight, 1, RT_HALIGN_CENTER|RT_VALIGN_CENTER, timeString, textColor))
			offsetLeft = offsetLeft + width + 5 # abstand
			
		if begin != None and duration != None:
			(timerPixmaps, zapPixmaps, isRunning) = self.getTimerPixmapsForEntry(sRef, eventid, begin, duration)
		else:
			timerPixmaps = 0
			zapPixmaps = 0
			isRunning = 0
			
		idx = self.instance.getCurrentIndex()
		self.blinkTimer.updateEntry(self.listType, idx, isRunning)
		
		if zapPixmaps:
			if (zapPixmaps & TIMER_TYPE_EID_MATCH) or (zapPixmaps & TIMER_TYPE_COVERS_FULL) or (zapPixmaps & TIMER_TYPE_EID_REPEATED) or (zapPixmaps & TIMER_TYPE_ADD_COVERS_FULL):
				posY = 2
				height = self.itemHeight - 4
				if (zapPixmaps & TIMER_TYPE_EID_MATCH):
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_event_pixmap))
				elif (zapPixmaps & TIMER_TYPE_COVERS_FULL):
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_pixmap))
				elif (zapPixmaps & TIMER_TYPE_EID_REPEATED):
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_repeated_pixmap))
				elif (zapPixmaps & TIMER_TYPE_ADD_COVERS_FULL):
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_add_pixmap))
			elif (zapPixmaps & TIMER_TYPE_INSIDE_EVENT) or (zapPixmaps & TIMER_TYPE_ADD_INSIDE_EVENT):
				posY = self.itemHeight / 2 - 6
				height = 12
				if (zapPixmaps & TIMER_TYPE_INSIDE_EVENT):
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_pixmap))
				elif (zapPixmaps & TIMER_TYPE_ADD_INSIDE_EVENT):
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_add_pixmap))
			else:
				if zapPixmaps & TIMER_TYPE_COVERS_END:
					posY = self.itemHeight / 2 + 2
					height = self.itemHeight - posY - 2
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_pre_pixmap))
				elif zapPixmaps & TIMER_TYPE_ADD_COVERS_END:
					posY = self.itemHeight / 2 + 2
					height = self.itemHeight - posY - 2
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_add_pixmap))
				if zapPixmaps & TIMER_TYPE_COVERS_BEGIN:
					posY = 2
					height = self.itemHeight / 2 - 2
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_post_pixmap))
				elif zapPixmaps & TIMER_TYPE_ADD_COVERS_BEGIN:
					posY = 2
					height = self.itemHeight / 2 - 2
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_add_pixmap))
				if zapPixmaps & TIMER_TYPE_ADD:
					posY = 2
					height = self.itemHeight - 4
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.zap_add_pixmap))
					
		offsetRight -= 10
		
		if timerPixmaps:
			if (timerPixmaps & TIMER_TYPE_EID_MATCH) or (timerPixmaps & TIMER_TYPE_COVERS_FULL) or (timerPixmaps & TIMER_TYPE_EID_REPEATED) or (timerPixmaps & TIMER_TYPE_ADD_COVERS_FULL):
				posY = 2
				height = self.itemHeight - 4
				if (timerPixmaps & TIMER_TYPE_EID_MATCH):
					if (isRunning & TIMER_TYPE_EID_MATCH) and not self.blinkTimer.getBlinkState():
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, None))
					else:
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_event_pixmap))
				elif (timerPixmaps & TIMER_TYPE_COVERS_FULL):
					if (isRunning & TIMER_TYPE_COVERS_FULL) and not self.blinkTimer.getBlinkState():
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, None))
					else:
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_pixmap))
				elif (timerPixmaps & TIMER_TYPE_EID_REPEATED):
					if (isRunning & TIMER_TYPE_EID_REPEATED) and not self.blinkTimer.getBlinkState():
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, None))
					else:
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_repeated_pixmap))
				elif (timerPixmaps & TIMER_TYPE_ADD_COVERS_FULL):
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_add_pixmap))
			elif (timerPixmaps & TIMER_TYPE_INSIDE_EVENT) or (timerPixmaps & TIMER_TYPE_ADD_INSIDE_EVENT):
				posY = self.itemHeight / 2 - 6
				height = 12
				if (timerPixmaps & TIMER_TYPE_INSIDE_EVENT):
					if (isRunning & TIMER_TYPE_INSIDE_EVENT) and not self.blinkTimer.getBlinkState():
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, None))
					else:
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_pixmap))
				elif (timerPixmaps & TIMER_TYPE_ADD_INSIDE_EVENT):
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_add_pixmap))
			else:
				if timerPixmaps & TIMER_TYPE_COVERS_END:
					posY = self.itemHeight / 2 + 2
					height = self.itemHeight - posY - 2
					if (isRunning & TIMER_TYPE_COVERS_END) and not self.blinkTimer.getBlinkState():
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, None))
					else:
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_pre_pixmap))
				elif timerPixmaps & TIMER_TYPE_ADD_COVERS_END:
					posY = self.itemHeight / 2 + 2
					height = self.itemHeight - posY - 2
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_add_pixmap))
				if timerPixmaps & TIMER_TYPE_COVERS_BEGIN:
					posY = 2
					height = self.itemHeight / 2 - 2
					if (isRunning & TIMER_TYPE_COVERS_BEGIN) and not self.blinkTimer.getBlinkState():
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, None))
					else:
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_post_pixmap))
				elif timerPixmaps & TIMER_TYPE_ADD_COVERS_BEGIN:
					posY = 2
					height = self.itemHeight / 2 - 2
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_add_pixmap))
				if timerPixmaps & TIMER_TYPE_ADD:
					posY = 2
					height = self.itemHeight - 4
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, offsetRight, posY, 8, height, self.timer_add_pixmap))
					
		if config.plugins.merlinEpgCenter.showDuration.value:
			width = self.maxWidth * 9 / 100
			offsetRight = offsetRight - width - 5
			res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetRight, 0, width, self.itemHeight, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, remainBeginString, progColor))
		else:
			width = self.maxWidth * 6 / 100
			offsetRight = offsetRight - width
			res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetRight, 0, width, self.itemHeight, 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, remainBeginString, progColor))
			
		if config.plugins.merlinEpgCenter.showDuration.value:
			width = self.maxWidth * 6 / 100
			offsetRight = offsetRight - width
			
		# TODO description + short laenger machen wenn showDuration aus ist
		if self.listStyle == STYLE_SINGLE_LINE:
			res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, 0, offsetRight - offsetLeft, self.itemHeight, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, title, textColor))
		elif self.listStyle == STYLE_SHORT_DESCRIPTION:
			if short and title != short:
				res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, border, offsetRight - offsetLeft, self.halfItemHeight - border, 1, RT_HALIGN_LEFT|RT_VALIGN_TOP, title, textColor))
				res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, self.halfItemHeight, offsetRight - offsetLeft, self.halfItemHeight - border, 2, RT_HALIGN_LEFT|RT_VALIGN_TOP, short, secondLineColor))
			else:
				res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetLeft, 0, offsetRight - offsetLeft, self.itemHeight, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, title, textColor))
			
		if config.plugins.merlinEpgCenter.showDuration.value:
			res.append((eListboxPythonMultiContent.TYPE_TEXT, offsetRight, 0, width, self.itemHeight, 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, duraString, textColor))
		
		return res
Ejemplo n.º 58
0
    def applySkin(self, desktop, screen):
        def retValue(val, limit, default, Min=False):
            try:
                if Min:
                    x = min(limit, int(val))
                else:
                    x = max(limit, int(val))
            except:
                x = default
            return x

        def setWrapFlag(attrib, value):
            if (attrib.lower() == "wrap" and value == "0") or \
               (attrib.lower() == "nowrap" and value != "0"):
                self.txtflags &= ~RT_WRAP
            else:
                self.txtflags |= RT_WRAP

        self.halign = valign = eLabel.alignLeft
        if self.skinAttributes:
            attribs = []
            for (attrib, value) in self.skinAttributes:
                if attrib == "font":
                    self.txfont = parseFont(value, ((1, 1), (1, 1)))
                elif attrib == "foregroundColor":
                    self.scroll_label.setForegroundColor(parseColor(value))
                elif attrib in ("shadowColor",
                                "borderColor"):  # fake for openpli-enigma2
                    self.scroll_label.setShadowColor(parseColor(value))
                elif attrib == "shadowOffset":
                    x, y = value.split(',')
                    self.soffset = (int(x), int(y))
                    self.scroll_label.setShadowOffset(ePoint(self.soffset))
                elif attrib == "borderWidth":  # fake for openpli-enigma2
                    self.soffset = (-int(value), -int(value))
                elif attrib == "valign" and value in ("top", "center",
                                                      "bottom"):
                    valign = {
                        "top": eLabel.alignTop,
                        "center": eLabel.alignCenter,
                        "bottom": eLabel.alignBottom
                    }[value]
                    self.txtflags |= {
                        "top": RT_VALIGN_TOP,
                        "center": RT_VALIGN_CENTER,
                        "bottom": RT_VALIGN_BOTTOM
                    }[value]
                elif attrib == "halign" and value in ("left", "center",
                                                      "right", "block"):
                    self.halign = {
                        "left": eLabel.alignLeft,
                        "center": eLabel.alignCenter,
                        "right": eLabel.alignRight,
                        "block": eLabel.alignBlock
                    }[value]
                    self.txtflags |= {
                        "left": RT_HALIGN_LEFT,
                        "center": RT_HALIGN_CENTER,
                        "right": RT_HALIGN_RIGHT,
                        "block": RT_HALIGN_BLOCK
                    }[value]
                elif attrib == "noWrap":
                    setWrapFlag(attrib, value)
                elif attrib == "options":
                    options = value.split(',')
                    for o in options:
                        if '=' in o:
                            opt, val = (x.strip() for x in o.split('=', 1))
                        else:
                            opt, val = o.strip(), ""

                        if opt == "":
                            continue
                        elif opt in ("wrap", "nowrap"):
                            setWrapFlag(opt, val)
                        elif opt == "movetype" and val in ("none", "running",
                                                           "swimming"):
                            self.type = {
                                "none": NONE,
                                "running": RUNNING,
                                "swimming": SWIMMING
                            }[val]
                        elif opt == "direction" and val in ("left", "right",
                                                            "top", "bottom"):
                            self.direction = {
                                "left": LEFT,
                                "right": RIGHT,
                                "top": TOP,
                                "bottom": BOTTOM
                            }[val]
                        elif opt == "step" and val:
                            self.mStep = retValue(val, 1, self.mStep)
                        elif opt == "steptime" and val:
                            self.mStepTimeout = retValue(
                                val, 25, self.mStepTimeout)
                        elif opt == "startdelay" and val:
                            self.mStartDelay = retValue(
                                val, 0, self.mStartDelay)
                        elif opt == "pause" and val:
                            self.mLoopTimeout = retValue(
                                val, 0, self.mLoopTimeout)
                        elif opt == "oneshot" and val:
                            self.mOneShot = retValue(val, 0, self.mOneShot)
                        elif opt == "repeat" and val:
                            self.mRepeat = retValue(val, 0, self.mRepeat)
                        elif opt == "always" and val:
                            self.mAlways = retValue(val, 0, self.mAlways)
                        elif opt == "startpoint" and val:
                            self.mStartPoint = int(val)
                        elif opt == "pagedelay" and val:
                            self.mPageDelay = retValue(val, 0, self.mPageDelay)
                        elif opt == "pagelength" and val:
                            self.mPageLength = retValue(
                                val, 0, self.mPageLength)
                else:
                    attribs.append((attrib, value))
                    if attrib == "backgroundColor":
                        self.scroll_label.setBackgroundColor(parseColor(value))
                    elif attrib == "transparent":
                        self.scroll_label.setTransparent(int(value))

            self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, screen)

        if self.mOneShot: self.mOneShot = max(self.mStepTimeout, self.mOneShot)
        if self.mLoopTimeout:
            self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout)
        if self.mPageDelay:
            self.mPageDelay = max(self.mStepTimeout, self.mPageDelay)

        self.scroll_label.setFont(self.txfont)
        if not (self.txtflags & RT_WRAP):
            self.scroll_label.setNoWrap(1)
        self.scroll_label.setVAlign(valign)
        self.scroll_label.setHAlign(self.halign)
        self.scroll_label.move(ePoint(0, 0))
        self.scroll_label.resize(eSize(self.W, self.H))
        # test for auto correction text height:
        if self.direction in (TOP, BOTTOM):
            from enigma import fontRenderClass
            flh = int(fontRenderClass.getInstance().getLineHeight(self.txfont)
                      or self.txfont.pointSize / 6 + self.txfont.pointSize)
            self.scroll_label.setText("WQq")
            if flh > self.scroll_label.calculateSize().height():
                self.lineHeight = flh
            self.scroll_label.setText("")
        return ret
Ejemplo n.º 59
0
		def foregroundColorServiceSelected(value):
			self.l.setColor(eListboxServiceContent.serviceSelected, parseColor(value))
Ejemplo n.º 60
0
 def colorServiceSelectedFallback(value):
     self.l.setColor(eListboxServiceContent.serviceSelectedFallback,
                     parseColor(value))