summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences/preferencesdialog.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-02 12:50:17 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-02 12:53:47 -0800
commitdf7818a9b8495285b4d9812e5d6d50d6f9c08813 (patch)
tree02377a879039cfce5d15936ac4d147f65c049904 /desktop-widgets/preferences/preferencesdialog.cpp
parent9f93b9a934e23be05322ff47a0c6a8fa3b8b3adb (diff)
downloadsubsurface-df7818a9b8495285b4d9812e5d6d50d6f9c08813.tar.gz
Preferences: make apply work
We didn't respond at all to that button. Also, the language settings didn't propagate without this explicit call. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/preferences/preferencesdialog.cpp')
-rw-r--r--desktop-widgets/preferences/preferencesdialog.cpp12
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()