Exemplo n.º 1
0
def VirtualKeyBoardEntryComponent(keys, selectedKey, shiftMode=False):
    key_bg = LoadPixmap(cached=True,
                        path=resolveFilename(SCOPE_CURRENT_SKIN,
                                             "skin_default/vkey_bg.png"))
    key_bg_width = key_bg.size().width()
    if shiftMode:
        key_images = KEY_IMAGES_SHIFT
    else:
        key_images = KEY_IMAGES
    res = [(keys)]
    x = 0
    count = 0
    for count, key in enumerate(keys):
        width = None
        png = key_images.get(key, None)
        if png:
            pixmap = LoadPixmap(cached=True,
                                path=resolveFilename(SCOPE_CURRENT_SKIN, png))
            width = pixmap.size().width()
            res.append(
                MultiContentEntryPixmapAlphaTest(pos=(x, 0),
                                                 size=(width, 45),
                                                 png=pixmap))
        else:
            width = key_bg_width
            res.extend((MultiContentEntryPixmapAlphaTest(pos=(x, 0),
                                                         size=(width, 45),
                                                         png=key_bg),
                        MultiContentEntryText(pos=(x, 0),
                                              size=(width, 45),
                                              font=0,
                                              text=key.encode("utf-8"),
                                              flags=RT_HALIGN_CENTER
                                              | RT_VALIGN_CENTER)))
        if selectedKey == count:
            key_sel = LoadPixmap(cached=True,
                                 path=resolveFilename(
                                     SCOPE_CURRENT_SKIN,
                                     "skin_default/vkey_sel.png"))
            width = key_sel.size().width()
            res.append(
                MultiContentEntryPixmapAlphaTest(pos=(x, 0),
                                                 size=(width, 45),
                                                 png=key_sel))
        if width is not None:
            x += width
        else:
            x += 45
    return res
Exemplo n.º 2
0
def MultiContentEntryFormattedText(pos=(0, 0),
                                   size=(0, 0),
                                   fontSize=Size.MEDIUM,
                                   flags=RT_HALIGN_LEFT | RT_VALIGN_TOP,
                                   text="",
                                   color=None,
                                   color_sel=None,
                                   backcolor=None,
                                   backcolor_sel=None,
                                   border_width=None,
                                   border_color=None):
    if ("[B]" in text and "[/B]" in text) or ("[b]" in text
                                              and "[/b]" in text):
        if fontSize == Size.SMALL:
            font = Font.BOLD_SMALL
        elif fontSize == Size.MEDIUM:
            font = Font.BOLD_MEDIUM
        elif fontSize == Size.BIG:
            font = Font.BOLD_BIG
        if color is None:
            color = Color.YELLOW_MILD
    elif ("[I]" in text and "[/I]" in text) or ("[i]" in text
                                                and "[/i]" in text):
        if fontSize == Size.SMALL:
            font = Font.ITALIC_SMALL
        elif fontSize == Size.MEDIUM:
            font = Font.ITALIC_MEDIUM
        elif fontSize == Size.BIG:
            font = Font.ITALIC_BIG
        else:
            font = Font.ITALIC_SMALL
    else:
        if fontSize == Size.SMALL:
            font = Font.REGULAR_SMALL
        elif fontSize == Size.MEDIUM:
            font = Font.REGULAR_MEDIUM
        elif fontSize == Size.BIG:
            font = Font.REGULAR_BIG
        else:
            font = Font.REGULAR_MEDIUM
    text = text.replace("[B]", "").replace("[/B]",
                                           "").replace("[b]",
                                                       "").replace("[/b]", "")
    text = text.replace("[I]", "").replace("[/I]",
                                           "").replace("[i]",
                                                       "").replace("[/i]", "")
    return MultiContentEntryText(pos, size, font, flags, text, color,
                                 color_sel, backcolor, backcolor_sel,
                                 border_width, border_color)
