]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/simple_preferences.cpp
Qt: hide live555 module options when disabled
[vlc] / modules / gui / qt4 / components / simple_preferences.cpp
index 29110522de0ee1b0d91fad61f6aa19868e68a24f..05d2a10377d8dd7cb2311cb8b1eae59961055813 100644 (file)
@@ -412,11 +412,21 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONFIG_GENERIC_NO_BOOL( "ffmpeg-pp-q", Integer, ui.ppLabel,
                                     PostProcLevel );
             CONFIG_GENERIC( "avi-index", IntegerList, ui.aviLabel, AviRepair );
-            CONFIG_GENERIC( "rtsp-tcp", Bool, NULL, RTSP_TCPBox );
+
+            /* live555 module prefs */
+            CONFIG_GENERIC( "rtsp-tcp", Bool, NULL,
+                                live555TransportRTSP_TCPRadio );
+            if ( !module_exists( "live555" ) )
+            {
+                ui.live555TransportRTSP_TCPRadio->hide();
+                ui.live555TransportHTTPRadio->hide();
+                ui.live555TransportLabel->hide();
+            }
 #ifdef WIN32
             CONFIG_GENERIC( "prefer-system-codecs", Bool, NULL, systemCodecBox );
 #else
             ui.systemCodecBox->hide();
+            ui.systemCodecLabel->hide();
 #endif
             optionWidgets.append( ui.DVDDevice );
             optionWidgets.append( ui.cachingCombo );
@@ -510,6 +520,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             optionWidgets.append( ui.skins );
             optionWidgets.append( ui.qt4 );
 #if !defined(NDEBUG) || !defined( WIN32)
+            ui.stylesCombo->addItem( qtr("System's default") );
             ui.stylesCombo->addItems( QStyleFactory::keys() );
             ui.stylesCombo->setCurrentIndex( ui.stylesCombo->findText(
                         getSettings()->value( "MainWindow/QtStyle", "" ).toString() ) );
@@ -519,6 +530,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             optionWidgets.append( ui.stylesCombo );
 #else
             ui.stylesCombo->hide();
+            optionWidgets.append( NULL );
 #endif
 
             ui.skins_zone->setEnabled( ui.skins->isChecked() );
@@ -760,8 +772,9 @@ void SPrefsPanel::apply()
             config_PutPsz( p_intf, "intf", "skins2" );
         if( qobject_cast<QRadioButton *>(optionWidgets[qtRB])->isChecked() )
             config_PutPsz( p_intf, "intf", "qt" );
-        getSettings()->setValue( "MainWindow/QtStyle",
-            qobject_cast<QComboBox *>(optionWidgets[styleCB])->currentText() );
+        if( qobject_cast<QComboBox *>(optionWidgets[styleCB]) )
+            getSettings()->setValue( "MainWindow/QtStyle",
+                qobject_cast<QComboBox *>(optionWidgets[styleCB])->currentText() );
 
         break;
     }