示例#1
0
def MenuEntryPixmap(entryID, png_cache, lastMenuID):
	width = componentSizes.itemWidth(componentSizes.MENU_PIXMAP, default=192)
	height = componentSizes.itemHeight(componentSizes.MENU_PIXMAP, default=192)
	pixmapSize = eSize(width, height)
	png = png_cache.get(entryID, None)
	if png is None: # no cached entry
		pngPath = resolveFilename(SCOPE_CURRENT_SKIN, "menu/" + entryID + ".svg")
		pos = config.skin.primary_skin.value.rfind('/')
		if pos > -1:
			current_skin = config.skin.primary_skin.value[:pos+1]
		else:
			current_skin = ""
		if not fileExists(pngPath) or not (( current_skin in pngPath and current_skin ) or not current_skin ):
			pngPath = resolveFilename(SCOPE_CURRENT_SKIN, "menu/" + entryID + ".png")
		if ( current_skin in pngPath and current_skin ) or not current_skin:
			png = LoadPixmap(pngPath, cached=True, size=pixmapSize) #lets look for a dedicated icon
		if png is None: # no dedicated icon found
			if lastMenuID is not None:
				png = png_cache.get(lastMenuID, None)
		png_cache[entryID] = png
	if png is None:
		png = png_cache.get("missing", None)
		if png is None:
			png = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "menu/missing.svg"), cached=True, size=pixmapSize)
			if not png:
				png = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "menu/missing.png"), cached=True, size=pixmapSize)
			png_cache["missing"] = png
	return png
 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)))
示例#3
0
文件: Menu.py 项目: OpenDMM/enigma2
def MenuEntryPixmap(entryID, png_cache, lastMenuID):
	width = componentSizes.itemWidth(componentSizes.MENU_PIXMAP, default=192)
	height = componentSizes.itemHeight(componentSizes.MENU_PIXMAP, default=192)
	pixmapSize = eSize(width, height)
	png = png_cache.get(entryID, None)
	if png is None: # no cached entry
		pngPath = resolveFilename(SCOPE_CURRENT_SKIN, "menu/" + entryID + ".svg")
		pos = config.skin.primary_skin.value.rfind('/')
		if pos > -1:
			current_skin = config.skin.primary_skin.value[:pos+1]
		else:
			current_skin = ""
		if not fileExists(pngPath) or not (( current_skin in pngPath and current_skin ) or not current_skin ):
			pngPath = resolveFilename(SCOPE_CURRENT_SKIN, "menu/" + entryID + ".png")
		if ( current_skin in pngPath and current_skin ) or not current_skin:
			png = LoadPixmap(pngPath, cached=True, size=pixmapSize) #lets look for a dedicated icon
		if png is None: # no dedicated icon found
			if lastMenuID is not None:
				png = png_cache.get(lastMenuID, None)
		png_cache[entryID] = png
	if png is None:
		png = png_cache.get("missing", None)
		if png is None:
			png = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "menu/missing.svg"), cached=True, size=pixmapSize)
			if not png:
				png = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "menu/missing.png"), cached=True, size=pixmapSize)
			png_cache["missing"] = png
	return png
示例#4
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)
示例#5
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()
示例#6
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))
示例#7
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
示例#8
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)
示例#9
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()
示例#10
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()
示例#11
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()
示例#12
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 = [ ]
示例#13
0
文件: FileList.py 项目: popazerty/12
	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 = [ ]
示例#14
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)
示例#15
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
示例#16
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)
示例#17
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
示例#18
0
文件: FileList.py 项目: popazerty/12
	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()