Exemplo n.º 3
0
def RSListEntry(download):
    res = [download]
    white = 16777215
    grey = 11776953
    green = 3707926
    black = 0
    yellow = 15053379
    blue = 11577
    red = 15758933
    col = int('0xffffff', 16)
    colsel = int('0xf07655', 16)
    backcol = int('0x000000', 16)
    backsel = int('0x000000', 16)
    if HD.width() > 1280:
        res.append(
            MultiContentEntryText(pos=(0, 6),
                                  size=(1700, 45),
                                  font=7,
                                  text=download,
                                  color=col,
                                  color_sel=colsel,
                                  backcolor=backcol,
                                  backcolor_sel=backcol,
                                  flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER))
    else:
        res.append(
            MultiContentEntryText(pos=(0, 0),
                                  size=(1700, 45),
                                  font=2,
                                  text=download,
                                  color=col,
                                  color_sel=colsel,
                                  backcolor=backcol,
                                  backcolor_sel=backcol,
                                  flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER))
    return res
Exemplo n.º 4
0
def MenuEntryItem(entry):
    res = [entry]
    screenwidth = getDesktop(0).size().width()
    if screenwidth and screenwidth == 1920:
        res.append(
            MultiContentEntryPixmapAlphaBlend(pos=(15, 8),
                                              size=(60, 60),
                                              png=entry[0]))  # png vorn
        res.append(
            MultiContentEntryText(pos=(90, 15),
                                  size=(660, 60),
                                  font=0,
                                  text=entry[1]))  # menupunkt
    else:
        res.append(
            MultiContentEntryPixmapAlphaBlend(pos=(10, 5),
                                              size=(40, 40),
                                              png=entry[0]))  # png vorn
        res.append(
            MultiContentEntryText(pos=(60, 10),
                                  size=(440, 40),
                                  font=0,
                                  text=entry[1]))  # menupunkt
    return res
Exemplo n.º 5
0
def PluginCategoryComponent(name, png, width=440):
    screenwidth = getDesktop(0).size().width()
    if screenwidth and screenwidth == 1920:
        return [
            name,
            MultiContentEntryText(pos=(110, 15),
                                  size=(width - 80, 35),
                                  font=2,
                                  text=name),
            MultiContentEntryPixmapAlphaBlend(pos=(10, 0),
                                              size=(90, 75),
                                              png=png)
        ]
    else:
        return [
            name,
            MultiContentEntryText(pos=(80, 5),
                                  size=(width - 80, 25),
                                  font=0,
                                  text=name),
            MultiContentEntryPixmapAlphaBlend(pos=(10, 0),
                                              size=(60, 50),
                                              png=png)
        ]
Exemplo n.º 6
0
 def ListToMulticontent(self):
     res = []
     theevents = []
     self.data=process_mode(self.param)
     if dwidth == 1280:        
      self['list'].l.setItemHeight(40)
      self['list'].l.setFont(0, gFont('Regular', 24))        
      for i in range(0, len(self.data)):
         model=str(self.data[i][0])
         res.append(MultiContentEntryText(pos=(0, 5), size=(2, 30), font=0, flags=RT_HALIGN_LEFT, text='', color=16776960, color_sel=16777215))
         res.append(MultiContentEntryText(pos=(60, 5), size=(540, 30), font=0, flags=RT_HALIGN_LEFT, text=model, color=16776960, color_sel=16777215))
         theevents.append(res)
         res = []
     else:
      self['list'].l.setItemHeight(62)
      self['list'].l.setFont(0, gFont('Regular', 38))        
      for i in range(0, len(self.data)):
         model=str(self.data[i][0])
         res.append(MultiContentEntryText(pos=(0, 5), size=(2, 44), font=0, flags=RT_HALIGN_LEFT, text='', color=16776960, color_sel=16777215))
         res.append(MultiContentEntryText(pos=(60, 7), size=(540, 44), font=0, flags=RT_HALIGN_LEFT, text=model, color=16776960, color_sel=16777215))
         theevents.append(res)
         res = []
     self['list'].l.setList(theevents)
     self['list'].show()
Exemplo n.º 7
0
def DevicesEntryComponent(device):
    png = LoadPixmap(cached=True,
                     path=resolveFilename(
                         SCOPE_PLUGINS,
                         "Extensions/SmartControl/icons/device.png"))
    x, y, w, h = (120, 5, 480, 32)
    x1, y1, w1, h1 = (120, 50, 480, 28)
    x2, y2, w2, h2 = (5, 5, 100, 100)

    return [
        device,
        MultiContentEntryText(pos=(x, y),
                              size=(w, h),
                              font=0,
                              text=device["name"]),
        MultiContentEntryText(pos=(x1, y1),
                              size=(w1, h1),
                              font=1,
                              text=device["model"]),
        MultiContentEntryPixmapAlphaTest(pos=(x2, y2),
                                         size=(w2, h2),
                                         options=BT_SCALE,
                                         png=png)
    ]
