diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-03-02 22:15:48 +0100 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-03-02 22:15:48 +0100 |
commit | 9a17c88423696aeda50a9418ed022d7e85f8e36b (patch) | |
tree | 3928501e4dc1092e4b90807a00dd41a2ea2920d5 | |
parent | c3817faba8228f13e57b599799296be6647b9331 (diff) |
AlbumCover: allow viewing covers in a popup.
-rw-r--r-- | nephilim/plugins/AlbumCover.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py index 6ec62b3..b8b5c79 100644 --- a/nephilim/plugins/AlbumCover.py +++ b/nephilim/plugins/AlbumCover.py @@ -27,10 +27,13 @@ class wgAlbumCover(QtGui.QLabel): # popup menu self.menu = QtGui.QMenu("album") - select_file_action = self.menu.addAction('Select cover file...') + select_file_action = self.menu.addAction('&Select cover file...') + fetch_amazon_action = self.menu.addAction('Fetch cover from &Amazon.') + view_action = self.menu.addAction('&View cover in a separate window.') + self.connect(select_file_action, QtCore.SIGNAL('triggered()'), self.fetch_local_manual) - fetch_amazon_action = self.menu.addAction('Fetch cover from Amazon.') self.connect(fetch_amazon_action, QtCore.SIGNAL('triggered()'), self.fetch_amazon_manual) + self.connect(view_action, QtCore.SIGNAL('triggered()'), self.view_cover) def mousePressEvent(self, event): if event.button() == QtCore.Qt.RightButton: @@ -173,6 +176,14 @@ class wgAlbumCover(QtGui.QLabel): cover.loadFromData(img.read()) return cover + def view_cover(self): + if not self.cover_loaded: + return + win = QtGui.QLabel(self, QtCore.Qt.Window) + win.setScaledContents(True) + win.setPixmap(self.cover) + win.show() + class AlbumCover(Plugin): o = None DEFAULTS = {'coverdir' : '$musicdir/$songdir', 'covername' : '.cover_nephilim_$artist_$album', |