Commit 3deab0a1 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - When adding a file to the playlist by clicking on "Read" in the OpenFile...

Qt4 - When adding a file to the playlist by clicking on "Read" in the OpenFile dialog, the first time it's ok but the next click you add 2 times and then more times the same file.
Patch from Rémi Duraffort.
parent 0b5c3c57
...@@ -126,7 +126,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal, ...@@ -126,7 +126,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() ); BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
/* Buttons action */ /* Buttons action */
BUTTONACT( playButton, play()); BUTTONACT( playButton, selectSlots());
BUTTONACT( cancelButton, cancel()); BUTTONACT( cancelButton, cancel());
/* At creation time, modify the default buttons */ /* At creation time, modify the default buttons */
...@@ -148,22 +148,18 @@ void OpenDialog::setMenuAction() ...@@ -148,22 +148,18 @@ void OpenDialog::setMenuAction()
{ {
switch ( i_action_flag ) switch ( i_action_flag )
{ {
case OPEN_AND_STREAM: case OPEN_AND_STREAM:
playButton->setText( qtr("&Stream") ); playButton->setText( qtr("&Stream") );
BUTTONACT( playButton, stream() ); break;
break; case OPEN_AND_SAVE:
case OPEN_AND_SAVE: playButton->setText( qtr("&Convert / Save") );
playButton->setText( qtr("&Convert / Save") ); break;
BUTTONACT( playButton, transcode() ); case OPEN_AND_ENQUEUE:
break; playButton->setText( qtr("&Enqueue") );
case OPEN_AND_ENQUEUE: break;
playButton->setText( qtr("&Enqueue") ); case OPEN_AND_PLAY:
BUTTONACT( playButton, enqueue() ); default:
break; playButton->setText( qtr("&Play") );
case OPEN_AND_PLAY:
default:
playButton->setText( qtr("&Play") );
BUTTONACT( playButton, play() );
} }
} }
...@@ -231,6 +227,25 @@ void OpenDialog::close() ...@@ -231,6 +227,25 @@ void OpenDialog::close()
} }
/* Play button */ /* Play button */
void OpenDialog::selectSlots()
{
switch ( i_action_flag )
{
case OPEN_AND_STREAM:
stream();
break;
case OPEN_AND_SAVE:
transcode();
break;
case OPEN_AND_ENQUEUE:
enqueue();
break;
case OPEN_AND_PLAY:
default:
play();
}
}
void OpenDialog::play() void OpenDialog::play()
{ {
finish( false ); finish( false );
......
...@@ -61,6 +61,7 @@ public: ...@@ -61,6 +61,7 @@ public:
QString mainMRL; QString mainMRL;
public slots: public slots:
void selectSlots();
void play(); void play();
void stream( bool b_transode_only = false ); void stream( bool b_transode_only = false );
void enqueue(); void enqueue();
......
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