]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open_panels.cpp
qt4: i18n fixes
[vlc] / modules / gui / qt4 / components / open_panels.cpp
index 3376c42a74760a325da95ab5bcce72eb3b351165..0cbb871306084d38148a91d831d0cd492d21dbd5 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * open.cpp : Panels for the open dialogs
  ****************************************************************************
- * Copyright (C) 2006-2008 the VideoLAN team
+ * Copyright (C) 2006-2009 the VideoLAN team
  * Copyright (C) 2007 Société des arts technologiques
  * Copyright (C) 2007 Savoir-faire Linux
  *
@@ -33,7 +33,8 @@
 #include "qt4.hpp"
 #include "components/open_panels.hpp"
 #include "dialogs/open.hpp"
-#include "dialogs_provider.hpp"
+#include "dialogs_provider.hpp" /* Open Subtitle file */
+#include "util/qt_dirs.hpp"
 
 #include <QFileDialog>
 #include <QDialogButtonBox>
 
 #define I_DEVICE_TOOLTIP N_("Select the device or the VIDEO_TS directory")
 
+static const char *psz_devModule[] = { "v4l", "v4l2", "pvr", "dvb", "bda",
+                                       "dshow", "screen", "jack" };
+
 /**************************************************************************
  * Open Files and subtitles                                               *
  **************************************************************************/
 FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
-                                OpenPanel( _parent, _p_intf )
+                                OpenPanel( _parent, _p_intf ), dialogBox( NULL )
 {
     /* Classic UI Setup */
     ui.setupUi( this );
 
-    /** BEGIN QFileDialog tweaking **/
-    /* Use a QFileDialog and customize it because we don't want to
-       rewrite it all. Be careful to your eyes cause there are a few hacks.
-       Be very careful and test correctly when you modify this. */
-
     /* Set Filters for file selection */
-    QString fileTypes = "";
+/*    QString fileTypes = "";
     ADD_FILTER_MEDIA( fileTypes );
     ADD_FILTER_VIDEO( fileTypes );
     ADD_FILTER_AUDIO( fileTypes );
     ADD_FILTER_PLAYLIST( fileTypes );
     ADD_FILTER_ALL( fileTypes );
-    fileTypes.replace( QString(";*"), QString(" *"));
+    fileTypes.replace( QString(";*"), QString(" *")); */
+
+
+/*    lineFileEdit = ui.fileEdit;
+    //TODO later: fill the fileCompleteList with previous items played.
+    QCompleter *fileCompleter = new QCompleter( fileCompleteList, this );
+    fileCompleter->setModel( new QDirModel( fileCompleter ) );
+    lineFileEdit->setCompleter( fileCompleter );*/
+    if( config_GetInt( p_intf, "qt-embedded-open" ) )
+    {
+        ui.tempWidget->hide();
+        BuildOldPanel();
+    }
+
+    /* Subtitles */
+    /* Deactivate the subtitles control by default. */
+    ui.subFrame->setEnabled( false );
+    /* Build the subs size combo box */
+    setfillVLCConfigCombo( "freetype-rel-fontsize" , p_intf,
+                            ui.sizeSubComboBox );
+    /* Build the subs align combo box */
+    setfillVLCConfigCombo( "subsdec-align", p_intf, ui.alignSubComboBox );
 
-    // Make this QFileDialog a child of tempWidget from the ui.
+    /* Connects  */
+    BUTTONACT( ui.fileBrowseButton, browseFile() );
+    BUTTONACT( ui.delFileButton, deleteFile() );
+
+    BUTTONACT( ui.subBrowseButton, browseFileSub() );
+    CONNECT( ui.subCheckBox, toggled( bool ), this, toggleSubtitleFrame( bool ) );
+
+    CONNECT( ui.fileListWidg, itemChanged( QListWidgetItem * ), this, updateMRL() );
+    CONNECT( ui.subInput, textChanged( const QString& ), this, updateMRL() );
+    CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL() );
+    CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL() );
+}
+
+inline void FileOpenPanel::BuildOldPanel()
+{
+    /** BEGIN QFileDialog tweaking **/
+    /* Use a QFileDialog and customize it because we don't want to
+       rewrite it all. Be careful to your eyes cause there are a few hacks.
+       Be very careful and test correctly when you modify this. */
+
+    /* Make this QFileDialog a child of tempWidget from the ui. */
     dialogBox = new FileOpenBox( ui.tempWidget, NULL,
-            qfu( p_intf->p_sys->psz_filepath ), fileTypes );
+            qfu( p_intf->p_sys->psz_filepath ), "" );
 
     dialogBox->setFileMode( QFileDialog::ExistingFiles );
     dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
