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 ) :
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,12 +124,23 @@ void OpenDialog::ok()
QString mrli = tempMRL[i].remove( QRegExp( "^\"" ) ).
remove( QRegExp( "\"\\s+$" ) );
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 */
playlist_Add( THEPL, psz_utf8, NULL,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |
( i ? PLAYLIST_PREPARSE : 0 ),
PLAYLIST_END, VLC_TRUE, VLC_FALSE );
}
}
}
else
......
......@@ -66,7 +66,7 @@ private:
int advHeight, mainHeight;
private slots:
void cancel();
void ok();
void playOrEnqueue(bool);
void toggleAdvancedPanel();
void updateMRL(QString);
void updateMRL();
......
......@@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>525</width>
<width>440</width>
<height>231</height>
</rect>
</property>
......@@ -164,10 +164,17 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="enqueueButton" >
<property name="text" >
<string>Enqueue</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closeButton" >
<property name="text" >
<string>Open</string>
<string>Play</string>
</property>
</widget>
</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