Exemplo n.º 8
0
def PluginEntryComponent(plugin):

    if plugin.icon is None:
        png = LoadPixmap(
            resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/plugin.png"))
    else:
        png = plugin.icon
    x, y, w, h = skin.parameters.get("PluginListName", (120, 5, 700, 25))
    x1, y1, w1, h1 = skin.parameters.get("PluginListDescription",
                                         (120, 26, 700, 17))
    x2, y2, w2, h2 = skin.parameters.get("PluginListIcon", (10, 5, 100, 40))

    return [
        plugin,
        MultiContentEntryText(pos=(x, y),
                              size=(w, h),
                              font=0,
                              text=plugin.name),
        MultiContentEntryText(pos=(x1, y1),
                              size=(w1, h1),
                              font=1,
                              text=plugin.description),
        MultiContentEntryPixmapAlphaTest(pos=(x2, y2), size=(w2, h2), png=png)
    ]
Exemplo n.º 9
0
def PluginDownloadComponent(plugin, name, width=440):
    if plugin.icon is None:
        png = LoadPixmap(
            resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/plugin.png"))
    else:
        png = plugin.icon

    x, y, h = skin.parameters.get("PluginBrowserDownloadName", (120, 5, 25))
    dx, dy, dh = skin.parameters.get("PluginBrowserDownloadDescr",
                                     (120, 26, 17))
    ix, iy, iw, ih = skin.parameters.get("PluginBrowserDownloadIcon",
                                         (10, 0, 100, 50))
    return [
        plugin,
        MultiContentEntryText(pos=(x, y),
                              size=(width - x, h),
                              font=0,
                              text=name),
        MultiContentEntryText(pos=(dx, dy),
                              size=(width - dx, dh),
                              font=1,
                              text=plugin.description),
        MultiContentEntryPixmapAlphaTest(pos=(ix, iy), size=(iw, ih), png=png)
    ]
Exemplo n.º 10
0
 def updateList(self):
     for i in self.entrylist:
         res = [i]
         res.append(
             MultiContentEntryText(pos=(60, 5),
                                   size=(300, 48),
                                   font=0,
                                   text=i[0]))
         picture = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, i[2]))
         res.append(
             MultiContentEntryPixmapAlphaTest(pos=(5, 1),
                                              size=(48, 48),
                                              png=picture))
         self.list.append(res)
     self['list'].l.setList(self.list)
Exemplo n.º 11
0
    def ListToMulticontent(self):
        res = []
        theevents = []
        self.data=process_mode(None)		
        if dwidth == 1280:
            self['text'].l.setItemHeight(34)
            self['text'].l.setFont(0, gFont('Sansation-Bold', 28))
            for i in range(0, len(self.data)):	
                res.append(MultiContentEntryText(pos=(0, 5), size=(2, 35), font=0, flags=RT_HALIGN_LEFT, text=''))
                res.append(MultiContentEntryText(pos=(30, 5), size=(720, 35), font=0, flags=RT_HALIGN_LEFT, text=str(self.data[i][0])))
                theevents.append(res)
                res = []

        else:
            self['text'].l.setItemHeight(50)
            self['text'].l.setFont(0, gFont('Sansation-Bold', 40))
            for i in range(0, len(self.data)):			
                res.append(MultiContentEntryText(pos=(0, 5), size=(2, 50), font=0, flags=RT_HALIGN_LEFT, text=''))
                res.append(MultiContentEntryText(pos=(30, 2), size=(720, 50), font=0, flags=RT_HALIGN_LEFT, text=str(self.data[i][0])))
                theevents.append(res)
                res = []

        self['text'].l.setList(theevents)
        self['text'].show()
 def showmenulist(self, datalist):
     cacolor = 16776960
     cbcolor = 16753920
     cccolor = 15657130
     cdcolor = 16711680
     cecolor = 16729344
     cfcolor = 65407
     cgcolor = 11403055
     chcolor = 13047173
     cicolor = 13789470
     scolor = cbcolor
     res = []
     menulist = []
     if reswidth == 1280:
         self['menu'].l.setItemHeight(50)
         self['menu'].l.setFont(0, gFont('Regular', 28))
     else:
         self['menu'].l.setItemHeight(75)
         self['menu'].l.setFont(0, gFont('Regular', 42))
     for i in range(0, len(datalist)):
         txt = datalist[i][1]
         if reswidth == 1280:
               png = os_path.join(resolveFilename(SCOPE_PLUGINS, 'Extensions/KeyAdder/buttons/%s.png' % datalist[i][2]))
         else:
               png = os_path.join(resolveFilename(SCOPE_PLUGINS, 'Extensions/KeyAdder/buttons/fhd/%s.png' % datalist[i][2]))
         res.append(MultiContentEntryText(pos=(0, 1), size=(0, 0), font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER | RT_WRAP, text='', color=scolor, color_sel=cccolor, border_width=3, border_color=806544))
         if reswidth == 1280:
             res.append(MultiContentEntryText(pos=(60, 1), size=(723, 50), font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER | RT_WRAP, text=str(txt), color=16777215, color_sel=16777215))
             res.append(MultiContentEntryPixmapAlphaTest(pos=(5, 5), size=(40, 40), png=loadPNG(png)))
         else:
             res.append(MultiContentEntryText(pos=(100, 1), size=(1080, 75), font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER | RT_WRAP, text=str(txt), color=16777215, color_sel=16777215))
             res.append(MultiContentEntryPixmapAlphaTest(pos=(5, 5), size=(75, 75), png=loadPNG(png)))
         menulist.append(res)
         res = []
     self['menu'].l.setList(menulist)
     self['menu'].show()
Exemplo n.º 13
0
	def virtualKeyBoardEntryComponent(self, keys):
		res = [keys]
		text = []
		offset = 14 - self.keyboardWidth  # 14 represents the maximum buttons per row as defined here and in the skin (14 x self.width).
		x = self.width * offset / 2
		if offset % 2:
			x += self.width / 2
		for key in keys:
			image = self.keyImages[self.shiftLevel].get(key, None)
			if image:
				width = image.size().width()
				res.append(MultiContentEntryPixmapAlphaBlend(pos=(x, 0), size=(width, self.height), png=image))
			else:
				width = self.width
				res.append(MultiContentEntryPixmapAlphaBlend(pos=(x, 0), size=(width, self.height), png=self.keyBackgrounds.get(key.split("__")[0], self.key_bg)))
				if "__" in key:
					key = key.split("__")[1] if not "__HIDE" in key else u""
				if len(key) > 1:  # NOTE: UTF8 / Unicode glyphs only count as one character here.
					text.append(MultiContentEntryText(pos=(x, 0), size=(width, self.height), font=1, flags=RT_HALIGN_CENTER | RT_VALIGN_CENTER, text=_(key.encode("utf-8")), color=self.shiftColors[self.shiftLevel]))
				else:
					text.append(MultiContentEntryText(pos=(x, 0), size=(width, self.height), font=0, flags=RT_HALIGN_CENTER | RT_VALIGN_CENTER, text=key.encode("utf-8"), color=self.shiftColors[self.shiftLevel]))

			x += width
		return res + text
Exemplo n.º 14
0
 def hauptListEntry(self, dir, name, value):
     res = [(dir, name, value)]
     if HD.width() > 1280:
         icon = '/usr/lib/enigma2/python/Plugins/Extensions/NGsetting/Panel/redpanel.png'
     else:
         icon = '/usr/lib/enigma2/python/Plugins/Extensions/NGsetting/Panel/redpanel_hd.png'
     if value == '1':
         if HD.width() > 1280:
             icon = '/usr/lib/enigma2/python/Plugins/Extensions/NGsetting/Panel/greenpanel.png'
         else:
             icon = '/usr/lib/enigma2/python/Plugins/Extensions/NGsetting/Panel/greenpanel_hd.png'
     try:
         name = name.split('   ')[0]
     except:
         pass
     if HD.width() > 1280:
         res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 14), size=(30, 30), png=loadPic(icon, 30, 30, 0, 0, 0, 1)))
         res.append(MultiContentEntryText(pos=(70, 7), size=(425, 40), font=0, text=name, flags=RT_HALIGN_LEFT))
     else:
         res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 11), size=(20, 20), png=loadPic(icon, 20, 20, 0, 0, 0, 1)))
         res.append(MultiContentEntryText(pos=(50, 7), size=(425, 40), font=0, text=name, flags=RT_HALIGN_LEFT))
     res.append(MultiContentEntryText(pos=(0, 0), size=(0, 0), font=0, text=dir, flags=RT_HALIGN_LEFT))
     res.append(MultiContentEntryText(pos=(0, 0), size=(0, 0), font=0, text=value, flags=RT_HALIGN_LEFT))
     return res
 def ListEntry(self, entry):
     x, y, w, h = skin.parameters.get("FileListName", (10, 0, 1180, 25))
     x = 10
     w = self['list_left'].l.getItemSize().width()
     flags = RT_HALIGN_LEFT
     if 'Plugins.Extensions.FileCommander.addons.unzip.UnpackInfoScreen' in self:
         flags = RT_HALIGN_LEFT | RT_VALIGN_CENTER
         y *= 2
     return [
         entry,
         MultiContentEntryText(pos=(x, int(y)),
                               size=(w - x, h),
                               font=0,
                               flags=flags,
                               text=entry[0])
     ]
