Qt4 - When adding a file to the playlist by clicking on "Read" in the OpenFile dialog...
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 5 Dec 2007 17:08:45 +0000 (17:08 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 5 Dec 2007 17:08:45 +0000 (17:08 +0000)
Patch from RĂ©mi Duraffort.

modules/gui/qt4/dialogs/open.cpp
modules/gui/qt4/dialogs/open.hpp

index 8c3b105..d511c00 100644 (file)
@@ -126,7 +126,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
     BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
 
     /* Buttons action */
-    BUTTONACT( playButton, play());
+    BUTTONACT( playButton, selectSlots());
     BUTTONACT( cancelButton, cancel());
 
     /* At creation time, modify the default buttons */
@@ -148,22 +148,18 @@ void OpenDialog::setMenuAction()
 {
     switch ( i_action_flag )
     {
-        case OPEN_AND_STREAM:
-            playButton->setText( qtr("&Stream") );
-            BUTTONACT( playButton, stream() );
-            break;
-        case OPEN_AND_SAVE:
-            playButton->setText( qtr("&Convert / Save") );
-            BUTTONACT( playButton, transcode() );
-            break;
-        case OPEN_AND_ENQUEUE:
-            playButton->setText( qtr("&Enqueue") );
-            BUTTONACT( playButton, enqueue() );
-            break;
-        case OPEN_AND_PLAY:
-        default:
-            playButton->setText( qtr("&Play") );
-            BUTTONACT( playButton, play() );
+    case OPEN_AND_STREAM:
+        playButton->setText( qtr("&Stream") );
+        break;
+    case OPEN_AND_SAVE:
+        playButton->setText( qtr("&Convert / Save") );
+        break;
+    case OPEN_AND_ENQUEUE:
+        playButton->setText( qtr("&Enqueue") );
+        break;
+    case OPEN_AND_PLAY:
+    default:
+        playButton->setText( qtr("&Play") );
    }
 }
 
@@ -231,6 +227,25 @@ void OpenDialog::close()
 }
 
 /* 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()
 {
     finish( false );
index 782a60d..39aabb2 100644 (file)
@@ -61,6 +61,7 @@ public:
     QString mainMRL;
 
 public slots:
+    void selectSlots();
     void play();
     void stream( bool b_transode_only = false );
     void enqueue();