mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
9f93b9a934
commit
df7818a9b8
3 changed files with 11 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include "preferences_language.h"
|
#include "preferences_language.h"
|
||||||
#include "ui_prefs_language.h"
|
#include "ui_prefs_language.h"
|
||||||
|
#include "subsurface-core/helpers.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
@ -67,4 +68,5 @@ void PreferencesLanguage::syncSettings()
|
||||||
s.setValue("date_format_short", ui->shortDateFormatEntry->text());
|
s.setValue("date_format_short", ui->shortDateFormatEntry->text());
|
||||||
}
|
}
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
uiLanguage(NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,8 @@ void PreferencesDialog::buttonClicked(QAbstractButton* btn)
|
||||||
{
|
{
|
||||||
QDialogButtonBox::ButtonRole role = buttonBox->buttonRole(btn);
|
QDialogButtonBox::ButtonRole role = buttonBox->buttonRole(btn);
|
||||||
switch(role) {
|
switch(role) {
|
||||||
case QDialogButtonBox::AcceptRole : applyRequested(); return;
|
case QDialogButtonBox::ApplyRole : applyRequested(false); return;
|
||||||
|
case QDialogButtonBox::AcceptRole : applyRequested(true); return;
|
||||||
case QDialogButtonBox::RejectRole : cancelRequested(); return;
|
case QDialogButtonBox::RejectRole : cancelRequested(); return;
|
||||||
case QDialogButtonBox::ResetRole : defaultsRequested(); return;
|
case QDialogButtonBox::ResetRole : defaultsRequested(); return;
|
||||||
}
|
}
|
||||||
|
@ -110,12 +111,13 @@ void PreferencesDialog::refreshPages()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::applyRequested()
|
void PreferencesDialog::applyRequested(bool closeIt)
|
||||||
{
|
{
|
||||||
Q_FOREACH(AbstractPreferencesWidget *page, pages) {
|
Q_FOREACH(AbstractPreferencesWidget *page, pages) {
|
||||||
page->syncSettings();
|
page->syncSettings();
|
||||||
}
|
}
|
||||||
emit settingsChanged();
|
emit settingsChanged();
|
||||||
|
if (closeIt)
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ signals:
|
||||||
private:
|
private:
|
||||||
PreferencesDialog();
|
PreferencesDialog();
|
||||||
void cancelRequested();
|
void cancelRequested();
|
||||||
void applyRequested();
|
void applyRequested(bool closeIt);
|
||||||
void defaultsRequested();
|
void defaultsRequested();
|
||||||
void buttonClicked(QAbstractButton *btn);
|
void buttonClicked(QAbstractButton *btn);
|
||||||
QList<AbstractPreferencesWidget*> pages;
|
QList<AbstractPreferencesWidget*> pages;
|
||||||
|
|
Loading…
Add table
Reference in a new issue