-#if HAS_QT43
     dialogBox->restoreState(
             getSettings()->value( "file-dialog-state" ).toByteArray() );
-#endif
 
     /* We don't want to see a grip in the middle of the window, do we? */
     dialogBox->setSizeGripEnabled( false );
@@ -96,11 +134,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     /* Ugly hacks to get the good Widget */
     //This lineEdit is the normal line in the fileDialog.
-#if HAS_QT43
-    lineFileEdit = dialogBox->findChildren<QLineEdit*>()[0];
-#else
-    lineFileEdit = dialogBox->findChildren<QLineEdit*>()[1];
-#endif
+    QLineEdit *lineFileEdit = dialogBox->findChildren<QLineEdit*>()[0];
     /* Make a list of QLabel inside the QFileDialog to access the good ones */
     QList<QLabel *> listLabel = dialogBox->findChildren<QLabel*>();
 
@@ -117,36 +151,38 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     // Add the DialogBox to the layout
     ui.gridLayout->addWidget( dialogBox, 0, 0, 1, 3 );
 
-    //TODO later: fill the fileCompleteList with previous items played.
-    QCompleter *fileCompleter = new QCompleter( fileCompleteList, this );
-    fileCompleter->setModel( new QDirModel( fileCompleter ) );
-    lineFileEdit->setCompleter( fileCompleter );
-
-    // Hide the subtitles control by default.
-    ui.subFrame->hide();
-
-    /* Build the subs size combo box */
-    setfillVLCConfigCombo( "freetype-rel-fontsize" , p_intf,
-                            ui.sizeSubComboBox );
-
-    /* Build the subs align combo box */
-    setfillVLCConfigCombo( "subsdec-align", p_intf, ui.alignSubComboBox );
+    CONNECT( lineFileEdit, textChanged( const QString& ), this, updateMRL() );
+    dialogBox->installEventFilter( this );
+}
 
-    /* Connects  */
-    BUTTONACT( ui.subBrowseButton, browseFileSub() );
-    BUTTONACT( ui.subCheckBox, toggleSubtitleFrame());
+FileOpenPanel::~FileOpenPanel()
+{
+    if( dialogBox )
+        getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
+}
 
-    CONNECT( lineFileEdit, textChanged( QString ), this, updateMRL() );
-    CONNECT( ui.subInput, textChanged( QString ), this, updateMRL() );
-    CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL() );
-    CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL() );
+void FileOpenPanel::browseFile()
+{
+    QStringList files = QFileDialog::getOpenFileNames( this );
+    foreach( const QString &file, files)
+    {
+        QListWidgetItem *item = new QListWidgetItem( file, ui.fileListWidg );
+        item->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled );
+        ui.fileListWidg->addItem( item );
+    }
+    updateMRL();
 }
 
-FileOpenPanel::~FileOpenPanel()
+void FileOpenPanel::deleteFile()
 {
-#if HAS_QT43
-    getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
-#endif
+    int i = ui.fileListWidg->currentRow();
+    if( i != -1 )
+    {
+        QListWidgetItem *temp = ui.fileListWidg->takeItem( i );
+        delete temp;
+    }
+
+    updateMRL();
 }
 
 /* Show a fileBrowser to select a subtitle */
@@ -154,23 +190,41 @@ void FileOpenPanel::browseFileSub()
 {
     // TODO Handle selection of more than one subtitles file
     QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"),
-                            EXT_FILTER_SUBTITLE,
-                            dialogBox->directory().absolutePath() );
+                           EXT_FILTER_SUBTITLE, p_intf->p_sys->psz_filepath );
+
     if( files.isEmpty() ) return;
     ui.subInput->setText( files.join(" ") );
     updateMRL();
 }
 
