]> git.sesse.net Git - vlc/commitdiff
Qt4 - Open Dialog. Add an enqueue button.
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 13 Mar 2007 21:44:05 +0000 (21:44 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 13 Mar 2007 21:44:05 +0000 (21:44 +0000)
modules/gui/qt4/dialogs/open.cpp
modules/gui/qt4/dialogs/open.hpp
modules/gui/qt4/ui/open.ui

index 4f5bfb45340ee94a777a65ac032cf4174aa823c6..d0f3209a062eccc749cde5666ee32725547ee2de 100644 (file)
@@ -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 );
+             }
         }
 
     }
index d9909d9f7a886678920d0a7df001f8b1a0cdd173..8198cb3997d9755f6576727ffee75a40b173afa8 100644 (file)
@@ -66,7 +66,7 @@ private:
     int advHeight, mainHeight;
 private slots:
     void cancel();
-    void ok();
+    void playOrEnqueue(bool);
     void toggleAdvancedPanel();
     void updateMRL(QString);
     void updateMRL();
index 03439a1e2888512db741356d643c653c91471bf0..6dd5bb67d24bfc9401437ccab7836481b8192301 100644 (file)
@@ -9,7 +9,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>525</width>
+    <width>440</width>
     <height>231</height>
    </rect>
   </property>
        </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>