Exemplo n.º 16
0
def PPListEntry(name, idx):
    name = ''
    res = [name]
    if idx == 0:
        idx = 'fav'
    elif idx == 1:
        idx = 'station'
    elif idx == 2:
        idx = 'about'
    elif idx == 3:
        idx = 'update'
    png = resolveFilename(SCOPE_PLUGINS, 'Extensions/PurePrestige/Applications//NetRadioPersian/icons/%s.png' % str(idx))
    if fileExists(png):
        res.append(MultiContentEntryPixmapAlphaTest(pos=(65, 0), size=(457, 90), png=loadPNG(png)))
    res.append(MultiContentEntryText(pos=(0, 3), size=(800, 90), font=0, text=name))
    return res
Exemplo n.º 17
0
def IniciaSelListEntryFaqs(texto, yavista=False):
    global carpetaimg
    res = [texto]
    res.append(
        MultiContentEntryText(pos=(35, 4), size=(1000, 30), font=0,
                              text=texto))
    if not yavista:
        imagen = 'question.png'
    else:
        imagen = 'info.png'
    png = '' + carpetaimg + '' + imagen + ''
    if fileExists(png):
        fpng = LoadPixmap(png)
        res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 2, 2, 24,
                    24, fpng))
    return res
Exemplo n.º 18
0
    def CategoryListEntry(self, name, value="0", icon="DEFAULT"):
        if icon == "DEFAULT":
            icon = self.sort
        png = "/usr/lib/enigma2/python/Plugins/Extensions/MyMetrix/images/" + icon + ".png"
        res = [[value, name]]
        res.append(
            MultiContentEntryPixmapAlphaTest(pos=(25, 6),
                                             size=(170, 32),
                                             png=loadPNG(png)))

        res.append(
            MultiContentEntryText(pos=(80, 4),
                                  size=(405, 45),
                                  font=0,
                                  text=_(name)))
        return res
Exemplo n.º 19
0
        def createDateText(datetext, ext, color, recording):
            #print("MVC: MovieCenterGUI: buildMovieCenterEntry: createDateText: %s, startHPos: %s, remainingWidth: %s" % (datetext, self.startHPos, self.remainingWidth))
            x = xPos(self.MVCDateHPos, self.startHPos)
            y = yPos(self.l.getItemSize().height(), self.MVCDateFont.pointSize,
                     self.MVCDateVPos)

            halign = RT_HALIGN_LEFT

            if ext not in plyAll:
                alignment = config.MVC.count_size_position.value

                if alignment == '1':
                    halign = RT_HALIGN_RIGHT
                elif alignment == '2':
                    halign = RT_HALIGN_LEFT
                else:
                    halign = RT_HALIGN_CENTER

            if recording:
                if self.MVCRecIconHPos is None:
                    x = x + (self.MVCDateWidth -
                             self.MVCRecIconSize.width()) / 2
                else:
                    x = x + self.MVCRecIconHPos

                y = yPos(self.l.getItemSize().height(),
                         self.MVCRecIconSize.height(), self.MVCRecIconVPos)

                self.res.append(
                    MultiContentEntryPixmapAlphaBlend(
                        pos=(x, y),
                        size=(self.MVCRecIconSize.width(),
                              self.MVCRecIconSize.height()),
                        png=self.pic_recording,
                        **{}))
            else:
                self.res.append(
                    MultiContentEntryText(pos=(x, y),
                                          size=(self.MVCDateWidth,
                                                self.l.getItemSize().height()),
                                          font=self.usedDateFont,
                                          text=datetext,
                                          color=color,
                                          color_sel=self.FrontColorSel,
                                          flags=halign))
            self.startHPos = x + self.MVCDateWidth + self.MVCSpacer
            self.remainingWidth = self.width - self.startHPos
