Exemplo n.º 1
0
    def __init__(self, rcUsed, boundKeys):
        GUIComponent.__init__(self)
        self.onSelectionChanged = []
        self.l = eListboxPythonMultiContent()
        self._rcUsed = rcUsed

        sizes = componentSizes[componentSizes.HELP_MENU_LIST]
        textX = sizes.get("textX", 5)
        textWidth = sizes.get("textWidth", 1000)
        textHeight = sizes.get("textHeight", 35)

        l = []
        for key in self.KEY_ORDER:
            if key not in boundKeys:
                continue
            try:
                keyID = keyDescriptions[self._rcUsed][KEYIDS[key]][0]
                description = self.KEY_NAMES.get(key, keyID)
                entry = [(keyID, key)]
                entry.append(
                    (eListboxPythonMultiContent.TYPE_TEXT, textX, 0, textWidth,
                     textHeight, 0, RT_VALIGN_CENTER, description))
                l.append(entry)
            except:
                Log.w("Key %s is unknown and skipped!" % (key, ))
        self.l.setList(l)

        tlf = TemplatedListFonts()
        self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
        self.l.setFont(1, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
        self.l.setItemHeight(sizes.get(componentSizes.ITEM_HEIGHT, 30))
Exemplo n.º 2
0
 def __init__(self, list, enableWrapAround=False):
     MenuList.__init__(self, list, enableWrapAround,
                       eListboxPythonMultiContent)
     self.l.setItemHeight(
         componentSizes.itemHeight(self.SKIN_COMPONENT_KEY, 30))
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
Exemplo n.º 3
0
	def __init__(self, list, enableWrapAround = True):
		MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
		
		isFHD = False
		sz_w = getDesktop(0).size().width()
		if sz_w >= 1920:
			isFHD = True
			
		sizes = componentSizes[TagMenuList.SKIN_COMPONENT_KEY]
		self.componentItemHeight = sizes.get(TagMenuList.SKIN_COMPONENT_KEY_ITEM_HEIGHT, 40 if isFHD else 25)
		self.componentItemWidth = sizes.get(TagMenuList.SKIN_COMPONENT_KEY_ITEM_WIDTH, 490 if isFHD else 290)
		self.xOffset = sizes.get(TagMenuList.SKIN_COMPONENT_KEY_XOFFSET, 10 if isFHD else 5)
		self.xIndicatorWidth = sizes.get(TagMenuList.SKIN_COMPONENT_KEY_XINDICATOR_WIDTH, 40 if isFHD else 20)
		self.xIndicatorOffset = sizes.get(TagMenuList.SKIN_COMPONENT_KEY_XINDICATOR_OFFSET, 370 if isFHD else 230)
		try: self.usedTagColor = parseColor("usedTagColor").argb()
		except: self.usedTagColor = 0x00ffff00
		try: self.userTagColor = parseColor("userTagColor").argb()
		except: self.userTagColor = 0x00FF0000
		try: self.preTagColor = parseColor("preTagColor").argb()
		except: self.preTagColor = 0x0000FF00
		
		
		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		self.l.setFont(1, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
		self.l.setItemHeight(self.componentItemHeight)
		self.l.setBuildFunc(self.buildTagMenuListEntry)
Exemplo n.º 4
0
	def __init__(self, list, selection = 0, enableWrapAround=True):
		MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)

		isFHD = False
		sz_w = getDesktop(0).size().width()
		if sz_w >= 1920:
			isFHD = True
			
		sizes = componentSizes[MPanelList.SKIN_COMPONENT_KEY]
		self.itemheight = sizes.get(MPanelList.SKIN_COMPONENT_ITEM_HEIGHT, 150 if isFHD else 100)
		self.itemwidth = sizes.get(MPanelList.SKIN_COMPONENT_ITEM_WIDTH, 400 if isFHD else 300)
		self.imagewidth = sizes.get(MPanelList.SKIN_COMPONENT_IMAGE_WIDTH, 200 if isFHD else 135)
		self.imageheight = sizes.get(MPanelList.SKIN_COMPONENT_IMAGE_HEIGHT, 140 if isFHD else 90)
		self.imagexoffset = sizes.get(MPanelList.SKIN_COMPONENT_IMAGE_XOFFSET, 25)
		self.imageyoffset = sizes.get(MPanelList.SKIN_COMPONENT_IMAGE_YOFFSET, 5)
		self.iconwidth = sizes.get(MPanelList.SKIN_COMPONENT_ICON_WIDTH, 5)
		self.iconheight = sizes.get(MPanelList.SKIN_COMPONENT_ICON_HEIGHT, 140 if isFHD else 90)
		self.iconxoffset = sizes.get(MPanelList.SKIN_COMPONENT_ICON_XOFFSET, 0)
		self.iconyoffset = sizes.get(MPanelList.SKIN_COMPONENT_ICON_YOFFSET, 5)
		self.textwidth = sizes.get(MPanelList.SKIN_COMPONENT_TEXT_WIDTH, 400 if isFHD else 300)
		self.textheight = sizes.get(MPanelList.SKIN_COMPONENT_TEXT_HEIGHT, 150 if isFHD else 100)
		self.textxoffset = sizes.get(MPanelList.SKIN_COMPONENT_TEXT_XOFFSET, 300 if isFHD else 200)
		self.textyoffset = sizes.get(MPanelList.SKIN_COMPONENT_TEXT_YOFFSET, 5)

		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
		self.l.setItemHeight(self.itemheight)
		self.l.setItemWidth(self.itemwidth)
		self.l.setBuildFunc(self.buildEntry)
		self.selection = selection
Exemplo n.º 5
0
 def __init__(self, getPlaylistEntriesCB):
     MenuList.__init__(self, list, False, eListboxPythonMultiContent)
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
     self.l.setItemHeight(25)
     self.l.setBuildFunc(self.buildListboxEntry)
     self.getPlaylistEntriesCB = getPlaylistEntriesCB
Exemplo n.º 6
0
	def __init__(self, session):
		TwitchStreamGrid.__init__(self, session, windowTitle=_("Top Games"))
		self.skinName = "TwitchGameGrid"
		sizes = componentSizes[TwitchGamesGrid.SKIN_COMPONENT_KEY]
		self._itemWidth = sizes.get(ComponentSizes.ITEM_WIDTH, 185)
		self._itemHeight = sizes.get(ComponentSizes.ITEM_HEIGHT, 258)
		self._bannerHeight = sizes.get(TwitchGamesGrid.SKIN_COMPONENT_HEADER_HEIGHT, 30)
		self._footerHeight = sizes.get(TwitchGamesGrid.SKIN_COMPONENT_FOOTER_HEIGHT, 60)
		self._itemPadding = sizes.get(TwitchGamesGrid.SKIN_COMPONENT_ITEM_PADDING, 5)
		#one-off calculations
		pad = self._itemPadding * 2
		self._contentWidth = self._itemWidth - pad
		self._contentHeight = self._itemHeight - pad
		self._footerOffset = self._itemHeight - self._itemPadding - self._footerHeight

		self._items = []
		self._list = MenuList(self._items, mode=eListbox.layoutGrid, content=eListboxPythonMultiContent, itemWidth=self._itemWidth, itemHeight=self._itemHeight)
		self["list"] = self._list

		tlf = TemplatedListFonts()
		self._list.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		self._list.l.setFont(1, gFont(tlf.face(tlf.SMALLER), tlf.size(tlf.SMALL)))
		self._list.l.setBuildFunc(self._buildFunc, True)

		self._picload.setPara((self._itemWidth, self._itemHeight, self._itemWidth, self._itemHeight, False, 0, '#000000'))
Exemplo n.º 7
0
	def __init__(self, type=EPG_TYPE_MULTI, selChangedCB=None, timer = None, hasChannelInfo=True):
		EPGList.__init__(self, type, selChangedCB, timer)
		
		sizes = componentSizes[EasyInfoEventList.SKIN_COMPONENT_KEY]
		self.channelWidth = sizes.get(EasyInfoEventList.SKIN_COMPONENT_CHANNEL_WIDTH, 120)
		self.timeWidth = sizes.get(EasyInfoEventList.SKIN_COMPONENT_TIME_WIDTH, 70)
		self.timeIndicatorWidth = sizes.get(EasyInfoEventList.SKIN_COMPONENT_TIME_FUTURE_INDICATOR_WIDTH, 10)
		self.eventNameWidth = sizes.get(EasyInfoEventList.SKIN_COMPONENT_EVENTNAME_WIDTH, 460)
		self.eventNameYOffset = sizes.get(EasyInfoEventList.SKIN_COMPONENT_EVENTNAME_OFFSET, 1)
		self.timeYOffset = sizes.get(EasyInfoEventList.SKIN_COMPONENT_TIME_OFFSET, 3)
		self.itemHeight = sizes.get(EasyInfoEventList.SKIN_COMPONENT_ITEM_HEIGHT, 50)
		self.recOffset = sizes.get(EasyInfoEventList.SKIN_COMPONENT_REC_OFFSET, 25)
		self.channelOffset = sizes.get(EasyInfoEventList.SKIN_COMPONENT_CHANNEL_OFFSET, 120)
		self.progressBarWidth = sizes.get(EasyInfoEventList.SKIN_COMPONENT_PROGRESSBAR_WIDTH, 40)
		self.progressBarHeight = sizes.get(EasyInfoEventList.SKIN_COMPONENT_PROGRESSBAR_HEIGHT, 8)
		self.remainingTimeWidth = sizes.get(EasyInfoEventList.SKIN_COMPONENT_REMAINING_TIME_WIDTH, 70)
		self.recIconSize = sizes.get(EasyInfoEventList.SKIN_COMPONENT_REC_ICON_SIZE, 16)
		self.piconWidth = 0
		self.piconHeight = 0

		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		self.l.setFont(1, gFont(tlf.face(tlf.SMALL), tlf.size(tlf.SMALL)))
		self.l.setFont(2, gFont(tlf.face(tlf.SMALLER), tlf.size(tlf.SMALLER)))
		
		self.l.setItemHeight(self.itemHeight)
		self.l.setBuildFunc(self.buildMultiEntry)
		
		self.hasChannelInfo = hasChannelInfo
		self.nameCache = { }
Exemplo n.º 8
0
	def __init__(self, list, enableWrapAround=True):
		MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)

		if pathExists('/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/icons/'):
			self.easyInfoIconsPath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/icons/'
		else:
			self.easyInfoIconsPath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/'
		
		sizes = componentSizes[EasyInfoPanelList.SKIN_COMPONENT_KEY]
		self.itemHeight = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_ITEM_HEIGHT, 60)
		self.textWidth = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_TEXT_WIDTH, 300)
		self.textHeight = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_TEXT_HEIGHT, 60)
		self.textXOffset = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_TEXT_XOFFSET, 115)
		self.textYOffset = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_TEXT_YOFFSET, 0)		
		self.iconWidth = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_ICON_WIDTH, 100)
		self.iconHeight = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_ICON_HEIGHT, 50)
		self.iconXOffset = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_ICON_XOFFSET, 5)
		self.iconYOffset = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_ICON_YOFFSET, 5)
		self.keyIconWidth = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_KEYICON_WIDTH, 5)
		self.keyIconHeight = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_KEYICON_HEIGHT, 50)
		self.keyIconXOffset = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_KEYICON_XOFFSET, 0)
		self.keyIconYOffset = sizes.get(EasyInfoPanelList.SKIN_COMPONENT_KEYICON_YOFFSET, 5)
		
		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		self.l.setItemHeight(self.itemHeight)
		self.l.setBuildFunc(self.buildEntry)
