Commit e28d5e8a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Destroy preferences dialog on close and on reset.

Close #1777
parent 76cd2393
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
...@@ -49,6 +50,10 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf ) ...@@ -49,6 +50,10 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
QGridLayout *main_layout = new QGridLayout( this ); QGridLayout *main_layout = new QGridLayout( this );
setWindowTitle( qtr( "Preferences" ) ); 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 */ /* Create Panels */
tree_panel = new QWidget; tree_panel = new QWidget;
tree_panel_l = new QHBoxLayout; tree_panel_l = new QHBoxLayout;
...@@ -352,7 +357,8 @@ void PrefsDialog::reset() ...@@ -352,7 +357,8 @@ void PrefsDialog::reset()
{ {
config_ResetAll( p_intf ); config_ResetAll( p_intf );
config_SaveConfigFile( p_intf, NULL ); config_SaveConfigFile( p_intf, NULL );
/* FIXME reset the panels */
destroyPanels(); instance = NULL;
close();
} }
} }
...@@ -91,7 +91,6 @@ private slots: ...@@ -91,7 +91,6 @@ private slots:
void save(); void save();
void cancel(); void cancel();
void reset(); void reset();
void close(){ save(); }; /* Needed for any generic CloseEvent*/
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment