diff options
Diffstat (limited to 'desktop-widgets/preferences/preferencesdialog.cpp')
-rw-r--r-- | desktop-widgets/preferences/preferencesdialog.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/desktop-widgets/preferences/preferencesdialog.cpp b/desktop-widgets/preferences/preferencesdialog.cpp index a7934a96d..d8798879a 100644 --- a/desktop-widgets/preferences/preferencesdialog.cpp +++ b/desktop-widgets/preferences/preferencesdialog.cpp @@ -74,9 +74,10 @@ void PreferencesDialog::buttonClicked(QAbstractButton* btn) { QDialogButtonBox::ButtonRole role = buttonBox->buttonRole(btn); switch(role) { - case QDialogButtonBox::AcceptRole : applyRequested(); return; - case QDialogButtonBox::RejectRole : cancelRequested(); return; - case QDialogButtonBox::ResetRole : defaultsRequested(); return; + case QDialogButtonBox::ApplyRole : applyRequested(false); return; + case QDialogButtonBox::AcceptRole : applyRequested(true); return; + case QDialogButtonBox::RejectRole : cancelRequested(); return; + case QDialogButtonBox::ResetRole : defaultsRequested(); return; } } @@ -110,13 +111,14 @@ void PreferencesDialog::refreshPages() } } -void PreferencesDialog::applyRequested() +void PreferencesDialog::applyRequested(bool closeIt) { Q_FOREACH(AbstractPreferencesWidget *page, pages) { page->syncSettings(); } emit settingsChanged(); - accept(); + if (closeIt) + accept(); } void PreferencesDialog::cancelRequested() |