Exemplo n.º 9
0
 def __init__(self, list, enableWrapAround=False):
     MenuList.__init__(self, list, enableWrapAround,
                       eListboxPythonMultiContent)
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
     itemHeight = componentSizes.itemHeight(
         componentSizes.PARENTAL_CONTROL_LIST, 32)
     self.l.setItemHeight(itemHeight)
Exemplo n.º 10
0
	def __init__(self, list, selection = 0, enableWrapAround=False):
		MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)

		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
		itemHeight = componentSizes.itemHeight(componentSizes.CHOICELIST, 30)
		self.l.setItemHeight(itemHeight)
		self.selection = selection
Exemplo n.º 11
0
	def __init__(self):
		GUIComponent.__init__(self)
		self.l = eListboxPythonMultiContent()
		self.l.setBuildFunc(self.buildList)
		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
		self.l.setFont(1, gFont(tlf.face(tlf.SMALL), tlf.size(tlf.SMALL)))
		self.l.setItemHeight(componentSizes.itemHeight(self.SKIN_COMPONENT_KEY, 77))
Exemplo n.º 12
0
	def __init__(self, session, windowTitle=_("TwitchTV")):
		Screen.__init__(self, session, windowTitle=windowTitle)
		self.skinName = "TwitchStreamGrid"
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"ok": self._onOk,
			"cancel": self.close,
			"red": self._onRed,
			"green": self._onGreen,
			"yellow" : self._onYellow,
			"blue": self._onBlue,
		}, -1)

		self["key_red"] = StaticText()
		self["key_green"] = StaticText()
		self["key_blue"] = StaticText()
		self["key_yellow"] = StaticText()
		self._setupButtons()

		sizes = componentSizes[TwitchStreamGrid.SKIN_COMPONENT_KEY]
		self._itemWidth = sizes.get(ComponentSizes.ITEM_WIDTH, 280)
		self._itemHeight = sizes.get(ComponentSizes.ITEM_HEIGHT, 162)
		self._bannerHeight = sizes.get(TwitchStreamGrid.SKIN_COMPONENT_HEADER_HEIGHT, 30)
		self._footerHeight = sizes.get(TwitchStreamGrid.SKIN_COMPONENT_FOOTER_HEIGHT, 60)
		self._itemPadding = sizes.get(TwitchStreamGrid.SKIN_COMPONENT_ITEM_PADDING, 5)
		#one-off calculations
		pad = self._itemPadding * 2
		self._contentWidth = self._itemWidth - pad
		self._contentHeight = self._itemHeight - pad
		self._footerOffset = self._itemHeight - self._itemPadding - self._footerHeight

		self._items = []
		self._list = MenuList(self._items, mode=eListbox.layoutGrid, content=eListboxPythonMultiContent, itemWidth=self._itemWidth, itemHeight=self._itemHeight)
		self["list"] = self._list

		tlf = TemplatedListFonts()
		self._list.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		self._list.l.setFont(1, gFont(tlf.face(tlf.SMALLER), tlf.size(tlf.SMALL)))
		self._list.l.setBuildFunc(self._buildFunc, True)

		self.twitch = Twitch()
		self.twitchMiddleware = TwitchMiddleware.instance

		self._picload = ePicLoad()
		self._picload.setPara((self._itemWidth, self._itemHeight, self._itemWidth, self._itemHeight, False, 0, '#000000'))
		self._picload_conn = self._picload.PictureData.connect(self._onDefaultPixmapReady)

		agent = Agent(reactor, contextFactory=TLSSNIContextFactory(), pool=HTTPConnectionPool(reactor))
		self._agent = BrowserLikeRedirectAgent(agent)
		self._cachingDeferred = None

		self._loadDefaultPixmap()

		self._pixmapCache = {}
		self._currentEntry = 0
		self._endEntry = 0
		self.onLayoutFinish.append(self._onLayoutFinish)
		self.onClose.append(self.__onClose)
