[vlc-devel] commit: Restore download cover art context menu that was taken away by my previous (Ilkka Ollakka )

git version control git at videolan.org
Mon Jan 12 16:45:32 CET 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Jan 12 17:44:07 2009 +0200| [afa220789a63e3ad8b9ffd7440c885bf56ebb95c] | committer: Ilkka Ollakka 

Restore download cover art context menu that was taken away by my previous
commit. Thou I think it should invalidate current album art, so core would do
new search for it.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=afa220789a63e3ad8b9ffd7440c885bf56ebb95c
---

 modules/gui/qt4/components/interface_widgets.cpp |   11 +++++++++++
 modules/gui/qt4/components/interface_widgets.hpp |    2 +-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 806e52c..ea8d5a6 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -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;
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index de3d220..269f79a 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -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;




More information about the vlc-devel mailing list