]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open_panels.cpp
Qt: CaptureOpenPanel: fix layout
[vlc] / modules / gui / qt4 / components / open_panels.cpp
index 7cd4d2bd963e1ea9369329c21981dbb814f226d1..ee38d4af406de1e599352a45531e19d12ef3a96c 100644 (file)
@@ -35,6 +35,8 @@
 #include "dialogs/open.hpp"
 #include "dialogs_provider.hpp" /* Open Subtitle file */
 #include "util/qt_dirs.hpp"
+#include <vlc_intf_strings.h>
+#include <vlc_modules.h>
 
 #include <QFileDialog>
 #include <QDialogButtonBox>
 #include <QScrollArea>
 #include <QUrl>
 #include <QStringListModel>
+#include <QDropEvent>
 
-#define I_DEVICE_TOOLTIP N_("Select the device or the VIDEO_TS directory")
+#define I_DEVICE_TOOLTIP \
+    I_DIR_OR_FOLDER( N_("Select a device or a VIDEO_TS directory"), \
+                     N_("Select a device or a VIDEO_TS folder") )
 
 static const char *psz_devModule[] = { "v4l", "v4l2", "pvr", "dvb", "bda",
                                        "dshow", "screen", "jack" };
@@ -61,6 +66,8 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     /* Classic UI Setup */
     ui.setupUi( this );
 
+    setAcceptDrops( true );
+
     /* Set Filters for file selection */
 /*    QString fileTypes = "";
     ADD_FILTER_MEDIA( fileTypes );
@@ -76,7 +83,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     QCompleter *fileCompleter = new QCompleter( fileCompleteList, this );
     fileCompleter->setModel( new QDirModel( fileCompleter ) );
     lineFileEdit->setCompleter( fileCompleter );*/
-    if( config_GetInt( p_intf, "qt-embedded-open" ) )
+    if( var_InheritBool( p_intf, "qt-embedded-open" ) )
     {
         ui.tempWidget->hide();
         BuildOldPanel();
@@ -162,9 +169,48 @@ FileOpenPanel::~FileOpenPanel()
         getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
 }
 