Exemplo n.º 13
0
    def __init__(self, helplist, callback):
        GUIComponent.__init__(self)
        self.onSelChanged = []
        self.l = eListboxPythonMultiContent()
        self.callback = callback
        self.extendedHelp = False

        l = []
        sizes = componentSizes[componentSizes.HELP_MENU_LIST]
        textX = sizes.get("textX", 5)
        textY = sizes.get("textY", 35)
        textWidth = sizes.get("textWidth", 1000)
        textHeight = sizes.get("textHeight", 35)
        for (actionmap, context, actions) in helplist:
            if not actionmap.enabled:
                continue
            for (action, help) in actions:
                buttons = queryKeyBinding(context, action)

                # do not display entries which are not accessible from keys
                if not len(buttons):
                    continue

                name = None
                flags = 0

                for n in buttons:
                    (name, flags) = (getKeyDescription(n[0]), n[1])
                    if name is not None:
                        break

                if flags & 8:  # for long keypresses, prepend l_ into the key name.
                    name = (name[0], "long")

                entry = [(actionmap, context, action, name)]

                if isinstance(help, list):
                    self.extendedHelp = True
                    print "extendedHelpEntry found"
                    entry.extend(
                        ((eListboxPythonMultiContent.TYPE_TEXT, 0, 0,
                          textWidth, textHeight, 0, RT_VALIGN_CENTER, help[0]),
                         (eListboxPythonMultiContent.TYPE_TEXT, 0, textY,
                          textWidth, textHeight, 1, RT_VALIGN_CENTER,
                          help[1])))
                else:
                    entry.append(
                        (eListboxPythonMultiContent.TYPE_TEXT, textX, 0,
                         textWidth, textHeight, 0, RT_VALIGN_CENTER, help))

                l.append(entry)

        self.l.setList(l)

        tlf = TemplatedListFonts()
        self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
        self.l.setFont(1, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
        self.l.setItemHeight(sizes.get(componentSizes.ITEM_HEIGHT, 30))
Exemplo n.º 14
0
	def __init__(self, getFilesAndDirsCB, baseDir, matchingPattern):
		MenuList.__init__(self, list, False, eListboxPythonMultiContent)
		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		self.l.setItemHeight(25)
		self.l.setBuildFunc(self.buildListboxEntry)
		self.currentDirectory = baseDir
		self.getFilesAndDirsCB = getFilesAndDirsCB
		self.changeRegex(matchingPattern)
Exemplo n.º 15
0
 def __init__(self, list, enableWrapAround=False):
     MenuList.__init__(self, list, enableWrapAround,
                       eListboxPythonMultiContent)
     tlf = TemplatedListFonts()
     self.l.setFont(
         0,
         gFont(tlf.face(tlf.KEYBOARD, default=tlf.face(tlf.BIG)),
               tlf.size(tlf.KEYBOARD, default=tlf.size(tlf.BIG))))
     self.l.setItemHeight(VirtualKeyBoardList.itemHeight())
Exemplo n.º 16
0
 def postWidgetCreate(self, instance):
     instance.setWrapAround(True)
     self.selectionChanged_conn = instance.selectionChanged.connect(
         self.serviceChanged)
     instance.setContent(self.l)
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
     self.l.setFont(1, gFont(tlf.face(tlf.SMALL), tlf.size(tlf.SMALL)))
     self.l.setSelectionClip(eRect(0, 0, 0, 0), False)
Exemplo n.º 17
0
	def __init__(self, entries):
		MenuList.__init__(self, entries, False, content = eListboxPythonMultiContent)

		self.l.setFont(0, gFont("Regular", 22))
		self.l.setBuildFunc(self.buildListboxEntry)
		self.l.setItemHeight(30)
		self.colorDisabled = 12368828
		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
Exemplo n.º 18
0
 def __init__(self):
     GUIComponent.__init__(self)
     sizes = componentSizes[componentSizes.TIMELINE_TEXT]
     height = sizes.get(componentSizes.ITEM_HEIGHT, 25)
     self.l = eListboxPythonMultiContent()
     self.l.setSelectionClip(eRect(0, 0, 0, 0))
     self.l.setItemHeight(height)
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
Exemplo n.º 19
0
 def __init__(self, enableWrapAround=False):
     MenuList.__init__(self, [], enableWrapAround,
                       eListboxPythonMultiContent)
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
     self.l.setItemHeight(
         componentSizes.itemHeight(self.SKIN_COMPONENT_KEY, 23))
     self.currPlaying = -1
     self.oldCurrPlaying = -1
     self.serviceHandler = eServiceCenter.getInstance()
Exemplo n.º 20
0
 def __init__(self, list=None, enableWrapAround=False):
     MenuList.__init__(self,
                       list or [],
                       enableWrapAround,
                       content=eListboxPythonMultiContent)
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
     itemHeight = componentSizes.itemHeight(componentSizes.SELECTION_LIST,
                                            30)
     self.l.setItemHeight(itemHeight)
Exemplo n.º 21
0
	def __init__(self, preselectedFiles, directory, showMountpoints = False, matchingPattern = None, showDirectories = True, showFiles = True,  useServiceRef = False, inhibitDirs = False, inhibitMounts = False, isTop = False, enableWrapAround = False, additionalExtensions = None):
		self.selectedFiles = preselectedFiles
		if self.selectedFiles is None:
			self.selectedFiles = []
		FileList.__init__(self, directory, showMountpoints = showMountpoints, matchingPattern = matchingPattern, showDirectories = showDirectories, showFiles = showFiles,  useServiceRef = useServiceRef, inhibitDirs = inhibitDirs, inhibitMounts = inhibitMounts, isTop = isTop, enableWrapAround = enableWrapAround, additionalExtensions = additionalExtensions)
		self.changeDir(directory)

		itemHeight = componentSizes.itemHeight(componentSizes.MULTI_FILE_SELECT_LIST, 25)
		self.l.setItemHeight(itemHeight)
		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		self.onSelectionChanged = [ ]
Exemplo n.º 22
0
    def __init__(self, source):
        GUIComponent.__init__(self)
        self.l = eListboxPythonMultiContent()
        self.list = source
        self.l.setList(self.list)

        tlf = TemplatedListFonts()
        self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
        itemHeight = componentSizes.itemHeight(
            componentSizes.SERVICE_INFO_LIST, 30)
        self.l.setItemHeight(itemHeight)
        self.serviceHandler = eServiceCenter.getInstance()
Exemplo n.º 23
0
    def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer=None):
        self.days = (_("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"),
                     _("Sat"), _("Sun"))
        self.timer = timer
        self.onSelChanged = []
        if selChangedCB is not None:
            self.onSelChanged.append(selChangedCB)
        GUIComponent.__init__(self)
        self.type = type
        self.l = eListboxPythonMultiContent()

        tlf = TemplatedListFonts()
        self._font0 = gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG))
        self._font1 = gFont(tlf.face(tlf.SMALL), tlf.size(tlf.SMALL))
        self.l.setFont(0, self._font0)
        self.l.setFont(1, self._font1)
        self._textRenderer = None

        sizes = componentSizes[EPGList.SKIN_COMPONENT_KEY]
        self._iconWidth = sizes.get(EPGList.SKIN_COMPONENT_ICON_WIDTH, 21)
        self._iconHeight = sizes.get(EPGList.SKIN_COMPONENT_ICON_HEIGHT, 21)
        self._iconHPos = sizes.get(EPGList.SKIN_COMPONENT_ICON_HPOS, 4)
        self._itemMargin = sizes.get(EPGList.SKIN_COMPONENT_ITEM_MARGIN, 10)

        if type in (EPG_TYPE_SINGLE, EPG_TYPE_SIMILAR):
            self.l.setBuildFunc(self.buildSingleEntry)
        else:
            assert (type == EPG_TYPE_MULTI)
            self.l.setBuildFunc(self.buildMultiEntry)

        self.epgcache = eEPGCache.getInstance()
        self.clock_pixmap = LoadPixmap(cached=True,
                                       path=resolveFilename(
                                           SCOPE_CURRENT_SKIN,
                                           'skin_default/icons/epgclock.png'))
        self.clock_add_pixmap = LoadPixmap(
            cached=True,
            path=resolveFilename(SCOPE_CURRENT_SKIN,
                                 'skin_default/icons/epgclock_add.png'))
        self.clock_pre_pixmap = LoadPixmap(
            cached=True,
            path=resolveFilename(SCOPE_CURRENT_SKIN,
                                 'skin_default/icons/epgclock_pre.png'))
        self.clock_post_pixmap = LoadPixmap(
            cached=True,
            path=resolveFilename(SCOPE_CURRENT_SKIN,
                                 'skin_default/icons/epgclock_post.png'))
        self.clock_prepost_pixmap = LoadPixmap(
            cached=True,
            path=resolveFilename(SCOPE_CURRENT_SKIN,
                                 'skin_default/icons/epgclock_prepost.png'))