+void FileOpenPanel::toggleSubtitleFrame( bool b )
+{
+    ui.subFrame->setEnabled( b );
+
+    /* Update the MRL */
+    updateMRL();
+}
+
+
 /* Update the current MRL */
 void FileOpenPanel::updateMRL()
 {
-    QString mrl = "";
-    foreach( QString file, dialogBox->selectedFiles() ) {
-         mrl += "\"" + file + "\" ";
-    }
+    QStringList fileList;
+    QString mrl;
 
-    if( ui.subCheckBox->isChecked() ) {
-        mrl.append( " :sub-file=\"" + ui.subInput->text() + "\"" );
+    /* File Listing */
+    if( dialogBox == NULL )
+        for( int i = 0; i < ui.fileListWidg->count(); i++ )
+        {
+            if( !ui.fileListWidg->item( i )->text().isEmpty() )
+                fileList << ui.fileListWidg->item( i )->text();
+        }
+    else
+        fileList = dialogBox->selectedFiles();
+
+    /* Options */
+    if( ui.subCheckBox->isChecked() &&  !ui.subInput->text().isEmpty() ) {
+        mrl.append( " :sub-file=" + colon_escape( ui.subInput->text() ) );
         int align = ui.alignSubComboBox->itemData(
                     ui.alignSubComboBox->currentIndex() ).toInt();
         mrl.append( " :subsdec-align=" + QString().setNum( align ) );
@@ -179,42 +233,25 @@ void FileOpenPanel::updateMRL()
         mrl.append( " :freetype-rel-fontsize=" + QString().setNum( size ) );
     }
 
-    emit mrlUpdated( mrl );
+    emit mrlUpdated( fileList, mrl );
     emit methodChanged( "file-caching" );
 }
 
 /* Function called by Open Dialog when clicke on Play/Enqueue */
 void FileOpenPanel::accept()
 {
-    //TODO set the completer
-    p_intf->p_sys->psz_filepath = qtu( dialogBox->directory().absolutePath() );
-}
-
-void FileOpenBox::accept()
-{
-    OpenDialog::getInstance( NULL, NULL, true )->selectSlots();
-}
-
-void FileOpenBox::reject()
-{
-    OpenDialog::getInstance( NULL, NULL, true )->cancel();
+    //FIXME
+ //   p_intf->p_sys->psz_filepath = qtu( dialogBox->directory().absolutePath() );
+    ui.fileListWidg->clear();
 }
 
 /* Function called by Open Dialog when clicked on cancel */
 void FileOpenPanel::clear()
 {
-    lineFileEdit->clear();
+    ui.fileListWidg->clear();
     ui.subInput->clear();
 }
 
-void FileOpenPanel::toggleSubtitleFrame()
-{
-    TOGGLEV( ui.subFrame );
-
-    /* Update the MRL */
-    updateMRL();
-}
-
 /**************************************************************************
  * Open Discs ( DVD, CD, VCD and similar devices )                        *
  **************************************************************************/
@@ -234,7 +271,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     b_firstcdda = true;
 
     ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
-    ui.deviceCombo->setToolTip( I_DEVICE_TOOLTIP );
+    ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
 
 #ifdef WIN32 /* Disc drives probing for Windows */
     char szDrives[512];
@@ -289,6 +326,8 @@ void DiscOpenPanel::clear()
 {
     ui.titleSpin->setValue( 0 );
     ui.chapterSpin->setValue( 0 );
+    ui.subtitlesSpin->setValue( -1 );
+    ui.audioSpin->setValue( -1 );
     b_firstcdda = true;
     b_firstdvd = true;
     b_firstvcd = true;
@@ -353,14 +392,15 @@ void DiscOpenPanel::updateButtons()
 void DiscOpenPanel::updateMRL()
 {
     QString mrl = "";
+    QStringList fileList;
 
-    /* CDDAX and VCDX not implemented. TODO ? */
+    /* CDDAX and VCDX not implemented. TODO ? No. */
     /* DVD */
     if( ui.dvdRadioButton->isChecked() ) {
         if( !ui.dvdsimple->isChecked() )
-            mrl = "\"dvd://";
+            mrl = "dvd://";
         else
-            mrl = "\"dvdsimple://";
+            mrl = "dvdsimple://";
         mrl += ui.deviceCombo->currentText();
         emit methodChanged( "dvdnav-caching" );
 
@@ -373,7 +413,7 @@ void DiscOpenPanel::updateMRL()
 
     /* VCD */
     } else if ( ui.vcdRadioButton->isChecked() ) {
-        mrl = "\"vcd://" + ui.deviceCombo->currentText();
+        mrl = "vcd://" + ui.deviceCombo->currentText();
         emit methodChanged( "vcd-caching" );
 
         if( ui.titleSpin->value() > 0 ) {
@@ -382,13 +422,13 @@ void DiscOpenPanel::updateMRL()
 
     /* CDDA */
     } else {
-        mrl = "\"cdda://" + ui.deviceCombo->currentText();
+        mrl = "cdda://" + ui.deviceCombo->currentText();
         if( ui.titleSpin->value() > 0 ) {
-            QString("@%1").arg( ui.titleSpin->value() );
+            mrl += QString(" :cdda-track=%1").arg( ui.titleSpin->value() );
         }
     }
 
-    mrl += "\"";
+    fileList << mrl; mrl = "";
 
     if ( ui.dvdRadioButton->isChecked() || ui.vcdRadioButton->isChecked() )
     {
@@ -401,7 +441,7 @@ void DiscOpenPanel::updateMRL()
                 QString("%1").arg( ui.subtitlesSpin->value() );
         }
     }
-    emit mrlUpdated( mrl );
+    emit mrlUpdated( fileList, mrl );
 }
 
 void DiscOpenPanel::browseDevice()
@@ -434,8 +474,7 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     CONNECT( ui.protocolCombo, activated( int ),
              this, updateProtocol( int ) );
     CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() );
-    CONNECT( ui.addressText, textChanged( QString ), this, updateMRL());
-    CONNECT( ui.timeShift, clicked(), this, updateMRL());
+    CONNECT( ui.addressText, textChanged( const QString& ), this, updateMRL());
 
     ui.protocolCombo->addItem( "" );
     ui.protocolCombo->addItem("HTTP", QVariant("http"));
@@ -480,7 +519,6 @@ void NetOpenPanel::updateProtocol( int idx_proto ) {
     QString addr = ui.addressText->text();
     QString proto = ui.protocolCombo->itemData( idx_proto ).toString();
 
-    ui.timeShift->setEnabled( idx_proto == UDP_PROTO );
     ui.portSpin->setEnabled( idx_proto == UDP_PROTO ||
                              idx_proto == RTP_PROTO );
 
@@ -577,17 +615,16 @@ void NetOpenPanel::updateMRL() {
         }
     }
 
-    if( ui.timeShift->isEnabled() && ui.timeShift->isChecked() ) {
-        mrl += " :access-filter=timeshift";
-    }
-    emit mrlUpdated( mrl );
+    QStringList qsl; qsl<< mrl;
+    emit mrlUpdated( qsl, "" );
 }
 
 void NetOpenPanel::updateCompleter()
 {
     assert( mrlList );
     QStringList tempL = mrlList->stringList();
-    tempL.append( ui.addressText->text() );
+    if( !tempL.contains( ui.addressText->text() ) )
+        tempL.append( ui.addressText->text() );
     mrlList->setStringList( tempL );
 }
 