示例#19
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()
示例#20
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._db = eMediaDatabase.getInstance()
		self._rootHandle = RootNavigationHandle(self._navRoot)

		if type == MediaCore.TYPE_AUDIO:
			#Artist -> Album -> Titles
			self._artistHandle = NavigationHandle(self.__getArtists, [eMediaDatabase.FIELD_ARTIST])
			self._artistAlbumHandle = NavigationHandle(self.__getAlbumsByArtist, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM])
			self._artistAllHandle = NavigationHandle(self.__filterByArtist, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM, eMediaDatabase.FIELD_TITLE])
			self._artistAlbumTitleHandle = NavigationHandle(self.__filterByArtistAlbum, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_TITLE])

			self._artistHandle.link(desc=self._artistAlbumHandle, asc=self._rootHandle)
			self._artistAlbumHandle.link(desc=self._artistAlbumTitleHandle, asc=self._artistHandle, all=self._artistAllHandle)
			self._artistAllHandle.link(asc=self._artistAlbumHandle)
			self._artistAlbumTitleHandle.link(asc=self._artistAlbumHandle)

			#Album -> Titles
			self._albumHandle = NavigationHandle(self.__getAllAlbums, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM])
			self._albumTitleHandle = NavigationHandle(self.__filterByArtistAlbum, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_TITLE])
			self._albumHandle.link(desc=self._albumTitleHandle, asc=self._rootHandle)
			self._albumTitleHandle.link(asc=self._albumHandle)

			#AlbumArtist -> Album -> Titles
			self._albumArtistHandle = NavigationHandle(self.__getAlbumArtists, [eMediaDatabase.FIELD_ARTIST])
			self._albumArtistAlbumHandle = NavigationHandle(self.__getAlbumsByAlbumArtist, [eMediaDatabase.FIELD_ALBUM_ARTIST, eMediaDatabase.FIELD_ALBUM])
			self._albumArtistAllHandle = NavigationHandle(self.__filterByAlbumArtist, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM, eMediaDatabase.FIELD_TITLE])
			self._albumArtistAlbumTitleHandle = NavigationHandle(self.__filterByAlbumArtistAlbum, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_TITLE])

			self._albumArtistHandle.link(desc=self._albumArtistAlbumHandle, asc=self._rootHandle)
			self._albumArtistAlbumHandle.link(desc=self._albumArtistAlbumTitleHandle, asc=self._albumArtistHandle, all=self._albumArtistAllHandle)
			self._albumArtistAllHandle.link(asc=self._albumArtistAlbumHandle)
			self._albumArtistAlbumTitleHandle.link(asc=self._albumArtistAlbumHandle)

			#All
			self._allHandle = NavigationHandle(self.__getAll, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM, eMediaDatabase.FIELD_TITLE])
			self._allHandle.link(asc=self._rootHandle)

			#set navigation handle items
			self._navitems = [{
					ITEM_KEY_TITLE : _("Artists"),
					ITEM_KEY_HANDLE: self._artistHandle,
				},
				{
					ITEM_KEY_TITLE : _("Albums"),
					ITEM_KEY_HANDLE: self._albumHandle,
				},
				{
					ITEM_KEY_TITLE : _("Album Artists"),
					ITEM_KEY_HANDLE: self._albumArtistHandle,
				},
				{
					ITEM_KEY_TITLE : _("All"),
					ITEM_KEY_HANDLE: self._allHandle,
				}]
		elif type == MediaCore.TYPE_VIDEO:
			self._recordingHandle = NavigationHandle(self.__getAllRecordings, [eMediaDatabase.FIELD_TITLE])
			self._allVideoHandle = NavigationHandle(self.__getAllVideos, [eMediaDatabase.FIELD_TITLE])
			self._unseenVideoHandle = NavigationHandle(self.__getUnseenVideos, [eMediaDatabase.FIELD_TITLE])
			self._hdVideoHandle = NavigationHandle(self.__getHDVideos, [eMediaDatabase.FIELD_TITLE])
			self._sdVideoHandle = NavigationHandle(self.__getSDVideos, [eMediaDatabase.FIELD_TITLE])

			self._recordingHandle.link(asc=self._rootHandle)
			self._allVideoHandle.link(asc=self._rootHandle)
			self._unseenVideoHandle.link(asc=self._rootHandle)
			self._hdVideoHandle.link(asc=self._rootHandle)
			self._sdVideoHandle.link(asc=self._rootHandle)

			self._navitems = [{
					ITEM_KEY_TITLE : _("Unseen"),
					ITEM_KEY_HANDLE: self._unseenVideoHandle,
				},
				{
					ITEM_KEY_TITLE : _("Recordings"),
					ITEM_KEY_HANDLE: self._recordingHandle,
				},
				{
					ITEM_KEY_TITLE : _("All Videos"),
					ITEM_KEY_HANDLE: self._allVideoHandle,
				},
				{
					ITEM_KEY_TITLE : _("Only HD"),
					ITEM_KEY_HANDLE: self._hdVideoHandle,
				},
				{
					ITEM_KEY_TITLE : _("Only SD"),
					ITEM_KEY_HANDLE: self._sdVideoHandle,
				},]

		self.__currentNavHandle = self._rootHandle
		self.__prevNavHandle = None
		self._currentHandleItem = None
		self.__getFolderContent = None
示例#21
0
 def postWidgetCreate(self, instance):
     MenuList.postWidgetCreate(self, instance)
     instance.setItemHeight(
         componentSizes.itemHeight(self.SKIN_COMPONENT_KEY, 30))
示例#22
0
	def itemHeight():
		return componentSizes.itemHeight(VirtualKeyBoardList.COMPONENT_VIRTUAL_KEYBOARD_LIST, 45)
示例#23
0
	def __init__(self, list, enableWrapAround=False):
		MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
		self.l.setItemHeight(componentSizes.itemHeight(self.SKIN_COMPONENT_KEY, 50))
		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)))