Exemplo n.º 24
0
	def __init__(self, type):
		MenuList.__init__(self, [], True, eListboxPythonMultiContent)
		MediaBrowserList.__init__(self, type)

		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		itemHeight = componentSizes.itemHeight(componentSizes.FILE_LIST, 30)
		self.l.setItemHeight(itemHeight)
		self.l.setBuildFunc(self._buildListEntry)

		self._browser = UPnPBrowser()
		self._browser.onMediaServerDetected.append(self._onMediaServerListChanged)
		self._browser.onMediaServerRemoved.append(self._onMediaServerListChanged)
		self._browser.onListReady.append(self._onListReady)
		self._browser.onBrowseError.append(self._onBrowseError)
    def __init__(self, list, enableWrapAround=True):
        MenuList.__init__(self, list, enableWrapAround,
                          eListboxPythonMultiContent)

        sizes = componentSizes[MerlinSkinThemesHelpList.SKIN_COMPONENT_KEY]
        self.componentItemHeight = sizes.get(
            MerlinSkinThemesHelpList.SKIN_COMPONENT_ITEM_HEIGHT, 40)
        self.keyWidth = sizes.get(
            MerlinSkinThemesHelpList.SKIN_COMPONENT_KEY_WIDTH, 250)
        self.descrWidth = sizes.get(
            MerlinSkinThemesHelpList.SKIN_COMPONENT_DESCR_WIDTH, 750)

        tlf = TemplatedListFonts()
        self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
        self.l.setItemHeight(self.componentItemHeight)
        self.l.setBuildFunc(self.buildEntry)
