Commit 69204454 authored by Clément Stenac's avatar Clément Stenac

Cosmetics + Enable menu in playlist

parent 6a42cf33
......@@ -32,6 +32,8 @@ PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf,
{
model = new PLModel( THEPL, THEPL->p_root_category, 1, this );
view = new QTreeView( 0 );
view->setIconSize( QSize( 24,24 ) );
view->setAlternatingRowColors( true );
view->setIndentation( 0 );
view->header()->hide();
view->setModel( model );
......
......@@ -43,6 +43,8 @@ StandardPLPanel::StandardPLPanel( QWidget *_parent, intf_thread_t *_p_intf,
model = new PLModel( p_playlist, p_root, -1, this );
view = new QVLCTreeView( 0 );
view->setModel(model);
view->setIconSize( QSize(20,20) );
view->setAlternatingRowColors( true );
view->header()->resizeSection( 0, 300 );
view->setSelectionMode( QAbstractItemView::ExtendedSelection );
......
......@@ -33,9 +33,9 @@ PlaylistDialog *PlaylistDialog::instance = NULL;
PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
{
setWindowTitle( qtr( "Playlist" ) );
QWidget *main = new QWidget( this );
setCentralWidget( main );
setWindowTitle( qtr( "Playlist" ) );
QVLCMenu::createPlMenuBar( menuBar(), p_intf );
selector = new PLSelector( centralWidget(), p_intf, THEPL );
......@@ -50,7 +50,7 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
layout->addWidget( selector, 0 );
layout->addWidget( rightPanel, 10 );
centralWidget()->setLayout( layout );
readSettings( "playlist", QSize( 600,300 ) );
readSettings( "playlist", QSize( 600,500 ) );
}
PlaylistDialog::~PlaylistDialog()
......
......@@ -173,19 +173,33 @@ void DialogsProvider::menuUpdateAction( QObject *data )
void DialogsProvider::simpleAppendDialog()
{
QStringList files = showSimpleOpen();
QString file;
foreach( file, files )
{
const char * psz_utf8 = file.toUtf8().data();
playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8,
PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END );
}
}
void DialogsProvider::simpleOpenDialog()
{
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
QStringList files = showSimpleOpen();
QString file;
for( size_t i = 0 ; i< files.size(); i++ )
{
return;
const char * psz_utf8 = files[i].toUtf8().data();
/* Play the first one, parse and enqueue the other ones */
playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |
( i ? PLAYLIST_PREPARSE : 0 ),
PLAYLIST_END );
}
}
QStringList DialogsProvider::showSimpleOpen()
{
QString FileTypes;
FileTypes = "Video Files ( ";
FileTypes += EXTENSIONS_VIDEO;
......@@ -193,27 +207,10 @@ void DialogsProvider::simpleOpenDialog()
FileTypes += EXTENSIONS_AUDIO;
FileTypes += ");; PlayList Files ( ";
FileTypes += EXTENSIONS_PLAYLIST;
FileTypes += ");; Subtitles Files ( ";
FileTypes += EXTENSIONS_SUBTITLE;
FileTypes += ");; All Files (*.*) " ;
FileTypes.replace(QString(";*"), QString(" *"));
QStringList fileList = QFileDialog::getOpenFileNames(
NULL, qfu(I_POP_SEL_FILES ), p_intf->p_vlc->psz_homedir,
FileTypes);
QStringList files = fileList;
for (size_t i = 0; i < files.size(); i++)
{
const char * psz_utf8 = files[i].toUtf8().data();
playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |
(i ? PLAYLIST_PREPARSE : 0 ),
PLAYLIST_END );
}
vlc_object_release(p_playlist);
return QFileDialog::getOpenFileNames( NULL, qfu(I_POP_SEL_FILES ),
p_intf->p_vlc->psz_homedir, FileTypes );
}
void DialogsProvider::bookmarksDialog()
......
......@@ -39,7 +39,7 @@ class DialogsProvider : public QObject
{
Q_OBJECT;
public:
static DialogsProvider *getInstance()
static DialogsProvider *getInstance()
{
assert( instance );
return instance;
......@@ -62,6 +62,7 @@ private:
DialogsProvider( intf_thread_t *);
intf_thread_t *p_intf;
static DialogsProvider *instance;
QStringList showSimpleOpen();
public slots:
void playlistDialog();
......
......@@ -131,6 +131,7 @@ void QVLCMenu::createMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
void QVLCMenu::createPlMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
{
QMenu *manageMenu = new QMenu();
manageMenu->setTitle( qtr("Operations") );
manageMenu->addAction( "Quick &Add File...", THEDP,
SLOT( simpleAppendDialog() ) );
manageMenu->addSeparator();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment