From 406f83719bc9ceaa5937d48eb10092ed9f9dac04 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Tue, 13 Mar 2007 21:44:05 +0000 Subject: [PATCH] Qt4 - Open Dialog. Add an enqueue button. --- modules/gui/qt4/dialogs/open.cpp | 26 +++++++++++++++++++------- modules/gui/qt4/dialogs/open.hpp | 2 +- modules/gui/qt4/ui/open.ui | 11 +++++++++-- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/modules/gui/qt4/dialogs/open.cpp b/modules/gui/qt4/dialogs/open.cpp index 4f5bfb4534..d0f3209a06 100644 --- a/modules/gui/qt4/dialogs/open.cpp +++ b/modules/gui/qt4/dialogs/open.cpp @@ -74,8 +74,9 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) : CONNECT( ui.slaveText, textChanged(QString), this, updateMRL()); CONNECT( ui.cacheSpinBox, valueChanged(int), this, updateMRL()); - BUTTONACT( ui.closeButton, ok()); + BUTTONACT( ui.closeButton, playOrEnqueue()); BUTTONACT( ui.cancelButton, cancel()); + BUTTONACT( ui.enqueueButton, playOrEnqueue( true )); BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() ); /* Initialize caching */ @@ -110,7 +111,7 @@ void OpenDialog::cancel() reject(); } -void OpenDialog::ok() +void OpenDialog::playOrEnqueue(bool b_enqueue = false ) { this->toggleVisible(); mrl = ui.advancedLineInput->text(); @@ -123,11 +124,22 @@ void OpenDialog::ok() QString mrli = tempMRL[i].remove( QRegExp( "^\"" ) ). remove( QRegExp( "\"\\s+$" ) ); const char * psz_utf8 = qtu( tempMRL[i] ); - /* Play the first one, parse and enqueue the other ones */ - playlist_Add( THEPL, psz_utf8, NULL, - PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) | - ( i ? PLAYLIST_PREPARSE : 0 ), - PLAYLIST_END, VLC_TRUE, VLC_FALSE ); + if ( b_enqueue ) + { + /* Enqueue and Preparse all items*/ + playlist_Add( THEPL, psz_utf8, NULL, + PLAYLIST_APPEND | PLAYLIST_PREPARSE, + PLAYLIST_END, VLC_TRUE, VLC_FALSE ); + + } + else + { + /* Play the first one, parse and enqueue the other ones */ + playlist_Add( THEPL, psz_utf8, NULL, + PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) | + ( i ? PLAYLIST_PREPARSE : 0 ), + PLAYLIST_END, VLC_TRUE, VLC_FALSE ); + } } } diff --git a/modules/gui/qt4/dialogs/open.hpp b/modules/gui/qt4/dialogs/open.hpp index d9909d9f7a..8198cb3997 100644 --- a/modules/gui/qt4/dialogs/open.hpp +++ b/modules/gui/qt4/dialogs/open.hpp @@ -66,7 +66,7 @@ private: int advHeight, mainHeight; private slots: void cancel(); - void ok(); + void playOrEnqueue(bool); void toggleAdvancedPanel(); void updateMRL(QString); void updateMRL(); diff --git a/modules/gui/qt4/ui/open.ui b/modules/gui/qt4/ui/open.ui index 03439a1e28..6dd5bb67d2 100644 --- a/modules/gui/qt4/ui/open.ui +++ b/modules/gui/qt4/ui/open.ui @@ -9,7 +9,7 @@ 0 0 - 525 + 440 231 @@ -164,10 +164,17 @@ + + + + Enqueue + + + - Open + Play -- 2.39.2