]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/preferences.cpp
Removes trailing spaces. Removes tabs.
[vlc] / modules / gui / qt4 / dialogs / preferences.cpp
index 7a3e99a0b0553ec1dee33fcfe288c301ed2fd8b7..204ad43aae50c2f48f80acc1cf60e26c12447886 100644 (file)
@@ -61,8 +61,9 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
     types->setAlignment( Qt::AlignHCenter );
     QHBoxLayout *types_l = new QHBoxLayout(0);
     types_l->setSpacing( 3 ); types_l->setMargin( 3 );
-    small = new QRadioButton( "Basic", types ); types_l->addWidget( small );
-    all = new QRadioButton( "All", types ); types_l->addWidget( all );
+    small = new QRadioButton( qtr("Basic"), types );
+    types_l->addWidget( small );
+    all = new QRadioButton( qtr("All"), types ); types_l->addWidget( all );
     types->setLayout( types_l );
     small->setChecked( true );
 
@@ -243,6 +244,12 @@ void PrefsDialog::showModulePrefs( char *psz_module )
 }
 
 void PrefsDialog::save()
+{
+    apply();
+    hide();
+}
+
+void PrefsDialog::apply()
 {
     if( small->isChecked() && simple_tree )
     {
@@ -252,7 +259,19 @@ void PrefsDialog::save()
     else if( all->isChecked() && advanced_tree )
         advanced_tree->applyAll();
     config_SaveConfigFile( p_intf, NULL );
-    hide();
+
+    /* Delete the other panel in order to force its reload after clicking
+       on apply - UGLY but will work for now. */
+    if( simple_panel && simple_panel->isVisible() && advanced_panel )
+    {
+        delete advanced_panel;
+        advanced_panel = NULL;
+    }
+    if( advanced_panel && advanced_panel->isVisible() && simple_panel )
+    {
+        delete simple_panel;
+        simple_panel = NULL;
+    }
 }
 
 void PrefsDialog::cancel()