]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/preferences.cpp
Destroy preferences dialog on close and on reset.
[vlc] / modules / gui / qt4 / dialogs / preferences.cpp
index 6997fdcc21d30edb5bc81d34089e257d52120403..a841f700433f33fff47544e34d9a6cfa06b682f7 100644 (file)
@@ -21,6 +21,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -49,6 +50,10 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
     QGridLayout *main_layout = new QGridLayout( this );
     setWindowTitle( qtr( "Preferences" ) );
 
+    /* Whether we want it or not, we need to destroy on close to get
+       consistency when reset */
+    setAttribute( Qt::WA_DeleteOnClose );
+
     /* Create Panels */
     tree_panel = new QWidget;
     tree_panel_l = new QHBoxLayout;
@@ -62,7 +67,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
     types->setAlignment( Qt::AlignHCenter );
     QHBoxLayout *types_l = new QHBoxLayout;
     types_l->setSpacing( 3 ); types_l->setMargin( 3 );
-    small = new QRadioButton( qtr("Basic"), types );
+    small = new QRadioButton( qtr( "Simple" ), types );
     types_l->addWidget( small );
     all = new QRadioButton( qtr("All"), types ); types_l->addWidget( all );
     types->setLayout( types_l );
@@ -98,11 +103,12 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
 
     main_layout->setRowStretch( 2, 4 );
 
+    main_layout->setMargin( 9 );
     setLayout( main_layout );
 
     /* Margins */
     tree_panel_l->setMargin( 1 );
-    main_panel_l->setMargin( 3 );
+    main_panel_l->setLayoutMargins( 6, 0, 0, 3, 3 );
 
     for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
 
@@ -351,7 +357,8 @@ void PrefsDialog::reset()
     {
         config_ResetAll( p_intf );
         config_SaveConfigFile( p_intf, NULL );
-        /* FIXME reset the panels */
-        destroyPanels();
+
+        instance = NULL;
+        close();
     }
 }