]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/playlist.cpp
Qt4 - When adding a file to the playlist by clicking on "Read" in the OpenFile dialog...
[vlc] / modules / gui / qt4 / dialogs / playlist.cpp
index 47457438aa1180ec2037aa8f54cd1d1359b9384d..c97c587533c3cd0b1259c6905064b7ec91faf74f 100644 (file)
@@ -23,9 +23,7 @@
 
 #include "dialogs/playlist.hpp"
 
-#include "qt4.hpp"
 #include "main_interface.hpp"
-#include "util/qvlcframe.hpp"
 #include "components/interface_widgets.hpp"
 #include "dialogs_provider.hpp"
 #include "menus.hpp"
 
 PlaylistDialog *PlaylistDialog::instance = NULL;
 
-PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
+PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
+                : QVLCMW( _p_intf )
 {
     QWidget *main = new QWidget( this );
     setCentralWidget( main );
     setWindowTitle( qtr( "Playlist" ) );
-
-    createPlMenuBar( menuBar(), p_intf );
+    setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
 
     QHBoxLayout *l = new QHBoxLayout( centralWidget() );
-    PlaylistWidget *plw = new PlaylistWidget( p_intf );
+    PlaylistWidget *plw = new PlaylistWidget( p_intf, NULL );
     l->addWidget( plw );
 
     readSettings( "playlist", QSize( 600,700 ) );
@@ -59,33 +57,14 @@ PlaylistDialog::~PlaylistDialog()
     writeSettings( "playlist" );
 }
 
-void PlaylistDialog::createPlMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
-{
-    QMenu *manageMenu = new QMenu();
-    manageMenu->setTitle( qtr("Manage") );
-    manageMenu->addAction( "Open playlist file", THEDP, SLOT( openPlaylist() ));
-    manageMenu->addSeparator();
-    manageMenu->addAction( "Dock playlist", this, SLOT( dock() ) );
-    bar->addMenu( manageMenu );
-    bar->addMenu( QVLCMenu::SDMenu( p_intf ) );
-}
-
-void PlaylistDialog::dock()
-{
-    hide();
-    QEvent *event = new QEvent( (QEvent::Type)(PLDockEvent_Type) );
-    QApplication::postEvent( p_intf->p_sys->p_mi, event );
-}
-
-
 void PlaylistDialog::dropEvent(QDropEvent *event)
 {
      const QMimeData *mimeData = event->mimeData();
      foreach( QUrl url, mimeData->urls() ) {
         QString s = url.toString();
         if( s.length() > 0 ) {
-            playlist_PlaylistAdd( THEPL, qtu(s), NULL,
-                                  PLAYLIST_APPEND, PLAYLIST_END );
+            playlist_Add( THEPL, qtu(s), NULL,
+                          PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE, VLC_FALSE );
         }
      }
      event->acceptProposedAction();
@@ -103,4 +82,3 @@ void PlaylistDialog::dragLeaveEvent(QDragLeaveEvent *event)
      event->accept();
 }
 
-