#include "qt4.hpp"
#include "main_interface.hpp"
#include "util/qvlcframe.hpp"
-#include "components/playlist/panels.hpp"
-#include "components/playlist/selector.hpp"
+#include "components/interface_widgets.hpp"
#include "dialogs_provider.hpp"
#include "menus.hpp"
+#include <QUrl>
#include <QHBoxLayout>
#include <QSignalMapper>
#include <QMenu>
setCentralWidget( main );
setWindowTitle( qtr( "Playlist" ) );
- createPlMenuBar( menuBar(), p_intf );
+ createPlMenuBar( menuBar(), p_intf );
- selector = new PLSelector( centralWidget(), p_intf, THEPL );
- selector->setMaximumWidth( 130 );
+ QHBoxLayout *l = new QHBoxLayout( centralWidget() );
+ PlaylistWidget *plw = new PlaylistWidget( p_intf );
+ l->addWidget( plw );
- playlist_item_t *p_root = playlist_GetPreferredNode( THEPL,
- THEPL->p_local_category );
-
- rightPanel = qobject_cast<PLPanel *>(new StandardPLPanel( centralWidget(),
- p_intf, THEPL, p_root ) );
- CONNECT( selector, activated( int ), rightPanel, setRoot( int ) );
-
- QHBoxLayout *layout = new QHBoxLayout();
- layout->addWidget( selector, 0 );
- layout->addWidget( rightPanel, 10 );
- centralWidget()->setLayout( layout );
readSettings( "playlist", QSize( 600,700 ) );
}
void PlaylistDialog::createPlMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
{
QMenu *manageMenu = new QMenu();
- manageMenu->setTitle( qtr("Add") );
-
- QMenu *subPlaylist = new QMenu();
- subPlaylist->setTitle( qtr("Add to current playlist") );
- subPlaylist->addAction( "&File...", THEDP,
- SLOT( simplePLAppendDialog() ) );
- subPlaylist->addAction( "&Advanced add...", THEDP,
- SLOT( PLAppendDialog() ) );
- manageMenu->addMenu( subPlaylist );
+ manageMenu->setTitle( qtr("Manage") );
+ manageMenu->addAction( qtr("Open playlist file"), THEDP, SLOT( openPlaylist() ),
+ qtr( "Ctrl+L") );
manageMenu->addSeparator();
-
- QMenu *subML = new QMenu();
- subML->setTitle( qtr("Add to Media library") );
- subML->addAction( "&File...", THEDP,
- SLOT( simpleMLAppendDialog() ) );
- subML->addAction( "Directory", THEDP, SLOT( openMLDirectory() ));
- subML->addAction( "&Advanced add...", THEDP,
- SLOT( MLAppendDialog() ) );
- manageMenu->addMenu( subML );
- manageMenu->addAction( "Open playlist file", THEDP, SLOT( openPlaylist() ));
-
- manageMenu->addAction( "Dock playlist", this, SLOT( dock() ) );
+ manageMenu->addAction( qtr("Dock playlist"), this, SLOT( dock() ),
+ qtr( "Ctrl+U" ) );
bar->addMenu( manageMenu );
bar->addMenu( QVLCMenu::SDMenu( p_intf ) );
}
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_Add( THEPL, qtu(s), NULL,
+ PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE, VLC_FALSE );
+ }
+ }
+ event->acceptProposedAction();
+}
+void PlaylistDialog::dragEnterEvent(QDragEnterEvent *event)
+{
+ event->acceptProposedAction();
+}
+void PlaylistDialog::dragMoveEvent(QDragMoveEvent *event)
+{
+ event->acceptProposedAction();
+}
+void PlaylistDialog::dragLeaveEvent(QDragLeaveEvent *event)
+{
+ event->accept();
+}
+
+