Commit 406f8371 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open Dialog. Add an enqueue button.

parent 403b22d1
...@@ -74,8 +74,9 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) : ...@@ -74,8 +74,9 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) :
CONNECT( ui.slaveText, textChanged(QString), this, updateMRL()); CONNECT( ui.slaveText, textChanged(QString), this, updateMRL());
CONNECT( ui.cacheSpinBox, valueChanged(int), this, updateMRL()); CONNECT( ui.cacheSpinBox, valueChanged(int), this, updateMRL());
BUTTONACT( ui.closeButton, ok()); BUTTONACT( ui.closeButton, playOrEnqueue());
BUTTONACT( ui.cancelButton, cancel()); BUTTONACT( ui.cancelButton, cancel());
BUTTONACT( ui.enqueueButton, playOrEnqueue( true ));
BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() ); BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
/* Initialize caching */ /* Initialize caching */
...@@ -110,7 +111,7 @@ void OpenDialog::cancel() ...@@ -110,7 +111,7 @@ void OpenDialog::cancel()
reject(); reject();
} }
void OpenDialog::ok() void OpenDialog::playOrEnqueue(bool b_enqueue = false )
{ {
this->toggleVisible(); this->toggleVisible();
mrl = ui.advancedLineInput->text(); mrl = ui.advancedLineInput->text();
...@@ -123,12 +124,23 @@ void OpenDialog::ok() ...@@ -123,12 +124,23 @@ void OpenDialog::ok()
QString mrli = tempMRL[i].remove( QRegExp( "^\"" ) ). QString mrli = tempMRL[i].remove( QRegExp( "^\"" ) ).
remove( QRegExp( "\"\\s+$" ) ); remove( QRegExp( "\"\\s+$" ) );
const char * psz_utf8 = qtu( tempMRL[i] ); const char * psz_utf8 = qtu( tempMRL[i] );
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 */ /* Play the first one, parse and enqueue the other ones */
playlist_Add( THEPL, psz_utf8, NULL, playlist_Add( THEPL, psz_utf8, NULL,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) | PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |
( i ? PLAYLIST_PREPARSE : 0 ), ( i ? PLAYLIST_PREPARSE : 0 ),
PLAYLIST_END, VLC_TRUE, VLC_FALSE ); PLAYLIST_END, VLC_TRUE, VLC_FALSE );
} }
}
} }
else else
......
...@@ -66,7 +66,7 @@ private: ...@@ -66,7 +66,7 @@ private:
int advHeight, mainHeight; int advHeight, mainHeight;
private slots: private slots:
void cancel(); void cancel();
void ok(); void playOrEnqueue(bool);
void toggleAdvancedPanel(); void toggleAdvancedPanel();
void updateMRL(QString); void updateMRL(QString);
void updateMRL(); void updateMRL();
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>525</width> <width>440</width>
<height>231</height> <height>231</height>
</rect> </rect>
</property> </property>
...@@ -164,10 +164,17 @@ ...@@ -164,10 +164,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="enqueueButton" >
<property name="text" >
<string>Enqueue</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="closeButton" > <widget class="QPushButton" name="closeButton" >
<property name="text" > <property name="text" >
<string>Open</string> <string>Play</string>
</property> </property>
</widget> </widget>
</item> </item>
......
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