+void FileOpenPanel::dragEnterEvent( QDragEnterEvent *event )
+{
+    event->acceptProposedAction();
+}
+
+void FileOpenPanel::dragMoveEvent( QDragMoveEvent *event )
+{
+    event->acceptProposedAction();
+}
+
+void FileOpenPanel::dragLeaveEvent( QDragLeaveEvent *event )
+{
+    event->accept();
+}
+
+void FileOpenPanel::dropEvent( QDropEvent *event )
+{
+    if( event->possibleActions() & Qt::CopyAction )
+       event->setDropAction( Qt::CopyAction );
+    else
+        return;
+
+    const QMimeData *mimeData = event->mimeData();
+    foreach( const QUrl &url, mimeData->urls() )
+    {
+        if( url.isValid() )
+        {
+            QListWidgetItem *item = new QListWidgetItem(
+                                         toNativeSeparators( url.toLocalFile() ),
+                                         ui.fileListWidg );
+            item->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled );
+            ui.fileListWidg->addItem( item );
+        }
+    }
+    updateMRL();
+    updateButtons();
+    event->accept();
+}
+
 void FileOpenPanel::browseFile()
 {
-    QStringList files = QFileDialog::getOpenFileNames( this );
+    QStringList files = QFileDialog::getOpenFileNames( this, qtr( "Select one or multiple files" ), p_intf->p_sys->filepath) ;
     foreach( const QString &file, files )
     {
         QListWidgetItem *item =
@@ -225,7 +271,11 @@ void FileOpenPanel::updateMRL()
                 fileList << ui.fileListWidg->item( i )->text();
         }
     else
+    {
         fileList = dialogBox->selectedFiles();
+        for( int i = 0; i < fileList.count(); i++ )
+            fileList[i] = toNativeSeparators( fileList[i] );
+    }
 
     /* Options */
     if( ui.subCheckBox->isChecked() &&  !ui.subInput->text().isEmpty() ) {
@@ -274,14 +324,12 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     ui.setupUi( this );
 
     /* Get the default configuration path for the devices */
-    psz_dvddiscpath = config_GetPsz( p_intf, "dvd" );
-    psz_vcddiscpath = config_GetPsz( p_intf, "vcd" );
-    psz_cddadiscpath = config_GetPsz( p_intf, "cd-audio" );
+    psz_dvddiscpath = var_InheritString( p_intf, "dvd" );
+    psz_vcddiscpath = var_InheritString( p_intf, "vcd" );
+    psz_cddadiscpath = var_InheritString( p_intf, "cd-audio" );
 
     /* State to avoid overwritting the users changes with the configuration */
-    b_firstdvd = true;
-    b_firstvcd = true;
-    b_firstcdda = true;
+    m_discType = None;
 
     ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
     ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
@@ -341,9 +389,7 @@ void DiscOpenPanel::clear()
     ui.chapterSpin->setValue( 0 );
     ui.subtitlesSpin->setValue( -1 );
     ui.audioSpin->setValue( -1 );
-    b_firstcdda = true;
-    b_firstdvd = true;
-    b_firstvcd = true;
+    m_discType = None;
 }
 
 #ifdef WIN32
@@ -360,10 +406,10 @@ void DiscOpenPanel::updateButtons()
 {
     if ( ui.dvdRadioButton->isChecked() )
     {
-        if( b_firstdvd )
+        if( m_discType != Dvd )
         {
             setDrive( psz_dvddiscpath );
-            b_firstdvd = false;
+            m_discType = Dvd;
         }
         ui.titleLabel->setText( qtr("Title") );
         ui.chapterLabel->show();
@@ -373,10 +419,10 @@ void DiscOpenPanel::updateButtons()
     }
     else if ( ui.vcdRadioButton->isChecked() )
     {
-        if( b_firstvcd )
+        if( m_discType != Vcd )
         {
             setDrive( psz_vcddiscpath );
-            b_firstvcd = false;
+            m_discType = Vcd;
         }
         ui.titleLabel->setText( qtr("Entry") );
         ui.chapterLabel->hide();
@@ -386,10 +432,10 @@ void DiscOpenPanel::updateButtons()
     }
     else /* CDDA */
     {
-        if( b_firstcdda )
+        if( m_discType != Cdda )
         {
             setDrive( psz_cddadiscpath );
-            b_firstcdda = false;
+            m_discType = Cdda;
         }
         ui.titleLabel->setText( qtr("Track") );
         ui.chapterLabel->hide();
@@ -417,7 +463,10 @@ void DiscOpenPanel::updateMRL()
         else
             mrl = "dvdsimple://";
         mrl += ui.deviceCombo->currentText();
-        emit methodChanged( "dvdnav-caching" );
+        if( !ui.dvdsimple->isChecked() )
+            emit methodChanged( "dvdnav-caching" );
+        else
+            emit methodChanged( "dvdread-caching" );
 
         if ( ui.titleSpin->value() > 0 ) {
             mrl += QString("@%1").arg( ui.titleSpin->value() );
@@ -489,34 +538,22 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     ui.setupUi( this );
 
     /* CONNECTs */
-    CONNECT( ui.protocolCombo, activated( int ),
-             this, updateProtocol( int ) );
-    CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() );
-    CONNECT( ui.addressText, textChanged( const QString& ), this, updateMRL());
-
-    ui.protocolCombo->addItem( "" );
-    ui.protocolCombo->addItem("HTTP", QVariant("http"));
-    ui.protocolCombo->addItem("HTTPS", QVariant("https"));
-    ui.protocolCombo->addItem("MMS", QVariant("mms"));
-    ui.protocolCombo->addItem("FTP", QVariant("ftp"));
-    ui.protocolCombo->addItem("RTSP", QVariant("rtsp"));
-    ui.protocolCombo->addItem("RTP", QVariant("rtp"));
-    ui.protocolCombo->addItem("UDP", QVariant("udp"));
-    ui.protocolCombo->addItem("RTMP", QVariant("rtmp"));
-
-    updateProtocol( ui.protocolCombo->currentIndex() );
-
-    if( config_GetInt( p_intf, "qt-recentplay" ) )
+    CONNECT( ui.urlComboBox->lineEdit(), textChanged( const QString& ), this, updateMRL());
+    CONNECT( ui.urlComboBox, currentIndexChanged( const QString& ), this, updateMRL());
+
+    if( var_InheritBool( p_intf, "qt-recentplay" ) )
     {
         mrlList = new QStringListModel(
                 getSettings()->value( "Open/netMRL" ).toStringList() );
-        QCompleter *completer = new QCompleter( mrlList, this );
-        ui.addressText->setCompleter( completer );
-
-        CONNECT( ui.addressText, editingFinished(), this, updateCompleter() );
+        ui.urlComboBox->setModel( mrlList );
+        ui.urlComboBox->clearEditText();
+        CONNECT( ui.urlComboBox->lineEdit(), editingFinished(), this, updateModel() );
     }
     else
         mrlList = NULL;
+
+    ui.urlComboBox->setValidator( new UrlValidator( this ) );
+    ui.urlComboBox->setFocus();
 }
 
 NetOpenPanel::~NetOpenPanel()
@@ -534,122 +571,76 @@ NetOpenPanel::~NetOpenPanel()
 void NetOpenPanel::clear()
 {}
 
-/* update the widgets according the type of protocol */
-void NetOpenPanel::updateProtocol( int idx_proto ) {
-    QString addr = ui.addressText->text();
-    QString proto = ui.protocolCombo->itemData( idx_proto ).toString();
-
-    ui.portSpin->setEnabled( idx_proto == UDP_PROTO ||
-                             idx_proto == RTP_PROTO );
-
-    if( idx_proto == NO_PROTO ) return;
-
-    /* If we already have a protocol in the address, replace it */
-    if( addr.contains( "://"))
-    {
-        if( idx_proto != UDP_PROTO && idx_proto != RTP_PROTO )
-            addr.replace( QRegExp("^.*://@*"), proto + "://");
-        else if ( ( addr.contains(QRegExp("://((22[4-9])|(23\\d)|(\\[?[fF]{2}[0-9a-fA-F]{2}:))"))) ||
-                ( !addr.contains(QRegExp("^\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}")) &&
-                !addr.contains(QRegExp(":[a-fA-F0-9]{1,4}:")) ) )
-             addr.replace( QRegExp("^.*://"), proto + "://@");
-    else
-             addr.replace( QRegExp("^.*://"), proto + "://");
-        addr.replace( QRegExp("@+"), "@");
-        ui.addressText->setText( addr );
-    }
-    updateMRL();
+static int strcmp_void( const void *k, const void *e )
+{
+    return strcmp( (const char *)k, (const char *)e );
 }
 
-void NetOpenPanel::updateMRL() {
-    QString mrl = "";
-    QString addr = ui.addressText->text();
-    int idx_proto = ui.protocolCombo->currentIndex();
-    if( addr.contains( "://"))
-    {
-        /* Match the correct item in the comboBox */
-        ui.protocolCombo->setCurrentIndex(
-                ui.protocolCombo->findData( addr.section( ':', 0, 0 ) ) );
-        mrl = addr;
-    }
-    else
+void NetOpenPanel::updateMRL()
+{
+    static const struct caching_map
     {
-        switch( idx_proto ) {
-        case HTTP_PROTO:
-            mrl = "http://" + addr;
-            emit methodChanged("http-caching");
-            break;
-        case HTTPS_PROTO:
-            mrl = "https://" + addr;
-            emit methodChanged("http-caching");
-            break;
-        case MMS_PROTO:
-            mrl = "mms://" + addr;
-            emit methodChanged("mms-caching");
-            break;
-        case FTP_PROTO:
-            mrl = "ftp://" + addr;
-            emit methodChanged("ftp-caching");
-            break;
-        case RTSP_PROTO:
-            mrl = "rtsp://" + addr;
-            emit methodChanged("rtsp-caching");
-            break;
-        case RTP_PROTO:
-        case UDP_PROTO:
-            mrl = qfu(((idx_proto == RTP_PROTO) ? "rtp" : "udp"));
-            mrl += qfu( "://" );
-            if( addr[0] == ':' ) /* Port number without address */
-                mrl += addr;
-            else
-            {
-                mrl += qfu( "@" );
-                switch( addr.count( ":" ) )
-                {
-                    case 0: /* DNS or IPv4 literal, no port number */
-                        mrl += addr;
-                        mrl += QString(":%1").arg( ui.portSpin->value() );
-                        break;
-                    case 1: /* DNS or IPv4 literal plus port number */
-                        mrl += addr;
-                        break;
-                    default: /* IPv6 literal */
-                        if( !addr.contains( "]:" ) )
-                        {
-                            if( addr[0] != '[' ) /* Missing brackets */
-                                mrl += qfu( "[" ) + addr + qfu( "]" );
-                            else
-                                mrl += addr;
-                            mrl += QString(":%1").arg( ui.portSpin->value() );
-                        }
-                        else /* Brackets present, port present */
-                            mrl += addr;
-                        break;
-                }
-            }
-            emit methodChanged(idx_proto == RTP_PROTO
-                                   ? "rtp-caching" : "udp-caching");
-            break;
-        case RTMP_PROTO:
-            mrl = "rtmp://" + addr;
-            emit methodChanged("rtmp-caching");
-            break;
-        }
-    }
-
-    QStringList qsl; qsl<< mrl;
+        char proto[6];
+        char caching[6];
+    } schemes[] =
+    {   /* KEEP alphabetical order on first column!! */
+        { "dccp",  "rtp"   },
+        { "ftp",   "ftp"   },
+        { "ftps",  "ftp"   },
+        { "http",  "http"  },
+        { "https", "http"  },
+        { "mms",   "mms"   },
+        { "mmsh",  "mms"   },
+        { "mmst",  "mms"   },
+        { "mmsu",  "mms"   },
+        { "sftp",  "sftp"  },
+        { "smb",   "smb"   },
+        { "rtmp",  "rtmp"  },
+        { "rtp",   "rtp"   },
+        { "rtsp",  "rtsp"  },
+        { "udp",   "udp"   },
+    };
+
+    QString url = ui.urlComboBox->lineEdit()->text();
+    if( !url.contains( "://") )
+        return; /* nothing to do this far */
+
+    /* Match the correct item in the comboBox */
+    QString proto = url.section( ':', 0, 0 );
+    const struct caching_map *r = (const struct caching_map *)
+        bsearch( qtu(proto), schemes, sizeof(schemes) / sizeof(schemes[0]),
+                 sizeof(schemes[0]), strcmp_void );
+    if( r )
+        emit methodChanged( qfu( r->caching ) + qfu( "-caching" ) );
+
+    QStringList qsl;
+    qsl << url;
     emit mrlUpdated( qsl, "" );
 }
 
-void NetOpenPanel::updateCompleter()
+void NetOpenPanel::updateModel()
 {
     assert( mrlList );
     QStringList tempL = mrlList->stringList();
-    if( !tempL.contains( ui.addressText->text() ) )
-        tempL.append( ui.addressText->text() );
+    if( !tempL.contains( ui.urlComboBox->lineEdit()->text() ) )
+        tempL.append( ui.urlComboBox->lineEdit()->text() );
     mrlList->setStringList( tempL );
 }
 
+void UrlValidator::fixup( QString& str ) const
+{
+    str = str.trimmed();
+}
+
+QValidator::State UrlValidator::validate( QString& str, int& pos ) const
+{
+    if( str.contains( ' ' ) )
+        return QValidator::Invalid;
+    if( !str.contains( "://" ) )
+        return QValidator::Intermediate;
+    return QValidator::Acceptable;
+}
+
 /**************************************************************************
  * Open Capture device ( DVB, PVR, V4L, and similar )                     *
  **************************************************************************/
@@ -740,12 +731,14 @@ void CaptureOpenPanel::initialize()
     bdac = new QRadioButton( "DVB-C" );
     bdat = new QRadioButton( "DVB-T" );
     bdaa = new QRadioButton( "ATSC" );
+    bdaq = new QRadioButton( "Clear QAM" );
 
     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 );
+    bdaDevLayout->addWidget( bdaq, 0, 5 );
 
     /* bda Props */
     QLabel *bdaFreqLabel =
@@ -788,10 +781,12 @@ void CaptureOpenPanel::initialize()
     BUTTONACT( bdat, updateButtons() );
     BUTTONACT( bdac, updateButtons() );
     BUTTONACT( bdaa, updateButtons() );
+    BUTTONACT( bdaq, updateButtons() );
     BUTTONACT( bdas, updateMRL() );
     BUTTONACT( bdat, updateMRL() );
     BUTTONACT( bdac, updateMRL() );
     BUTTONACT( bdaa, updateMRL() );
+    BUTTONACT( bdaq, updateMRL() );
     }
 
 #else /* WIN32 */
@@ -801,33 +796,62 @@ void CaptureOpenPanel::initialize()
     if( module_exists( "v4l2" ) ){
     addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2", QGridLayout );
 
+    char const * const ppsz_v4lvdevices[] = {
+        "video*"
+    };
+
+    char const * const ppsz_v4ladevices[] = {
+        "dsp*",
+        "radio*"
+    };
+
+    #define POPULATE_WITH_DEVS(ppsz_devlist, targetCombo) \
+    QStringList targetCombo ## StringList = QStringList(); \
+    for ( int i = 0; i< sizeof(ppsz_devlist) / sizeof(*ppsz_devlist); i++ ) \
+        targetCombo ## StringList << QString( ppsz_devlist[ i ] ); \
+    QDir targetCombo ## Dir = QDir( "/dev/" ); \
+    targetCombo->addItems( \
+        targetCombo ## Dir\
+        .entryList( targetCombo ## StringList, QDir::System )\
+        .replaceInStrings( QRegExp("^"), "/dev/" ) \
+    );
+
     /* V4l Main panel */
     QLabel *v4l2VideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
     v4l2DevLayout->addWidget( v4l2VideoDeviceLabel, 0, 0 );
 
-    v4l2VideoDevice = new QLineEdit;
+    v4l2VideoDevice = new QComboBox( this );
+    v4l2VideoDevice->setEditable( true );
+    POPULATE_WITH_DEVS( ppsz_v4lvdevices, v4l2VideoDevice );
+    v4l2VideoDevice->clearEditText();
     v4l2DevLayout->addWidget( v4l2VideoDevice, 0, 1 );
 
     QLabel *v4l2AudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
     v4l2DevLayout->addWidget( v4l2AudioDeviceLabel, 1, 0 );
 
-    v4l2AudioDevice = new QLineEdit;
+    v4l2AudioDevice = new QComboBox( this );
+    v4l2AudioDevice->setEditable( true );
+    POPULATE_WITH_DEVS( ppsz_v4ladevices, v4l2AudioDevice );
+    v4l2AudioDevice->clearEditText();
     v4l2DevLayout->addWidget( v4l2AudioDevice, 1, 1 );
 
     /* v4l2 Props panel */
-    QLabel *v4l2StdLabel = new QLabel( qtr( "Standard" ) );
+    QLabel *v4l2StdLabel = new QLabel( qtr( "Video standard" ) );
     v4l2PropLayout->addWidget( v4l2StdLabel, 0 , 0 );
 
     v4l2StdBox = new QComboBox;
     setfillVLCConfigCombo( "v4l2-standard", p_intf, v4l2StdBox );
     v4l2PropLayout->addWidget( v4l2StdBox, 0 , 1 );
     v4l2PropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
-            1, 0, 3, 1 );
+            1, 0, 3, 2 );
 
     /* v4l2 CONNECTs */
-    CuMRL( v4l2VideoDevice, textChanged( const QString& ) );
-    CuMRL( v4l2AudioDevice, textChanged( const QString& ) );
+    CuMRL( v4l2VideoDevice->lineEdit(), textChanged( const QString& ) );
+    CuMRL( v4l2VideoDevice,  currentIndexChanged ( int ) );
+    CuMRL( v4l2AudioDevice->lineEdit(), textChanged( const QString& ) );
+    CuMRL( v4l2AudioDevice,  currentIndexChanged ( int ) );
     CuMRL( v4l2StdBox,  currentIndexChanged ( int ) );
+    #undef POPULATE_WITH_DEVS
     }
 
     /*******
@@ -919,7 +943,7 @@ void CaptureOpenPanel::initialize()
     jackPropLayout->addWidget( jackPace, 2, 1 );
 
     /* Auto Connect */
