[vlc-devel] commit: Destroy preferences dialog on close and on reset. ( Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Jul 28 09:15:43 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Jul 28 00:18:44 2008 -0700| [e28d5e8ac631a90c44bb75eb7cfd56f0fd2e6e2b]

Destroy preferences dialog on close and on reset.
Close #1777

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e28d5e8ac631a90c44bb75eb7cfd56f0fd2e6e2b
---

 modules/gui/qt4/dialogs/preferences.cpp |   10 ++++++++--
 modules/gui/qt4/dialogs/preferences.hpp |    1 -
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/dialogs/preferences.cpp b/modules/gui/qt4/dialogs/preferences.cpp
index aa57119..a841f70 100644
--- a/modules/gui/qt4/dialogs/preferences.cpp
+++ b/modules/gui/qt4/dialogs/preferences.cpp
@@ -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();
     }
 }
diff --git a/modules/gui/qt4/dialogs/preferences.hpp b/modules/gui/qt4/dialogs/preferences.hpp
index 5125bfa..634df78 100644
--- a/modules/gui/qt4/dialogs/preferences.hpp
+++ b/modules/gui/qt4/dialogs/preferences.hpp
@@ -91,7 +91,6 @@ private slots:
     void save();
     void cancel();
     void reset();
-    void close(){ save(); }; /* Needed for any generic CloseEvent*/
 };
 
 #endif




More information about the vlc-devel mailing list