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>
This commit is contained in:
Dirk Hohndel 2015-11-02 12:50:17 -08:00
parent 9f93b9a934
commit df7818a9b8
3 changed files with 11 additions and 7 deletions

View file

@ -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()