]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/open.cpp
Qt: correctly split options and escape ':' so if your dshow devices or your subtitle...
[vlc] / modules / gui / qt4 / dialogs / open.cpp
index e8db45e02e6acb685c335506043fd8c2244d9b21..db1e67f67996f1a634c892c7619a5a5b20fafc5a 100644 (file)
 #include "dialogs_provider.hpp"
 
 #include "recents.hpp"
+#include "util/qt_dirs.hpp"
 
 #include <QTabWidget>
 #include <QGridLayout>
 #include <QRegExp>
 #include <QMenu>
 
+#define DEBUG_QT 1
+
 OpenDialog *OpenDialog::instance = NULL;
 
 OpenDialog* OpenDialog::getInstance( QWidget *parent, intf_thread_t *p_intf,
@@ -85,7 +88,7 @@ OpenDialog::OpenDialog( QWidget *parent,
 
     /* Basic Creation of the Window */
     ui.setupUi( this );
-    setWindowTitle( qtr( "Open Media" ) );
+    setWindowTitle( qtr( "Open Media" ) );
 
     /* Tab definition and creation */
     fileOpenPanel    = new FileOpenPanel( this, p_intf );
@@ -181,6 +184,7 @@ OpenDialog::OpenDialog( QWidget *parent,
     newCachingMethod( "file-caching" );
 
     setMinimumSize( sizeHint() );
+    setMaximumWidth( 900 );
     resize( getSettings()->value( "opendialog-size", QSize( 500, 490 ) ).toSize() );
 }
 
@@ -349,16 +353,19 @@ void OpenDialog::finish( bool b_enqueue = false )
         if( i == 0 )
         {
             /* Take options from the UI, not from what we stored */
-            QStringList optionsList = ui.advancedLineInput->text().split( ":" );
+            QStringList optionsList = ui.advancedLineInput->text().split( " :" );
 
             /* Insert options */
             for( int j = 0; j < optionsList.size(); j++ )
             {
-                QString qs = optionsList[j].trimmed();
+                QString qs = colon_unescape( optionsList[j] );
                 if( !qs.isEmpty() )
                 {
-                    input_item_AddOption( p_input, qtu( qs ), VLC_INPUT_OPTION_TRUSTED );
-                    //  msg_Err( p_intf, "Here %s", qtu( qs ));
+                    input_item_AddOption( p_input, qtu( qs ),
+                                          VLC_INPUT_OPTION_TRUSTED );
+#ifdef DEBUG_QT
+                    msg_Warn( p_intf, "Input option: %s", qtu( qs ) );
+#endif
                 }
             }
         }
@@ -382,13 +389,14 @@ void OpenDialog::transcode()
 
 void OpenDialog::stream( bool b_transcode_only )
 {
-    QString soutMRL = getMRL();
+    QString soutMRL = getMRL( false );
     if( soutMRL.isEmpty() ) return;
     toggleVisible();
 
     /* Dbg and send :D */
     msg_Dbg( p_intf, "MRL passed to the Sout: %s", qtu( soutMRL ) );
-    THEDP->streamingDialog( this, soutMRL, b_transcode_only );
+    THEDP->streamingDialog( this, soutMRL, b_transcode_only,
+                            ui.advancedLineInput->text().split( ":" ) );
 }
 
 /* Update the MRL */