]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/simple_preferences.cpp
Qt4 - Sprefs: cosmetic and string change.
[vlc] / modules / gui / qt4 / components / simple_preferences.cpp
index 71a7631a24754e496a7d91d0b1696450532b68af..90eb29630b1cf0472479cfdb6804f1e1e9225fb8 100644 (file)
@@ -26,8 +26,6 @@
 #include "components/simple_preferences.hpp"
 #include "components/preferences_widgets.hpp"
 
-
-
 #include <vlc_config_cat.h>
 #include <vlc_configuration.h>
 
@@ -234,7 +232,6 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONNECT( ui.outputModule, currentIndexChanged( int ), this,
                              updateAudioOptions( int ) );
 
-
         //TODO: use modules_Exists
 #ifndef WIN32
             CONFIG_GENERIC( "alsadev" , StringList , ui.alsaLabel, alsaDevice );
@@ -343,7 +340,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
     b_cache_equal =  b_cache_equal && ( i_cache == config_GetInt( p_intf, name ) );
 
 #define TestCaCi( name, int ) \
-    b_cache_equal = b_cache_equal && ( ( i_cache * int ) == config_GetInt( p_intf, name ) );
+    b_cache_equal = b_cache_equal &&  \
+    ( ( i_cache * int ) == config_GetInt( p_intf, name ) );
             /* Select the accurate value of the ComboBox */
             bool b_cache_equal = true;
             int i_cache = config_GetInt( p_intf, "file-caching");
@@ -361,8 +359,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             TestCaCi( "rtsp-caching", 4 ) TestCaCi( "ftp-caching", 2 )
             TestCaCi( "http-caching", 4 ) TestCaCi( "realrtsp-caching", 10 )
             TestCaCi( "mms-caching", 19 )
-            if( b_cache_equal )
-               ui.cachingCombo->setCurrentIndex( ui.cachingCombo->findData( QVariant( i_cache ) ) );
+            if( b_cache_equal ) ui.cachingCombo->setCurrentIndex(
+                ui.cachingCombo->findData( QVariant( i_cache ) ) );
 
         END_SPREFS_CAT;
         /*******************
@@ -394,6 +392,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             optionWidgets.append( ui.skins );
             optionWidgets.append( ui.qt4 );
 
+            CONFIG_GENERIC( "album-art", IntegerList, ui.artFetchLabel, artFetcher );
+            CONFIG_GENERIC( "fetch-meta", Bool, NULL, metaFetcher );
+            CONFIG_GENERIC( "qt-updates-notif", Bool, NULL, qtUpdates );
             CONFIG_GENERIC( "qt-always-video", Bool, NULL, qtAlwaysVideo );
             CONFIG_GENERIC_FILE( "skins2-last", File, NULL, fileSkin,
                     skinBrowse );
@@ -441,7 +442,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
     panel_layout->addWidget( panel_label );
     panel_layout->addWidget( title_line );
     panel_layout->addWidget( panel );
-    panel_layout->addStretch( 2 );
+    if( number != SPrefsHotkeys ) panel_layout->addStretch( 2 );
 
     setLayout( panel_layout );
 }
@@ -460,6 +461,7 @@ void SPrefsPanel::updateAudioOptions( int number)
     optionWidgets[fileW]->setVisible( ( value == "aout_file" ) );
 }
 
+/* Function called from the main Preferences dialog on each SPrefs Panel */
 void SPrefsPanel::apply()
 {
     msg_Dbg( p_intf, "Trying to save the %i simple panel", number );
@@ -472,8 +474,9 @@ void SPrefsPanel::apply()
         c->doApply( p_intf );
     }
 
-    /* Devices */
-    if( number == SPrefsInputAndCodecs )
+    switch( number )
+    {
+    case SPrefsInputAndCodecs:
     {
         /* Device default selection */
         char *psz_devicepath =
@@ -510,7 +513,7 @@ void SPrefsPanel::apply()
         int i_comboValue = cachingCombo->itemData( cachingCombo->currentIndex() ).toInt();
         if( i_comboValue )
         {
-            msg_Dbg( p_intf, "Adjusting all the cache values at level: %i", i_comboValue );
+            msg_Dbg( p_intf, "Adjusting all cache values at: %i", i_comboValue );
             CaC( "udp-caching" ); CaC( "dvdread-caching" );
             CaC( "dvdnav-caching" ); CaC( "tcp-caching" ); CaC( "vcd-caching" );
             CaC( "fake-caching" ); CaC( "cdda-caching" ); CaC( "file-caching" );
@@ -521,23 +524,25 @@ void SPrefsPanel::apply()
             #ifdef WIN32
             CaC( "dshow-caching" );
             #else
-            CaC( "v4l-caching" ); CaC( "jack-input-caching" ); CaC( "v4l2-caching" );
-            CaC( "pvr-caching" );
+            CaC( "v4l-caching" ); CaC( "jack-input-caching" );
+            CaC( "v4l2-caching" ); CaC( "pvr-caching" );
             #endif
             //CaCi( "dv-caching" ) too short...
         }
+        break;
     }
 
     /* Interfaces */
-    if( number == SPrefsInterface )
+    case SPrefsInterface:
     {
         if( qobject_cast<QRadioButton *>(optionWidgets[skinRB])->isChecked() )
             config_PutPsz( p_intf, "intf", "skins2" );
         if( qobject_cast<QRadioButton *>(optionWidgets[qtRB])->isChecked() )
             config_PutPsz( p_intf, "intf", "qt4" );
+        break;
     }
 
-    if( number == SPrefsAudio )
+    case SPrefsAudio:
     {
         bool b_normChecked =
             qobject_cast<QCheckBox *>(optionWidgets[normalizerChB])->isChecked();
@@ -564,6 +569,8 @@ void SPrefsPanel::apply()
                 if( b_normChecked ) qs_filter.append( ":volnorm" );
         }
         config_PutPsz( p_intf, "audio-filter", qtu( qs_filter ) );
+        break;
+    }
     }
 }