Fix drop on the playlist in all case (DP and MI )
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 25 Aug 2008 07:25:59 +0000 (00:25 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 25 Aug 2008 07:25:59 +0000 (00:25 -0700)
Also set a correct title and icon, when you don't use the pl through THEDP.

modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.hpp
modules/gui/qt4/main_interface.hpp

index 3712d17..2ae4a44 100644 (file)
@@ -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();
+}
+
index d1cf059..5945176 100644 (file)
@@ -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:
index 2efeebc..ca65367 100644 (file)
@@ -70,6 +70,7 @@ class MainInterface : public QVLCMW
 
     friend class VolumeClickHandler;
     friend class InteractionDialog;
+    friend class PlaylistWidget;
 
 public:
     MainInterface( intf_thread_t *);