Exemplo n.º 20
0
	def setEntries(self,data = None):
		if data is None:
			return
		res = [None]
		for x in data:
			res.append(MultiContentEntryText(
				pos = (x[0], 0),
				size = (x[1], 24),
				font = 0, flags = RT_HALIGN_CENTER | RT_VALIGN_TOP,
				text = x[2],
				color = 0x00C0C0C0,
				backcolor = 0x25474738,
				color_sel = 0x00FFFFFF,
				backcolor_sel = 0x00204060,
				border_width = 1,
				border_color = 0x000C4E90))
		self.l.setList([res])
Exemplo n.º 21
0
def PluginCategoryComponent(name, png, width=440):
    x, y, h = skin.parameters.get(
        "PluginBrowserDownloadName",
        (skin.applySkinFactor(80), skin.applySkinFactor(5),
         skin.applySkinFactor(25)))
    ix, iy, iw, ih = skin.parameters.get(
        "PluginBrowserDownloadIcon",
        (skin.applySkinFactor(10), skin.applySkinFactor(0),
         skin.applySkinFactor(60), skin.applySkinFactor(50)))
    return [
        name,
        MultiContentEntryText(pos=(x, y),
                              size=(width - x, h),
                              font=0,
                              text=name),
        MultiContentEntryPixmapAlphaBlend(pos=(ix, iy), size=(iw, ih), png=png)
    ]
Exemplo n.º 22
0
	def virtualKeyBoardEntryComponent(self, keys):
		key_bg_width = self.key_bg and self.key_bg.size().width() or 45
		key_images = self.shiftMode and self.keyImagesShift or self.keyImages
		res = [(keys)]
		text = []
		x = 0
		for key in keys:
			png = key_images.get(key, None)
			if png:
				width = png.size().width()
				res.append(MultiContentEntryPixmapAlphaTest(pos=(x, 0), size=(width, 45), png=png))
			else:
				width = key_bg_width
				res.append(MultiContentEntryPixmapAlphaTest(pos=(x, 0), size=(width, 45), png=self.key_bg))
				text.append(MultiContentEntryText(pos=(x, 0), size=(width, 45), font=0, text=key.encode("utf-8"), flags=RT_HALIGN_CENTER | RT_VALIGN_CENTER))
			x += width
		return res + text
Exemplo n.º 23
0
def QuickMenuEntryComponent(name,
                            description,
                            long_description=None,
                            width=540):
    pngname = name.replace(' ', '_')
    png = LoadPixmap(
        '/usr/lib/enigma2/python/Plugins/Extensions/Infopanel/icons/' +
        pngname + '.png')
    if png is None:
        png = LoadPixmap(
            '/usr/lib/enigma2/python/Plugins/Extensions/Infopanel/icons/default.png'
        )
    screenwidth = getDesktop(0).size().width()
    if screenwidth and screenwidth == 1920:
        width *= 1.5
        return [
            _(name),
            MultiContentEntryText(pos=(90, 5),
                                  size=(width - 90, 38),
                                  font=0,
                                  text=_(name)),
            MultiContentEntryText(pos=(90, 38),
                                  size=(width - 90, 30),
                                  font=1,
                                  text=_(description)),
            MultiContentEntryPixmapAlphaBlend(pos=(15, 8),
                                              size=(60, 60),
                                              png=png),
            MultiContentEntryText(pos=(0, 0),
                                  size=(0, 0),
                                  font=0,
                                  text=_(long_description))
        ]
    else:
        return [
            _(name),
            MultiContentEntryText(pos=(60, 3),
                                  size=(width - 60, 25),
                                  font=0,
                                  text=_(name)),
            MultiContentEntryText(pos=(60, 25),
                                  size=(width - 60, 20),
                                  font=1,
                                  text=_(description)),
            MultiContentEntryPixmapAlphaBlend(pos=(10, 5),
                                              size=(40, 40),
                                              png=png),
            MultiContentEntryText(pos=(0, 0),
                                  size=(0, 0),
                                  font=0,
                                  text=_(long_description))
        ]
        return
