* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
******************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "dialogs/playlist.hpp"
-#include "qt4.hpp"
#include "main_interface.hpp"
-#include "util/qvlcframe.hpp"
-#include "components/interface_widgets.hpp"
+#include "components/playlist/playlist.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 );
- l->addWidget( plw );
- readSettings( "playlist", QSize( 600,700 ) );
-}
+ getSettings()->beginGroup("playlistdialog");
-PlaylistDialog::~PlaylistDialog()
-{
- writeSettings( "playlist" );
-}
+ playlistWidget = new PlaylistWidget( p_intf );
+ l->addWidget( playlistWidget );
-void PlaylistDialog::createPlMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
-{
- QMenu *manageMenu = new QMenu();
- manageMenu->setTitle( qtr("Manage") );
- manageMenu->addAction( qtr("Open playlist file"), THEDP,
- SLOT( openPlaylist() ), qtr( "Ctrl+X") );
- manageMenu->addSeparator();
- manageMenu->addAction( qtr("Dock playlist"), this, SLOT( dock() ),
- qtr( "Ctrl+U" ) );
- bar->addMenu( manageMenu );
- bar->addMenu( QVLCMenu::SDMenu( p_intf ) );
+ readSettings( getSettings(), QSize( 600,700 ) );
+
+ getSettings()->endGroup();
}
-void PlaylistDialog::dock()
+PlaylistDialog::~PlaylistDialog()
{
- hide();
- QEvent *event = new QEvent( (QEvent::Type)(PLDockEvent_Type) );
- QApplication::postEvent( p_intf->p_sys->p_mi, event );
+ getSettings()->beginGroup("playlistdialog");
+ writeSettings( getSettings() );
+ getSettings()->endGroup();
}
-
-void PlaylistDialog::dropEvent(QDropEvent *event)
+void PlaylistDialog::dropEvent( QDropEvent *event )
{
const QMimeData *mimeData = event->mimeData();
foreach( QUrl url, mimeData->urls() ) {
- QString s = url.toString();
+ QString s = toNativeSeparators( url.toString() );
if( s.length() > 0 ) {
playlist_Add( THEPL, qtu(s), NULL,
- PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE, VLC_FALSE );
+ PLAYLIST_APPEND, PLAYLIST_END, true, false );
}
}
event->acceptProposedAction();
}
-void PlaylistDialog::dragEnterEvent(QDragEnterEvent *event)
+void PlaylistDialog::dragEnterEvent( QDragEnterEvent *event )
{
event->acceptProposedAction();
}
-void PlaylistDialog::dragMoveEvent(QDragMoveEvent *event)
+void PlaylistDialog::dragMoveEvent( QDragMoveEvent *event )
{
event->acceptProposedAction();
}
-void PlaylistDialog::dragLeaveEvent(QDragLeaveEvent *event)
+void PlaylistDialog::dragLeaveEvent( QDragLeaveEvent *event )
{
event->accept();
}
-