@@ -664,7 +701,7 @@ void CaptureOpenPanel::initialize()
     /* dshow CONNECTs */
     CuMRL( vdevDshowW->combo, currentIndexChanged ( int ) );
     CuMRL( adevDshowW->combo, currentIndexChanged ( int ) );
-    CuMRL( dshowVSizeLine, textChanged( QString ) );
+    CuMRL( dshowVSizeLine, textChanged( const QString& ) );
     }
 
     /**************
@@ -680,11 +717,13 @@ void CaptureOpenPanel::initialize()
     bdas->setChecked( true );
     bdac = new QRadioButton( "DVB-C" );
     bdat = new QRadioButton( "DVB-T" );
+    bdaa = new QRadioButton( "ATSC" );
 
     bdaDevLayout->addWidget( bdaTypeLabel, 0, 0 );
     bdaDevLayout->addWidget( bdas, 0, 1 );
     bdaDevLayout->addWidget( bdac, 0, 2 );
     bdaDevLayout->addWidget( bdat, 0, 3 );
+    bdaDevLayout->addWidget( bdaa, 0, 4 );
 
     /* bda Props */
     QLabel *bdaFreqLabel =
@@ -726,9 +765,11 @@ void CaptureOpenPanel::initialize()
     BUTTONACT( bdas, updateButtons() );
     BUTTONACT( bdat, updateButtons() );
     BUTTONACT( bdac, updateButtons() );