Exemplo n.º 24
0
def CmenuListEntry(name, idx):
    res = [name]
    if idx == 0:
        png = '/usr/lib/enigma2/python/Plugins/Extensions/TUVUPanel/images/guia.png'
    elif idx == 1:
        png = '/usr/lib/enigma2/python/Plugins/Extensions/TUVUPanel/images/guia.png'
    if idx == 2:
        png = '/usr/lib/enigma2/python/Plugins/Extensions/TUVUPanel/images/guia.png'    
    elif idx == 3:
        png = '/usr/lib/enigma2/python/Plugins/Extensions/TUVUPanel/images/guia.png'
    if idx == 4:
        png = '/usr/lib/enigma2/python/Plugins/Extensions/TUVUPanel/images/guia.png'
    elif idx == 5:
        png = '/usr/lib/enigma2/python/Plugins/Extensions/TUVUPanel/images/guia.png'        
    if fileExists(png):
        res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 7), size=(100, 120), png=loadPNG(png)))
        res.append(MultiContentEntryText(pos=(80, 10), size=(500, 120), font=0, text=name))
    return res        
Exemplo n.º 25
0
 def UnpackListEntry(self, entry):
     # print "[ArchiverMenuScreen] UnpackListEntry", entry
     currentProgress = int(float(100) / float(int(100)) * int(entry))
     progpercent = str(currentProgress) + "%"
     # color2 = 0x00ffffff  # White
     textColor = 0x00808080  # Grey
     return [
         entry,
         MultiContentEntryProgress(pos=(10, 0),
                                   size=(560, 30),
                                   percent=int(currentProgress)),
         MultiContentEntryText(pos=(10, 3),
                               size=(560, 30),
                               font=0,
                               flags=RT_HALIGN_CENTER | RT_VALIGN_CENTER,
                               text=str(progpercent),
                               color=textColor)
     ]
Exemplo n.º 26
0
        def createProgressValue(progress, color):
            #print("MVC: MovieCenterGUI: buildMovieCenterEntry: createProgressValue: progress: %s, startHPos: %s, remainingWidth: %s" % (progress, self.startHPos, self.remainingWidth))
            x = xPos(self.MVCProgressHPos, self.startHPos)
            y = yPos(self.l.getItemSize().height(), self.MVCFont.pointSize,
                     self.MVCProgressVPos)

            if config.MVC.movie_progress.value == "P":
                self.res.append(
                    MultiContentEntryText(pos=(x, y),
                                          size=(self.MVCBarSize.width(),
                                                self.l.getItemSize().height()),
                                          font=self.usedFont,
                                          flags=RT_HALIGN_CENTER,
                                          text="%d%%" % (progress),
                                          color=color,
                                          color_sel=self.FrontColorSel))
                self.startHPos = x + self.MVCBarSize.width() + self.MVCSpacer
                self.remainingWidth = self.width - self.startHPos
Exemplo n.º 27
0
    def buildMovieListEntry(self, serviceref, info, begin, length):
        res = [None]
        width = self.l.getItemSize().width()
        date = _("Record date:") + ' ' + self.getDate(serviceref)
        time = _("Record time:") + ' ' + self.getTime(serviceref)
        description = serviceref.getShortDescription()
        filesize = float(getServiceSize(serviceref.getPath()) / (1024 * 1024))
        if filesize <= 999:
            size = "%d MB" % (filesize)
        else:
            format_string = "%%.%sf GB" % (
                config.AdvancedMovieSelection.filesize_digits.value)
            size = (format_string) % (filesize / 1000.0)

        res.append(
            MultiContentEntryText(pos=(5, 2),
                                  size=(width - 155, 26),
                                  font=0,
                                  flags=RT_HALIGN_LEFT,
                                  text=serviceref.getName()))
        res.append(
            MultiContentEntryText(pos=(width - 155, 2),
                                  size=(150, 26),
                                  font=0,
                                  flags=RT_HALIGN_RIGHT,
                                  text=size))
        res.append(
            MultiContentEntryText(pos=(5, 29),
                                  size=(width - 205, 22),
                                  font=1,
                                  flags=RT_HALIGN_LEFT,
                                  text=description))
        res.append(
            MultiContentEntryText(pos=(width - 205, 29),
                                  size=(200, 22),
                                  font=1,
                                  flags=RT_HALIGN_RIGHT,
                                  text=time))
        res.append(
            MultiContentEntryText(pos=(5, 54),
                                  size=(width - 205, 20),
                                  font=2,
                                  flags=RT_HALIGN_LEFT,
                                  text=os.path.dirname(serviceref.getPath())))
        res.append(
            MultiContentEntryText(pos=(width - 255, 54),
                                  size=(250, 22),
                                  font=2,
                                  flags=RT_HALIGN_RIGHT,
                                  text=date))
        return res
