summaryrefslogtreecommitdiff
path: root/nephilim/plugins
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-03-01 18:35:49 +0100
committerAnton Khirnov <wyskas@gmail.com>2009-03-01 18:35:49 +0100
commitee3417863511f6d7fcca5a79a6d1ed806352835a (patch)
tree3be6846d1a54f394a9435a3139d893172e434e98 /nephilim/plugins
parent94ea8a8e929c01f18d62d503aaa14cb1ffba1f47 (diff)
AlbumCover: cosmetics.
Diffstat (limited to 'nephilim/plugins')
-rw-r--r--nephilim/plugins/AlbumCover.py29
1 files changed, 11 insertions, 18 deletions
diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py
index d124146..3cf54aa 100644
--- a/nephilim/plugins/AlbumCover.py
+++ b/nephilim/plugins/AlbumCover.py
@@ -21,9 +21,9 @@ class wgAlbumCover(QtGui.QLabel):
cover_dirname = None
cover_filepath = None
menu = None
- def __init__(self, p, parent=None):
- QtGui.QWidget.__init__(self,parent)
- self.p=p
+ def __init__(self, p):
+ QtGui.QWidget.__init__(self)
+ self.p = p
self.setAlignment(QtCore.Qt.AlignCenter)
# popup menu
@@ -34,7 +34,7 @@ class wgAlbumCover(QtGui.QLabel):
self.connect(fetch_amazon_action, QtCore.SIGNAL('triggered()'), self.fetch_amazon)
def mousePressEvent(self, event):
- if event.button()==QtCore.Qt.RightButton:
+ if event.button() == QtCore.Qt.RightButton:
self.menu.popup(event.globalPos())
def select_cover_file(self):
@@ -178,27 +178,20 @@ class AlbumCover(Plugin):
'method0' : 1, 'method1' : 1}
def __init__(self, winMain):
Plugin.__init__(self, winMain, 'AlbumCover')
+ self.addListener('onSongChange' , self.refresh)
+ self.addListener('onReady' , self.refresh)
+ self.addListener('onDisconnect' , self.refresh)
+ self.addListener('onStateChange', self.refresh)
def _load(self):
self.o = wgAlbumCover(self, None)
- self.mpclient.add_listener('onSongChange' , self.o.refresh)
- self.mpclient.add_listener('onReady' , self.o.refresh)
- self.mpclient.add_listener('onDisconnect' , self.o.refresh)
- self.mpclient.add_listener('onStateChange', self.o.refresh)
- self.o.refresh()
def _unload(self):
self.o = None
def getInfo(self):
return "Display the album cover of the currently playing album."
- def getExtInfo(self):
- return "Displays the album cover of the currently playing album in a widget.\n" \
- "This album cover can be fetched from various locations:\n" \
- " local dir: the directory in which the album is located;\n" \
- " internet: look on amazon for the album and corresponding cover\n" \
- "Settings:\n" \
- " albumcover.fetch$i: what source to fetch from on step $i. If step $i fails, move on to step $i+1;\n" \
- " albumcover.downloadto: where to download album covers from internet to. This string can contain the normal tags of the current playing song, plus $music_dir and $cover.\n" \
- " albumcover.files: comma separated list of filenames (without extension)to be considered an album cover. Extensions jpg, jpeg, png, gif and bmp are used.\n"
+
+ def refresh(self, params = None):
+ self.o.refresh()
def get_cover(self):
return self.o.get_cover()