aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorMladen Horvat <acidburn@opendreambox.org>2008-11-07 16:36:06 +0100
committerMladen Horvat <acidburn@opendreambox.org>2008-11-07 16:36:06 +0100
commit2e65583dc2e0119b56059d4ad037567af297246d (patch)
treef3e59fab07dc7abe03653dda9d428a0303b3bf82 /lib/python
parentd783bda57eb31eced5370da43379cea17f7df8ca (diff)
parentf8d344bcac5f2a6dd17032e6ca3d3fa9b96291b3 (diff)
downloadenigma2-2e65583dc2e0119b56059d4ad037567af297246d.tar.gz
enigma2-2e65583dc2e0119b56059d4ad037567af297246d.zip
Merge branch 'master' of git://git.opendreambox.org/git/enigma2
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/Extensions/MediaPlayer/plugin.py27
-rw-r--r--lib/python/Screens/TimerEdit.py23
2 files changed, 31 insertions, 19 deletions
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
index 2233998c..963247d6 100644
--- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
@@ -1,6 +1,6 @@
from os import path as os_path, remove as os_remove, listdir as os_listdir
from time import strftime
-from enigma import iPlayableService, eTimer, eServiceCenter, iServiceInformation
+from enigma import iPlayableService, eTimer, eServiceCenter, iServiceInformation, loadPic
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
@@ -14,6 +14,7 @@ from Tools.Directories import resolveFilename, SCOPE_CONFIG, SCOPE_PLAYLIST, SCO
from Components.ServicePosition import ServicePositionGauge
from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
from Components.Playlist import PlaylistIOInternal, PlaylistIOM3U, PlaylistIOPLS
+from Components.AVSwitch import AVSwitch
from Screens.InfoBarGenerics import InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSupport, InfoBarNotifications, InfoBarSubtitleSupport
from ServiceReference import ServiceReference
from Screens.ChoiceBox import ChoiceBox
@@ -42,6 +43,7 @@ class MediaPixmap(Pixmap):
break
if self.default_pixmap is None:
self.default_pixmap = resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/no_coverArt.png")
+ self.coverFileNames = ["folder.png", "folder.jpg"]
return Pixmap.applySkin(self, desktop, screen)
class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSupport, InfoBarNotifications, InfoBarSubtitleSupport, HelpableScreen):
@@ -283,13 +285,15 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
def updateCoverArtPixmap(self, path):
while not path.endswith("/"):
path = path[:-1]
- pngname = path + "folder.png"
-
- if not fileExists(pngname):
- pngname = self["coverArt"].default_pixmap
- if self.coverArtFileName != pngname:
- self.coverArtFileName = pngname
- self["coverArt"].instance.setPixmapFromFile(self.coverArtFileName)
+ new_coverArtFileName = self["coverArt"].default_pixmap
+ for filename in self["coverArt"].coverFileNames:
+ if fileExists(path + filename):
+ new_coverArtFileName = path + filename
+ if self.coverArtFileName != new_coverArtFileName:
+ self.coverArtFileName = new_coverArtFileName
+ pixmap = loadPic(self.coverArtFileName, 116, 116, AVSwitch().getAspectRatioSetting()/2,1,0,0)
+ if pixmap is not None:
+ self["coverArt"].instance.setPixmap(pixmap.__deref__())
def leftDown(self):
self.lefttimer = True
@@ -632,7 +636,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
if x[0][1] == True: #isDir
if recursive:
self.copyDirectory(x[0][0])
- elif filelist.getServiceRef().type != 4098:
+ elif filelist.getServiceRef() and filelist.getServiceRef().type == 4097:
self.playlist.addFile(x[0][0])
self.playlist.updateList()
@@ -640,7 +644,6 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
if self.filelist.getServiceRef().type == 4098: # playlist
ServiceRef = self.filelist.getServiceRef()
extension = ServiceRef.getPath()[ServiceRef.getPath().rfind('.') + 1:]
- print "extension:", extension
if self.playlistparsers.has_key(extension):
playlist = self.playlistparsers[extension]()
list = playlist.open(ServiceRef.getPath())
@@ -763,7 +766,8 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
self.unPauseService()
if needsInfoUpdate == True:
- self.updateCoverArtPixmap(currref.getPath())
+ path = self.playlist.getServiceRefList()[self.playlist.getCurrentIndex()].getPath()
+ self.updateCoverArtPixmap(path)
else:
pngname = self["coverArt"].default_pixmap
self.coverArtFileName = pngname
@@ -815,7 +819,6 @@ class MediaPlayerLCDScreen(Screen):
self["text4"] = Label("")
def setText(self, text, line):
- print "lcd set text:", text, line
if len(text) > 10:
if text[-4:] == ".mp3":
text = text[:-4]
diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py
index 800bab33..aae345db 100644
--- a/lib/python/Screens/TimerEdit.py
+++ b/lib/python/Screens/TimerEdit.py
@@ -317,6 +317,7 @@ class TimerSanityConflict(Screen):
EMPTY = 0
ENABLE = 1
DISABLE = 2
+ EDIT = 3
def __init__(self, session, timer):
Screen.__init__(self, session)
@@ -338,10 +339,11 @@ class TimerSanityConflict(Screen):
self["key_red"] = Button("Edit")
self["key_green"] = Button(" ")
- self["key_yellow"] = Button("Edit")
+ self["key_yellow"] = Button(" ")
self["key_blue"] = Button(" ")
self.key_green_choice = self.EMPTY
+ self.key_yellow_choice = self.EMPTY
self.key_blue_choice = self.EMPTY
self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ShortcutActions", "TimerEditActions"],
@@ -415,9 +417,14 @@ class TimerSanityConflict(Screen):
self["actions"].actions.update({"green":self.toggleTimer1})
self["key_green"].setText(_("Disable"))
self.key_green_choice = self.DISABLE
+
if len(self.timer) > 1:
x = self["list"].getSelectedIndex()
if self.timer[x] is not None:
+ if self.key_yellow_choice == self.EMPTY:
+ self["actions"].actions.update({"yellow":self.editTimer2})
+ self["key_yellow"].setText(_("Edit"))
+ self.key_yellow_choice = self.EDIT
if self.timer[x].disabled and self.key_blue_choice != self.ENABLE:
self["actions"].actions.update({"blue":self.toggleTimer2})
self["key_blue"].setText(_("Enable"))
@@ -432,9 +439,11 @@ class TimerSanityConflict(Screen):
self.key_blue_choice = self.DISABLE
else:
#FIXME.... this doesnt hide the buttons self.... just the text
- self.removeAction("yellow")
- self["key_yellow"].setText(" ")
- self.key_yellow_choice = self.EMPTY
- self.removeAction("blue")
- self["key_blue"].setText(" ")
- self.key_blue_choice = self.EMPTY
+ if self.key_yellow_choice != self.EMPTY:
+ self.removeAction("yellow")
+ self["key_yellow"].setText(" ")
+ self.key_yellow_choice = self.EMPTY
+ if self.key_blue_choice != self.EMPTY:
+ self.removeAction("blue")
+ self["key_blue"].setText(" ")
+ self.key_blue_choice = self.EMPTY