+    BUTTONACT( bdaa, updateButtons() );
     BUTTONACT( bdas, updateMRL() );
     BUTTONACT( bdat, updateMRL() );
     BUTTONACT( bdac, updateMRL() );
+    BUTTONACT( bdaa, updateMRL() );
     }
 
 #else /* WIN32 */
@@ -762,8 +803,8 @@ void CaptureOpenPanel::initialize()
             1, 0, 3, 1 );
 
     /* v4l2 CONNECTs */
-    CuMRL( v4l2VideoDevice, textChanged( QString ) );
-    CuMRL( v4l2AudioDevice, textChanged( QString ) );
+    CuMRL( v4l2VideoDevice, textChanged( const QString& ) );
+    CuMRL( v4l2AudioDevice, textChanged( const QString& ) );
     CuMRL( v4l2StdBox,  currentIndexChanged ( int ) );
     }
 
@@ -806,8 +847,8 @@ void CaptureOpenPanel::initialize()
             2, 0, 2, 1 );
 
     /* v4l CONNECTs */
-    CuMRL( v4lVideoDevice, textChanged( QString ) );
-    CuMRL( v4lAudioDevice, textChanged( QString ) );
+    CuMRL( v4lVideoDevice, textChanged( const QString& ) );
+    CuMRL( v4lAudioDevice, textChanged( const QString& ) );
     CuMRL( v4lFreq, valueChanged ( int ) );
     CuMRL( v4lNormBox,  currentIndexChanged ( int ) );
     }
@@ -830,15 +871,15 @@ void CaptureOpenPanel::initialize()
     jackChannels->setAlignment( Qt::AlignRight );
     jackDevLayout->addWidget( jackChannels, 1, 1 );
 
-    /* Jack Props panel */
-
     /* Selected ports */
     QLabel *jackPortsLabel = new QLabel( qtr( "Selected ports:" ) );
-    jackPropLayout->addWidget( jackPortsLabel, 0 , 0 );
+    jackDevLayout->addWidget( jackPortsLabel, 0 , 0 );
 
     jackPortsSelected = new QLineEdit( qtr( ".*") );
     jackPortsSelected->setAlignment( Qt::AlignRight );
-    jackPropLayout->addWidget( jackPortsSelected, 0, 1 );
+    jackDevLayout->addWidget( jackPortsSelected, 0, 1 );
+
+    /* Jack Props panel */
 
     /* Caching */
     QLabel *jackCachingLabel = new QLabel( qtr( "Input caching:" ) );
@@ -848,7 +889,7 @@ void CaptureOpenPanel::initialize()
     jackCaching->setSuffix( " ms" );
     jackCaching->setValue(1000);
     jackCaching->setAlignment( Qt::AlignRight );
-    jackPropLayout->addWidget( jackCaching, 1 , 1 );
+    jackPropLayout->addWidget( jackCaching, 1 , 2 );
 
     /* Pace */
     jackPace = new QCheckBox(qtr( "Use VLC pace" ));
@@ -856,14 +897,14 @@ void CaptureOpenPanel::initialize()
 
     /* Auto Connect */
     jackConnect = new QCheckBox( qtr( "Auto connnection" ));
-    jackPropLayout->addWidget( jackConnect, 3, 1 );
+    jackPropLayout->addWidget( jackConnect, 2, 2 );
 
     /* Jack CONNECTs */
     CuMRL( jackChannels, valueChanged( int ) );
     CuMRL( jackCaching, valueChanged( int ) );
     CuMRL( jackPace, stateChanged( int ) );
     CuMRL( jackConnect, stateChanged( int ) );
-    CuMRL( jackPortsSelected, textChanged( QString ) );
+    CuMRL( jackPortsSelected, textChanged( const QString& ) );
     }
 
     /************
@@ -914,8 +955,8 @@ void CaptureOpenPanel::initialize()
             3, 0, 1, 1 );
 
     /* PVR CONNECTs */
