[vlc-devel] commit: Fix drop on the playlist in all case (DP and MI ) ( Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Aug 25 09:23:22 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Aug 25 00:25:59 2008 -0700| [5917494b8a9c06d369ec9a5330f708d59b866efb] | committer: Jean-Baptiste Kempf 

Fix drop on the playlist in all case (DP and MI )

Also set a correct title and icon, when you don't use the pl through THEDP.

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

 modules/gui/qt4/components/playlist/playlist.cpp |   15 +++++++++++++++
 modules/gui/qt4/components/playlist/playlist.hpp |    3 +++
 modules/gui/qt4/main_interface.hpp               |    1 +
 3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index 3712d17..2ae4a44 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -123,6 +123,10 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i,
     // with other uses of the same component...
     // getSettings()->beginGroup( "playlist" );
     restoreState( getSettings()->value("splitterSizes").toByteArray());
+
+    setAcceptDrops( true );
+    setWindowTitle( qtr( "Playlist" ) );
+    setWindowIcon( QApplication::windowIcon() );
 }
 
 void PlaylistWidget::setArt( QString url )
@@ -141,3 +145,14 @@ PlaylistWidget::~PlaylistWidget()
     getSettings()->endGroup();
 }
 
+#include "main_interface.hpp"
+void PlaylistWidget::dropEvent(QDropEvent *event)
+{
+    if( p_intf->p_sys->p_mi )
+        p_intf->p_sys->p_mi->dropEvent( event );
+}
+void PlaylistWidget::dragEnterEvent(QDragEnterEvent *event)
+{
+    event->acceptProposedAction();
+}
+
diff --git a/modules/gui/qt4/components/playlist/playlist.hpp b/modules/gui/qt4/components/playlist/playlist.hpp
index d1cf059..5945176 100644
--- a/modules/gui/qt4/components/playlist/playlist.hpp
+++ b/modules/gui/qt4/components/playlist/playlist.hpp
@@ -56,6 +56,9 @@ private:
     QWidget *parent;
 protected:
     intf_thread_t *p_intf;
+    void dropEvent( QDropEvent *);
+    void dragEnterEvent( QDragEnterEvent * );
+
 private slots:
     void setArt( QString );
 signals:
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 2efeebc..ca65367 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -70,6 +70,7 @@ class MainInterface : public QVLCMW
 
     friend class VolumeClickHandler;
     friend class InteractionDialog;
+    friend class PlaylistWidget;
 
 public:
     MainInterface( intf_thread_t *);




More information about the vlc-devel mailing list