示例#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._db = eMediaDatabase.getInstance()
		self._rootHandle = RootNavigationHandle(self._navRoot)

		if type == MediaCore.TYPE_AUDIO:
			#Artist -> Album -> Titles
			self._artistHandle = NavigationHandle(self.__getArtists, [eMediaDatabase.FIELD_ARTIST])
			self._artistAlbumHandle = NavigationHandle(self.__getAlbumsByArtist, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM])
			self._artistAllHandle = NavigationHandle(self.__filterByArtist, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM, eMediaDatabase.FIELD_TITLE])
			self._artistAlbumTitleHandle = NavigationHandle(self.__filterByArtistAlbum, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_TITLE])

			self._artistHandle.link(desc=self._artistAlbumHandle, asc=self._rootHandle)
			self._artistAlbumHandle.link(desc=self._artistAlbumTitleHandle, asc=self._artistHandle, all=self._artistAllHandle)
			self._artistAllHandle.link(asc=self._artistAlbumHandle)
			self._artistAlbumTitleHandle.link(asc=self._artistAlbumHandle)

			#Album -> Titles
			self._albumHandle = NavigationHandle(self.__getAllAlbums, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM])
			self._albumTitleHandle = NavigationHandle(self.__filterByArtistAlbum, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_TITLE])
			self._albumHandle.link(desc=self._albumTitleHandle, asc=self._rootHandle)
			self._albumTitleHandle.link(asc=self._albumHandle)

			#AlbumArtist -> Album -> Titles
			self._albumArtistHandle = NavigationHandle(self.__getAlbumArtists, [eMediaDatabase.FIELD_ARTIST])
			self._albumArtistAlbumHandle = NavigationHandle(self.__getAlbumsByAlbumArtist, [eMediaDatabase.FIELD_ALBUM_ARTIST, eMediaDatabase.FIELD_ALBUM])
			self._albumArtistAllHandle = NavigationHandle(self.__filterByAlbumArtist, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM, eMediaDatabase.FIELD_TITLE])
			self._albumArtistAlbumTitleHandle = NavigationHandle(self.__filterByAlbumArtistAlbum, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_TITLE])

			self._albumArtistHandle.link(desc=self._albumArtistAlbumHandle, asc=self._rootHandle)
			self._albumArtistAlbumHandle.link(desc=self._albumArtistAlbumTitleHandle, asc=self._albumArtistHandle, all=self._albumArtistAllHandle)
			self._albumArtistAllHandle.link(asc=self._albumArtistAlbumHandle)
			self._albumArtistAlbumTitleHandle.link(asc=self._albumArtistAlbumHandle)

			#All
			self._allHandle = NavigationHandle(self.__getAll, [eMediaDatabase.FIELD_ARTIST, eMediaDatabase.FIELD_ALBUM, eMediaDatabase.FIELD_TITLE])
			self._allHandle.link(asc=self._rootHandle)

			#set navigation handle items
			self._navitems = [{
					ITEM_KEY_TITLE : _("Artists"),
					ITEM_KEY_HANDLE: self._artistHandle,
				},
				{
					ITEM_KEY_TITLE : _("Albums"),
					ITEM_KEY_HANDLE: self._albumHandle,
				},
				{
					ITEM_KEY_TITLE : _("Album Artists"),
					ITEM_KEY_HANDLE: self._albumArtistHandle,
				},
				{
					ITEM_KEY_TITLE : _("All"),
					ITEM_KEY_HANDLE: self._allHandle,
				}]
		elif type == MediaCore.TYPE_VIDEO:
			self._recordingHandle = NavigationHandle(self.__getAllRecordings, [eMediaDatabase.FIELD_TITLE])
			self._allVideoHandle = NavigationHandle(self.__getAllVideos, [eMediaDatabase.FIELD_TITLE])
			self._unseenVideoHandle = NavigationHandle(self.__getUnseenVideos, [eMediaDatabase.FIELD_TITLE])
			self._hdVideoHandle = NavigationHandle(self.__getHDVideos, [eMediaDatabase.FIELD_TITLE])
			self._sdVideoHandle = NavigationHandle(self.__getSDVideos, [eMediaDatabase.FIELD_TITLE])

			self._recordingHandle.link(asc=self._rootHandle)
			self._allVideoHandle.link(asc=self._rootHandle)
			self._unseenVideoHandle.link(asc=self._rootHandle)
			self._hdVideoHandle.link(asc=self._rootHandle)
			self._sdVideoHandle.link(asc=self._rootHandle)

			self._navitems = [{
					ITEM_KEY_TITLE : _("Unseen"),
					ITEM_KEY_HANDLE: self._unseenVideoHandle,
				},
				{
					ITEM_KEY_TITLE : _("Recordings"),
					ITEM_KEY_HANDLE: self._recordingHandle,
				},
				{
					ITEM_KEY_TITLE : _("All Videos"),
					ITEM_KEY_HANDLE: self._allVideoHandle,
				},
				{
					ITEM_KEY_TITLE : _("Only HD"),
					ITEM_KEY_HANDLE: self._hdVideoHandle,
				},
				{
					ITEM_KEY_TITLE : _("Only SD"),
					ITEM_KEY_HANDLE: self._sdVideoHandle,
				},]

		self.__currentNavHandle = self._rootHandle
		self.__prevNavHandle = None
		self._currentHandleItem = None
		self.__getFolderContent = None
示例#25
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)
示例#26
0
	def itemHeight():
		return componentSizes.itemHeight(VirtualKeyBoardList.COMPONENT_VIRTUAL_KEYBOARD_LIST, 45)
示例#27
0
	def postWidgetCreate(self, instance):
		MenuList.postWidgetCreate(self, instance)
		instance.setItemHeight(componentSizes.itemHeight(self.SKIN_COMPONENT_KEY, 50))