]> git.sesse.net Git - vlc/commitdiff
Destroy preferences dialog on close and on reset.
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 28 Jul 2008 07:18:44 +0000 (00:18 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 28 Jul 2008 07:18:44 +0000 (00:18 -0700)
Close #1777

modules/gui/qt4/dialogs/preferences.cpp
modules/gui/qt4/dialogs/preferences.hpp

index aa57119f26e2d964dbd48f181c78418020d875a9..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;
@@ -352,7 +357,8 @@ void PrefsDialog::reset()
     {
         config_ResetAll( p_intf );
         config_SaveConfigFile( p_intf, NULL );
-        /* FIXME reset the panels */
-        destroyPanels();
+
+        instance = NULL;
+        close();
     }
 }
index 5125bfa66f883982d5933a17cb70554a1c0f8b88..634df78b46f0d44f5cc82be8bd2b9cad49a6dd4b 100644 (file)
@@ -91,7 +91,6 @@ private slots:
     void save();
     void cancel();
     void reset();
-    void close(){ save(); }; /* Needed for any generic CloseEvent*/
 };
 
 #endif