Exemplo n.º 28
0
def CCcamListEntry(name, idx):
	res = [name]
	if idx == 10:
		idx = "red"
	elif idx == 11:
		idx = "green"
	elif idx == 12:
		idx = "yellow"
	elif idx == 13:
		idx = "blue"
	elif idx == 14:
		idx = "menu"
	elif idx == 15:
		idx = "info"
	png = "/usr/share/enigma2/skin_default/buttons/key_%s.png" % str(idx)
	if fileExists(png):
		res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 0), size=(35, 25), png=loadPNG(png)))
	res.append(MultiContentEntryText(pos=(40, 3), size=(500, 25), font=0, text=name))
	return res
Exemplo n.º 29
0
 def buildMovieListEntry(self, serviceref, info, begin, length):
     res = [ None ]
     width = self.l.getItemSize().width()
     date = _("Record date:") + ' ' + self.getDate(serviceref)
     time = _("Record time:") + ' ' + self.getTime(serviceref)
     description = serviceref.getShortDescription()
     filesize = realSize(getServiceSize(serviceref.getPath()), int(config.AdvancedMovieSelection.filesize_digits.value))
     res.append(MultiContentEntryText(pos=(self.line1Pos.x(), self.line1Pos.y()), size=(width - self.line1Pos.x() - self.line1Split, self.f0h), font=0, flags=RT_HALIGN_LEFT, text=serviceref.getName()))
     res.append(MultiContentEntryText(pos=(self.line2Pos.x(), self.line2Pos.y()), size=(width - self.line2Pos.x() - self.line2Split, self.f1h), font=1, flags=RT_HALIGN_LEFT, text=description))
     res.append(MultiContentEntryText(pos=(self.line3Pos.x(), self.line3Pos.y()), size=(width - self.line3Pos.x() - self.line3Split, self.f2h), font=2, flags=RT_HALIGN_LEFT, text=os.path.dirname(serviceref.getPath())))
     res.append(MultiContentEntryText(pos=(width - self.line1Split, self.line1Pos.y()), size=(self.line1Split - self.line1Pos.x(), self.f0h), font=0, flags=RT_HALIGN_RIGHT, text=filesize))
     res.append(MultiContentEntryText(pos=(width - self.line2Split, self.line2Pos.y()), size=(self.line2Split - self.line2Pos.x(), self.f1h), font=1, flags=RT_HALIGN_RIGHT, text=time))
     res.append(MultiContentEntryText(pos=(width - self.line3Split, self.line3Pos.y()), size=(self.line3Split - self.line3Pos.x(), self.f2h), font=2, flags=RT_HALIGN_RIGHT, text=date))
     return res
Exemplo n.º 30
0
def MediaBrowserEntryComponent(item, title, type=MediaBrowser.ITEM_TYPE_FOLDER):
	res = [ (item, True, type) ]

	sizes = componentSizes[componentSizes.FILE_LIST]
	tx = sizes.get("textX", 35)
	ty = sizes.get("textY", 0)
	tw = sizes.get("textWidth", 1000)
	th = sizes.get("textHeight", 25)
	pxw = sizes.get("pixmapWidth", 20)
	pxh = sizes.get("pixmapHeight", 20)

	res.append(MultiContentEntryText(pos=(tx, ty), size=(tw, th), flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER, text=title))
	pixmap = MediaBrowser.ITEM_PIXMAPS.get(type, None)
	png = None
	if pixmap:
		png = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, pixmap))
	if png:
		res.append(MultiContentEntryPixmapAlphaBlend(pos=(10, (th-pxh)//2), size=(pxw, pxh), png=png))

	return res