From f295ea2dcb774b2206c9ab926f012f8a5c2c7027 Mon Sep 17 00:00:00 2001 From: Don Sanders Date: Tue, 11 Jul 2000 14:20:31 +0000 Subject: [PATCH] There were problems with changes made in the filter dialog being applied even when cancel was pressed (or the dialog was closed). I fixed these but changes still take effect immediately rather than only when the user selects ok (which saves the changes to the config file so that they are made permanent) svn path=/trunk/kdenetwork/kmail/; revision=56104 --- kmfilteraction.h | 2 +- kmfilterdlg.cpp | 11 +++++++++-- kmfilterdlg.h | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/kmfilteraction.h b/kmfilteraction.h index 9dab00e1c..6969d4e63 100644 --- a/kmfilteraction.h +++ b/kmfilteraction.h @@ -88,7 +88,7 @@ class KMGFilterDlg: public QDialog public: KMGFilterDlg(QWidget* parent=NULL, const char* name=NULL, - bool modal=FALSE, WFlags f=0); + bool modal=FALSE, WFlags f=WDestructiveClose); virtual ~KMGFilterDlg(); /** Creates a details button "..." for the current filter action. */ diff --git a/kmfilterdlg.cpp b/kmfilterdlg.cpp index 0fc9d9d02..1177ba4ff 100644 --- a/kmfilterdlg.cpp +++ b/kmfilterdlg.cpp @@ -626,14 +626,21 @@ void KMFilterDlg::slotBtnOk() kernel->filterMgr()->writeConfig(); } - accept(); + KMFilterDlgInherited::close(); } //----------------------------------------------------------------------------- void KMFilterDlg::slotBtnCancel() { kernel->filterMgr()->readConfig(); - reject(); + KMFilterDlgInherited::close(); +} + +//----------------------------------------------------------------------------- +void KMFilterDlg::closeEvent( QCloseEvent *e ) +{ + kernel->filterMgr()->readConfig(); + KMFilterDlgInherited::closeEvent(e); } //----------------------------------------------------------------------------- diff --git a/kmfilterdlg.h b/kmfilterdlg.h index 4f0e47c76..03613b078 100644 --- a/kmfilterdlg.h +++ b/kmfilterdlg.h @@ -84,6 +84,9 @@ protected: // Update the position of the filter action field widgets void resizeEvent(QResizeEvent *qre); + // Undo any changes that have been applied + virtual void closeEvent( QCloseEvent * ); + KMFilter* mFilter; QGridLayout *mGrid; int mGridRow, mCbxHeight, mCbxWidth;