-    CuMRL( pvrDevice, textChanged( QString ) );
-    CuMRL( pvrRadioDevice, textChanged( QString ) );
+    CuMRL( pvrDevice, textChanged( const QString& ) );
+    CuMRL( pvrRadioDevice, textChanged( const QString& ) );
 
     CuMRL( pvrFreq, valueChanged ( int ) );
     CuMRL( pvrBitr, valueChanged ( int ) );
@@ -988,8 +1029,8 @@ void CaptureOpenPanel::initialize()
      * Screen *
      **********/
     addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop" );
-    QLabel *screenLabel = new QLabel( "This option will open your own "
-            "desktop in order to save or stream it.");
+    QLabel *screenLabel = new QLabel( "Your display will will be "
+            "opened and played in order to stream or save it." );
     screenLabel->setWordWrap( true );
     screenDevLayout->addWidget( screenLabel, 0, 0 );
 
@@ -1025,6 +1066,7 @@ void CaptureOpenPanel::clear()
 void CaptureOpenPanel::updateMRL()
 {
     QString mrl = "";
+    QStringList fileList;
     int i_devicetype = ui.deviceCombo->itemData(
             ui.deviceCombo->currentIndex() ).toInt();
     switch( i_devicetype )
@@ -1034,77 +1076,84 @@ void CaptureOpenPanel::updateMRL()
         if( bdas->isChecked() ) mrl = "dvb-s://";
         else if(  bdat->isChecked() ) mrl = "dvb-t://";
         else if(  bdac->isChecked() ) mrl = "dvb-c://";
+        else if(  bdaa->isChecked() ) mrl = "atsc://";
         else return;
-        mrl += " :dvb-frequency=" + QString("%1").arg( bdaFreq->value() );
+        fileList << mrl; mrl = "";
+
+        mrl += " :dvb-frequency=" + QString::number( bdaFreq->value() );
         if( bdas->isChecked() || bdac->isChecked() )
-            mrl += " :dvb-srate=" + QString("%1").arg( bdaSrate->value() );
-        else
+            mrl += " :dvb-srate=" + QString::number( bdaSrate->value() );
+        else if( bdat->isChecked() )
             mrl += " :dvb-bandwidth=" +
-                QString("%1").arg( bdaBandBox->itemData(
+                QString::number( bdaBandBox->itemData(
                     bdaBandBox->currentIndex() ).toInt() );
         break;
     case DSHOW_DEVICE:
-        mrl = "dshow://";
-        mrl+= " :dshow-vdev=" + QString("\"%1\"").arg( vdevDshowW->getValue() );
-        mrl+= " :dshow-adev=" + QString("\"%1\"").arg( adevDshowW->getValue() );
+        fileList << "dshow://";
+        mrl+= " :dshow-vdev=" +
+            colon_escape( QString("%1").arg( vdevDshowW->getValue() ) );
+        mrl+= " :dshow-adev=" +
+            colon_escape( QString("%1").arg( adevDshowW->getValue() ) );
         if( dshowVSizeLine->isModified() )
             mrl += " :dshow-size=" + dshowVSizeLine->text();
         break;
 #else
     case V4L_DEVICE:
-        mrl = "v4l://";
+        fileList << "v4l://";
         mrl += " :v4l-vdev=" + v4lVideoDevice->text();
         mrl += " :v4l-adev=" + v4lAudioDevice->text();
-        mrl += " :v4l-norm=" + QString("%1").arg( v4lNormBox->currentIndex() );
-        mrl += " :v4l-frequency=" + QString("%1").arg( v4lFreq->value() );
+        mrl += " :v4l-norm=" + QString::number( v4lNormBox->currentIndex() );
+        mrl += " :v4l-frequency=" + QString::number( v4lFreq->value() );
         break;
     case V4L2_DEVICE:
-        mrl = "v4l2://";
+        fileList << "v4l2://";
         mrl += " :v4l2-dev=" + v4l2VideoDevice->text();
         mrl += " :v4l2-adev=" + v4l2AudioDevice->text();
-        mrl += " :v4l2-standard=" + QString("%1").arg( v4l2StdBox->currentIndex() );
+        mrl += " :v4l2-standard=" + QString::number( v4l2StdBox->currentIndex() );
         break;
     case JACK_DEVICE:
         mrl = "jack://";
-        mrl += "channels=" + QString("%1").arg( jackChannels->value() );
+        mrl += "channels=" + QString::number( jackChannels->value() );
         mrl += ":ports=" + jackPortsSelected->text();
-        mrl += " --jack-input-caching=" + QString("%1").arg( jackCaching->value() );
+        fileList << mrl; mrl = "";
+
+        mrl += " :jack-input-caching=" + QString::number( jackCaching->value() );
         if ( jackPace->isChecked() )
         {
-                mrl += " --jack-input-use-vlc-pace";
+                mrl += " :jack-input-use-vlc-pace";
         }
         if ( jackConnect->isChecked() )
         {
-                mrl += " --jack-input-auto-connect";
+                mrl += " :jack-input-auto-connect";
         }
         break;
     case PVR_DEVICE:
-        mrl = "pvr://";
+        fileList << "pvr://";
         mrl += " :pvr-device=" + pvrDevice->text();
         mrl += " :pvr-radio-device=" + pvrRadioDevice->text();
-        mrl += " :pvr-norm=" + QString("%1").arg( pvrNormBox->currentIndex() );
+        mrl += " :pvr-norm=" + QString::number( pvrNormBox->currentIndex() );
         if( pvrFreq->value() )
-            mrl += " :pvr-frequency=" + QString("%1").arg( pvrFreq->value() );
+            mrl += " :pvr-frequency=" + QString::number( pvrFreq->value() );
         if( pvrBitr->value() )
-            mrl += " :pvr-bitrate=" + QString("%1").arg( pvrBitr->value() );
+            mrl += " :pvr-bitrate=" + QString::number( pvrBitr->value() );
         break;
     case DVB_DEVICE:
-        mrl = "dvb://";
-        mrl += " :dvb-adapter=" + QString("%1").arg( dvbCard->value() );
-        mrl += " :dvb-frequency=" + QString("%1").arg( dvbFreq->value() );
-        mrl += " :dvb-srate=" + QString("%1").arg( dvbSrate->value() );
+        fileList << "dvb://";
+        mrl += " :dvb-adapter=" + QString::number( dvbCard->value() );
+        mrl += " :dvb-frequency=" + QString::number( dvbFreq->value() );
+        mrl += " :dvb-srate=" + QString::number( dvbSrate->value() );
         break;
 #endif
     case SCREEN_DEVICE:
-        mrl = "screen://";
-        mrl += " :screen-fps=" + QString("%1").arg( screenFPS->value() );
+        fileList << "screen://";
+        mrl = " :screen-fps=" + QString::number( screenFPS->value() );
         updateButtons();
         break;
     }
 
     if( !advMRL.isEmpty() ) mrl += advMRL;
 
-    emit mrlUpdated( mrl );
+    emit mrlUpdated( fileList, mrl );
 }
 
 /**
@@ -1131,7 +1180,7 @@ void CaptureOpenPanel::updateButtons()
             bdaBandBox->hide();
             bdaBandLabel->hide();
         }
-        else
+        else if( bdat->isChecked() )
         {
             bdaSrate->hide();
             bdaSrateLabel->hide();
@@ -1190,7 +1239,7 @@ void CaptureOpenPanel::advancedDialog()
     scroll->setWidget( advFrame );
 
     /* Create the options inside the FrameLayout */
-    for( int n = 0; n < i_confsize; n++ )
+    for( int n = 0; n < (int)i_confsize; n++ )
     {
         module_config_t *p_item = p_config + n;
         ConfigControl *config = ConfigControl::createControl(
@@ -1238,7 +1287,7 @@ void CaptureOpenPanel::advancedDialog()
                 case CONFIG_ITEM_FILE:
                 case CONFIG_ITEM_DIRECTORY:
                 case CONFIG_ITEM_MODULE:
-                    tempMRL += QString("=\"%1\"").arg( qobject_cast<VStringConfigControl *>(control)->getValue() );
+                    tempMRL += colon_escape( QString("=%1").arg( qobject_cast<VStringConfigControl *>(control)->getValue() ) );
                     break;
                 case CONFIG_ITEM_INTEGER:
                     tempMRL += QString("=%1").arg( qobject_cast<VIntConfigControl *>(control)->getValue() );