From 25b529dd304871c705456047049dd29935f1ffe3 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 27 Jun 2006 09:33:42 +0000 Subject: add some skin fixes/extensions made by Nemesis (thanks for this) --- lib/python/Components/FileList.py | 2 +- lib/python/Components/MediaPlayer.py | 16 +++++------ lib/python/Components/PluginList.py | 16 +++++------ .../SystemPlugins/ConfigurationBackup/backup.png | Bin 4443 -> 3711 bytes .../SystemPlugins/ConfigurationBackup/blue.png | Bin 3811 -> 3495 bytes .../SystemPlugins/ConfigurationBackup/green.png | Bin 3811 -> 3454 bytes .../SystemPlugins/ConfigurationBackup/plugin.py | 32 ++++++++++----------- .../SystemPlugins/ConfigurationBackup/red.png | Bin 3811 -> 3742 bytes .../SystemPlugins/ConfigurationBackup/yellow.png | Bin 3811 -> 3732 bytes .../SystemPlugins/SoftwareUpdate/update.png | Bin 1090 -> 3630 bytes lib/python/Screens/MediaPlayer.py | 22 ++++++++++++-- 11 files changed, 53 insertions(+), 35 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py index 0d8245c2..74117309 100644 --- a/lib/python/Components/FileList.py +++ b/lib/python/Components/FileList.py @@ -32,7 +32,7 @@ EXTENSIONS = { def FileEntryComponent(name, absolute = None, isDir = False): res = [ (absolute, isDir) ] - res.append((eListboxPythonMultiContent.TYPE_TEXT, 35, 1, 200, 20, 0, RT_HALIGN_LEFT, name)) + res.append((eListboxPythonMultiContent.TYPE_TEXT, 35, 1, 470, 20, 0, RT_HALIGN_LEFT, name)) if isDir: png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "extensions/directory.png")) else: diff --git a/lib/python/Components/MediaPlayer.py b/lib/python/Components/MediaPlayer.py index c271c3c6..45551ccc 100644 --- a/lib/python/Components/MediaPlayer.py +++ b/lib/python/Components/MediaPlayer.py @@ -24,15 +24,15 @@ STATE_REWIND = 3 STATE_FORWARD = 4 STATE_NONE = 5 -PlayIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "play-small-fs8.png")) -PauseIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "pause-small-fs8.png")) -StopIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "stop-small-fs8.png")) -RewindIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "rewind-small-fs8.png")) -ForwardIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "forward-small-fs8.png")) +PlayIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_play.png")) +PauseIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_pause.png")) +StopIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_stop.png")) +RewindIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_rewind.png")) +ForwardIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_forward.png")) def PlaylistEntryComponent(serviceref, state): res = [ serviceref ] - res.append((eListboxPythonMultiContent.TYPE_TEXT, 35, 0, 250, 32, 0, RT_VALIGN_CENTER, os.path.split(serviceref.getPath().split('/')[-1])[1])) + res.append((eListboxPythonMultiContent.TYPE_TEXT,25, 0, 470, 32, 0, RT_VALIGN_CENTER, os.path.split(serviceref.getPath().split('/')[-1])[1])) png = None if state == STATE_PLAY: png = PlayIcon @@ -46,7 +46,7 @@ def PlaylistEntryComponent(serviceref, state): png = ForwardIcon if png is not None: - res.append((eListboxPythonMultiContent.TYPE_PIXMAP, 0, 0, 33, 32, png)) + res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5, 0, 16, 16, png)) return res @@ -70,7 +70,7 @@ class PlayList(MenuList, HTMLComponent, GUIComponent): def postWidgetCreate(self, instance): instance.setContent(self.l) - instance.setItemHeight(32) + instance.setItemHeight(22) def getSelection(self): return self.l.getCurrentSelection()[0] diff --git a/lib/python/Components/PluginList.py b/lib/python/Components/PluginList.py index 7220f0a9..9b9cfea8 100644 --- a/lib/python/Components/PluginList.py +++ b/lib/python/Components/PluginList.py @@ -11,36 +11,36 @@ from enigma import * def PluginEntryComponent(plugin): res = [ plugin ] - res.append(MultiContentEntryText(pos=(80, 5), size=(300, 25), font=0, text=plugin.name)) - res.append(MultiContentEntryText(pos=(80, 26), size=(300, 17), font=1, text=plugin.description)) + res.append(MultiContentEntryText(pos=(120, 5), size=(320, 25), font=0, text=plugin.name)) + res.append(MultiContentEntryText(pos=(120, 26), size=(320, 17), font=1, text=plugin.description)) if plugin.icon is None: png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "plugin.png")) else: png = plugin.icon - res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 5), size=(60, 40), png = png)) + res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 5), size=(100, 40), png = png)) return res def PluginCategoryComponent(name, png): res = [ name ] - res.append(MultiContentEntryText(pos=(80, 5), size=(300, 25), font=0, text=name)) - res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 0), size=(60, 50), png = png)) + res.append(MultiContentEntryText(pos=(120, 5), size=(320, 25), font=0, text=name)) + res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 0), size=(100, 50), png = png)) return res def PluginDownloadComponent(plugin, name): res = [ plugin ] - res.append(MultiContentEntryText(pos=(80, 5), size=(300, 25), font=0, text=name)) - res.append(MultiContentEntryText(pos=(80, 26), size=(300, 17), font=1, text=plugin.description)) + res.append(MultiContentEntryText(pos=(120, 5), size=(320, 25), font=0, text=name)) + res.append(MultiContentEntryText(pos=(120, 26), size=(320, 17), font=1, text=plugin.description)) if plugin.icon is None: png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "plugin.png")) else: png = plugin.icon - res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 0), size=(60, 50), png = png)) + res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 0), size=(100, 50), png = png)) return res diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/backup.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/backup.png index bb219a4c..4962a058 100644 Binary files a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/backup.png and b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/backup.png differ diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/blue.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/blue.png index f75db7a0..a392bbe6 100644 Binary files a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/blue.png and b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/blue.png differ diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/green.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/green.png index 118c3f46..f168e4d0 100644 Binary files a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/green.png and b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/green.png differ diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py index 5bffb71c..f47886c2 100644 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py +++ b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py @@ -34,16 +34,16 @@ MountPoints = { class BackupSetup(Screen): skin = """ - - - - - - - - - - + + + + + + + + + + """ def keyLeft(self): @@ -150,12 +150,12 @@ class BackupSetup(Screen): class RestoreMenu(Screen): skin = """ - - - - - - + + + + + + """ def __init__(self, session, args = None): diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/red.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/red.png index 4f7e97fb..8096045f 100644 Binary files a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/red.png and b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/red.png differ diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/yellow.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/yellow.png index 48b3e68f..dacb80e6 100644 Binary files a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/yellow.png and b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/yellow.png differ diff --git a/lib/python/Plugins/SystemPlugins/SoftwareUpdate/update.png b/lib/python/Plugins/SystemPlugins/SoftwareUpdate/update.png index 6bc17b1e..0ece6c76 100644 Binary files a/lib/python/Plugins/SystemPlugins/SoftwareUpdate/update.png and b/lib/python/Plugins/SystemPlugins/SoftwareUpdate/update.png differ diff --git a/lib/python/Screens/MediaPlayer.py b/lib/python/Screens/MediaPlayer.py index 3e238e08..32296b6c 100644 --- a/lib/python/Screens/MediaPlayer.py +++ b/lib/python/Screens/MediaPlayer.py @@ -10,7 +10,7 @@ from Components.Label import Label from Components.FileList import FileEntryComponent, FileList from Components.MediaPlayer import PlayList, PlaylistEntryComponent from Plugins.Plugin import PluginDescriptor -from Tools.Directories import resolveFilename, SCOPE_MEDIA, SCOPE_CONFIG +from Tools.Directories import resolveFilename, SCOPE_MEDIA, SCOPE_CONFIG, SCOPE_SKIN_IMAGE from Components.ServicePosition import ServicePositionGauge from Screens.ChoiceBox import ChoiceBox from Components.ServiceEventTracker import ServiceEventTracker @@ -32,7 +32,7 @@ class MediaPlayer(Screen, InfoBarSeek): self.addPlaylistParser(PlaylistIOPLS, "pls") self.addPlaylistParser(PlaylistIOInternal, "e2pls") - self.filelist = FileList(resolveFilename(SCOPE_MEDIA), matchingPattern = "(?i)^.*\.(mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob)", useServiceRef = True) + self.filelist = FileList(resolveFilename(SCOPE_MEDIA), matchingPattern = "^.*\.(mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob)", useServiceRef = True) self["filelist"] = self.filelist self.playlist = PlayList() @@ -52,6 +52,7 @@ class MediaPlayer(Screen, InfoBarSeek): self["year"] = Label("") self["genretext"] = Label(_("Genre:")) self["genre"] = Label("") + self["coverArt"] = Pixmap() #self["text"] = Input("1234", maxSize=True, type=Input.NUMBER) @@ -129,6 +130,8 @@ class MediaPlayer(Screen, InfoBarSeek): self.infoTimer.start(500) self.currList = "filelist" + + self.coverArtFileName = "" self.playlistIOInternal = PlaylistIOInternal() list = self.playlistIOInternal.open(resolveFilename(SCOPE_CONFIG, "playlist.e2pls")) @@ -169,8 +172,10 @@ class MediaPlayer(Screen, InfoBarSeek): album = currPlay.info().getInfoString(iServiceInformation.sAlbum), genre = currPlay.info().getInfoString(iServiceInformation.sGenre), clear = True) + self.updateCoverArtPixmap( currPlay.info().getName() ) else: self.updateMusicInformation() + self.updateCoverArtPixmap( "" ) def updateMusicInformation(self, artist = "", title = "", album = "", year = "", genre = "", clear = False): self.updateSingleMusicInformation("artist", artist, clear) @@ -184,6 +189,19 @@ class MediaPlayer(Screen, InfoBarSeek): if self[name].getText() != info: self[name].setText(info) + def updateCoverArtPixmap(self, currentServiceName): + filename = currentServiceName + # The "getName" usually adds something like "MP3 File:" infront of filename + # Get rid of this...by finding the first "/" + filename = filename[filename.find("/"):] + path = os.path.dirname(filename) + pngname = path + "/" + "folder.png" + if not os.path.exists(pngname): + pngname = resolveFilename(SCOPE_SKIN_IMAGE, "no_coverArt.png") + if self.coverArtFileName != pngname: + self.coverArtFileName = pngname + self["coverArt"].instance.setPixmapFromFile(self.coverArtFileName) + def fwdTimerFire(self): self.fwdKeyTimer.stop() self.fwdtimer = False -- cgit v1.2.3