Exemplo n.º 26
0
	def __init__(self):
		MenuList.__init__(self, [], enableWrapAround=True, content=eListboxPythonMultiContent)

		self.listFont = None
		self.itemHeight = 30
		self.iconPosX = 8
		self.iconPosY = 8
		self.iconSize = 16
		self.colWidthStb = 300
		self.colWidthWeb = 250
		self.margin = 5

		self.l.setBuildFunc(self.buildListboxEntry)

		global TemplatedListFonts
		if TemplatedListFonts is not None:
			tlf = TemplatedListFonts()
			self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		else:
			self.l.setFont(0, gFont('Regular', 20))
Exemplo n.º 27
0
	def __init__(self, session, services, files):
		Screen.__init__(self, session)
		self.session = session
		self.services = services
		self.files = files
		
		self["menuList"] = MenuList([], content=eListboxPythonMultiContent)
		self["menuList"].l.setItemHeight(componentSizes.itemHeight(self.SKIN_COMPONENT_KEY, 85))
		tlf = TemplatedListFonts()
		self["menuList"].l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
		self["menuList"].l.setFont(1, gFont(tlf.face(tlf.SMALL), tlf.size(tlf.SMALL)))
		
		self["actions"] = ActionMap(["OkCancelActions"],
			{
			 "ok": self._ok,
			 "cancel": self._exit,
			 }, -1)
		
		self.onLayoutFinish.append(self.buildMenu)
		self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 28