-    jackConnect = new QCheckBox( qtr( "Auto connnection" ));
+    jackConnect = new QCheckBox( qtr( "Auto connection" ));
     jackPropLayout->addWidget( jackConnect, 2, 2 );
 
     /* Jack CONNECTs */
@@ -1084,13 +1108,16 @@ void CaptureOpenPanel::initialize()
             qtr( "Desired frame rate for the capture." ) );
     screenPropLayout->addWidget( screenFPSLabel, 0, 0 );
 
-    screenFPS = new QSpinBox;
-    screenFPS->setValue( 1 );
+    screenFPS = new QDoubleSpinBox;
+    screenFPS->setValue( 1. );
+    screenFPS->setRange( .01, 100. );
     screenFPS->setAlignment( Qt::AlignRight );
+    /* xgettext: frames per second */
+    screenFPS->setSuffix( qtr( " f/s" ) );
     screenPropLayout->addWidget( screenFPS, 0, 1 );
 
     /* Screen connect */
-    CuMRL( screenFPS, valueChanged( int ) );
+    CuMRL( screenFPS, valueChanged( double ) );
 
     /* General connects */
     CONNECT( ui.deviceCombo, activated( int ) ,
@@ -1127,6 +1154,7 @@ void CaptureOpenPanel::updateMRL()
         else if(  bdat->isChecked() ) mrl = "dvb-t://";
         else if(  bdac->isChecked() ) mrl = "dvb-c://";
         else if(  bdaa->isChecked() ) mrl = "atsc://";
+        else if(  bdaq->isChecked() ) mrl = "cqam://";
         else return;
         mrl += "frequency=" + QString::number( bdaFreq->value() );
         if( bdac->isChecked() || bdat->isChecked() || bdaa->isChecked() )
@@ -1139,28 +1167,28 @@ void CaptureOpenPanel::updateMRL()
             mrl += " :dvb-bandwidth=" +
                 QString::number( bdaBandBox->itemData(
                     bdaBandBox->currentIndex() ).toInt() );
+        emit methodChanged( "dvb-caching" );
         break;
     case DSHOW_DEVICE:
         fileList << "dshow://";
         mrl+= " :dshow-vdev=" +
             colon_escape( QString("%1").arg( vdevDshowW->getValue() ) );
         mrl+= " :dshow-adev=" +
-            colon_escape( QString("%1").arg( adevDshowW->getValue() ) );
+            colon_escape( QString("%1").arg( adevDshowW->getValue() ) )+" ";
         if( dshowVSizeLine->isModified() )
-            mrl += " :dshow-size=" + dshowVSizeLine->text();
+            mrl += ":dshow-size=" + dshowVSizeLine->text();
+        emit methodChanged( "dshow-caching" );
         break;
 #else
     case V4L_DEVICE:
-        fileList << "v4l://";
-        mrl += " :v4l-vdev=" + v4lVideoDevice->text();
-        mrl += " :v4l-adev=" + v4lAudioDevice->text();
+        fileList << "v4l://" + v4lVideoDevice->text();
+        mrl += " :input-slave=alsa://" + v4lAudioDevice->text();
         mrl += " :v4l-norm=" + QString::number( v4lNormBox->currentIndex() );
         mrl += " :v4l-frequency=" + QString::number( v4lFreq->value() );
         break;
     case V4L2_DEVICE:
-        fileList << "v4l2://";
-        mrl += " :v4l2-dev=" + v4l2VideoDevice->text();
-        mrl += " :v4l2-adev=" + v4l2AudioDevice->text();
+        fileList << "v4l2://" + v4l2VideoDevice->currentText();
+        mrl += " :input-slave=alsa://" + v4l2AudioDevice->currentText();
         mrl += " :v4l2-standard=" + QString::number( v4l2StdBox->currentIndex() );
         break;
     case JACK_DEVICE:
@@ -1208,7 +1236,8 @@ void CaptureOpenPanel::updateMRL()
 #endif
     case SCREEN_DEVICE:
         fileList << "screen://";
-        mrl = " :screen-fps=" + QString::number( screenFPS->value() );
+        mrl = " :screen-fps=" + QString::number( screenFPS->value(), 'f' );
+        emit methodChanged( "screen-caching" );
         updateButtons();
         break;
     }
@@ -1249,6 +1278,13 @@ void CaptureOpenPanel::updateButtons()
             bdaBandBox->show();
             bdaBandLabel->show();
         }
+        else if( bdaq->isChecked() )
+        {
+            bdaSrate->hide();
+            bdaSrateLabel->hide();
+            bdaBandBox->hide();
+            bdaBandLabel->hide();
+        }
         break;
 #else
     case DVB_DEVICE:
@@ -1299,6 +1335,7 @@ void CaptureOpenPanel::advancedDialog()
     /* New Adv Prop dialog */
     adv = new QDialog( this );
     adv->setWindowTitle( qtr( "Advanced Options" ) );
+    adv->setWindowRole( "vlc-advanced-options" );
 
     /* A main Layout with a Frame */
     QVBoxLayout *mainLayout = new QVBoxLayout( adv );