]> git.sesse.net Git - vlc/commitdiff
Restore download cover art context menu that was taken away by my previous
authorIlkka Ollakka <ileoo@videolan.org>
Mon, 12 Jan 2009 15:44:07 +0000 (17:44 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Mon, 12 Jan 2009 15:44:07 +0000 (17:44 +0200)
commit. Thou I think it should invalidate current album art, so core would do
new search for it.

modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp

index 806e52c6301afe74e53580bb9d27bb2666283f57..ea8d5a6ee7e2201f37c9cc440500406c62fb0754 100644 (file)
@@ -413,10 +413,21 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
     setMaximumHeight( 128 );
     setMaximumWidth( 128 );
     setScaledContents( true );
+    QList< QAction* > artActions = actions();
+    QAction *action = new QAction( qtr( "Download cover art" ), this );
+    addAction( action );
+    CONNECT( action, triggered(), this, doUpdate() );
 
     doUpdate();
 }
 
+CoverArtLabel::~CoverArtLabel()
+{
+    QList< QAction* > artActions = actions();
+    foreach( QAction *act, artActions )
+        removeAction( act );
+}
+
 void CoverArtLabel::doUpdate( QString url )
 {
     QPixmap pix;
index de3d220e9599905db16d47ae27c281c59d10ba17..269f79a9a7bd8deee1770ab1c584a6dd1f9e614b 100644 (file)
@@ -194,7 +194,7 @@ class CoverArtLabel : public QLabel
     Q_OBJECT
 public:
     CoverArtLabel( QWidget *parent, intf_thread_t * );
-    virtual ~CoverArtLabel(){};
+    virtual ~CoverArtLabel();
 
 private:
     intf_thread_t *p_intf;