0
 def __init__(self, tuplelist):
     entries = []
     for (obj, text) in tuplelist:
         entries.append(self.buildEntry(obj, text))
     MenuList.__init__(self,
                       entries,
                       enableWrapAround=False,
                       content=eListboxPythonMultiContent)
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
     itemHeight = componentSizes.itemHeight(componentSizes.SELECTION_LIST,
                                            30)
     self.l.setItemHeight(itemHeight)
     self.markedForeground = 0xffffff
     self.markedBackground = 0xff0000
     colors = TemplatedColors().colors
     if "ListboxMarkedForeground" in colors:
         self.markedForeground = colors["ListboxMarkedForeground"]
     if "ListboxMarkedBackground" in colors:
         self.markedBackground = colors["ListboxMarkedBackground"]
     self.entry_marked = False
Exemplo n.º 29
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self["Canvas"] = CanvasSource()

        self.basic_colors = [
            RGB(255, 255, 255),
            RGB(255, 255, 0),
            RGB(0, 255, 255),
            RGB(0, 255, 0),
            RGB(255, 0, 255),
            RGB(255, 0, 0),
            RGB(0, 0, 255),
            RGB(0, 0, 0)
        ]
        tlf = TemplatedListFonts()
        self._textFont = gFont(tlf.face(tlf.BIGGER), tlf.size(tlf.BIGGER))

        self._headerSize = tlf.size(tlf.BIGGER) * 2
        self._headerFont = gFont(tlf.face(tlf.BIGGER), self._headerSize)
        self._headerSize = int(self._headerSize * 1.5)

        self["actions"] = ActionMap(
            ["InputActions", "OkCancelActions"],
            {
                "1": self.testpic_brightness,
                "2": self.testpic_contrast,
                #			"3": self.testpic_colors,
                "3": self.testpic_filter,
                "4": self.testpic_gamma,
                "5": self.testpic_fubk,
                "ok": self.callNext,
                "cancel": self.close,
            })

        self._size = None
        self.next = None
        self._clear()
        self.onLayoutFinish.append(self._onLayoutFinish)
Exemplo n.º 30
0
	def __init__(self, directory, showDirectories = True, showFiles = True, showMountpoints = True, matchingPattern = None, useServiceRef = False, inhibitDirs = False, inhibitMounts = False, isTop = False, enableWrapAround = False, additionalExtensions = None):
		MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
		self.additional_extensions = additionalExtensions
		self.mountpoints = []
		self.current_directory = None
		self.current_mountpoint = None
		self.useServiceRef = useServiceRef
		self.showDirectories = showDirectories
		self.showMountpoints = showMountpoints
		self.showFiles = showFiles
		self.isTop = isTop
		# example: matching .nfi and .ts files: "^.*\.(nfi|ts)"
		self.matchingPattern = matchingPattern
		self.inhibitDirs = inhibitDirs or []
		self.inhibitMounts = inhibitMounts or []

		self.refreshMountpoints()
		self.changeDir(directory)

		tlf = TemplatedListFonts()
		self.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
		itemHeight = componentSizes.itemHeight(componentSizes.FILE_LIST, 25)
		self.l.setItemHeight(itemHeight)
		self.serviceHandler = eServiceCenter.getInstance()