]> git.sesse.net Git - vlc/commitdiff
Qt: capture panel: Disable advanced options instead of being silent on
authorFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 25 Jan 2013 13:19:55 +0000 (14:19 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 25 Jan 2013 13:21:22 +0000 (14:21 +0100)
late failure

modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.hpp

index 423deefe13b532050c23e8b1063d5b32acc981ca..924808512d242721538d884f35cd6daa8873d766 100644 (file)
@@ -746,6 +746,7 @@ void CaptureOpenPanel::initialize()
     ui.setupUi( this );
 
     BUTTONACT( ui.advancedButton, advancedDialog() );
+    CONNECT( ui.deviceCombo, currentIndexChanged(int), this, enableAdvancedDialog(int) );
 
     /* Create two stacked layouts in the main comboBoxes */
     QStackedLayout *stackedDevLayout = new QStackedLayout;
@@ -1292,6 +1293,14 @@ void CaptureOpenPanel::updateButtons()
     advMRL.clear();
 }
 
+void CaptureOpenPanel::enableAdvancedDialog( int i_index )
+{
+    int i_devicetype = ui.deviceCombo->itemData( i_index ).toInt();
+    module_t *p_module =
+        module_find( psz_devModule[i_devicetype] );
+    ui.advancedButton->setEnabled( NULL != p_module );
+}
+
 void CaptureOpenPanel::advancedDialog()
 {
     /* Get selected device type */
index 5a8a46af5f1d5559ed2c9f75eaaf784bc3a0d475..218c875e3565e57c0eb3c8d5c3a69092fdbafccd 100644 (file)
@@ -227,6 +227,7 @@ public slots:
     void initialize();
 private slots:
     void updateButtons();
+    void enableAdvancedDialog( int );
     void advancedDialog();
 };