Commit 3d752fb8 authored by Alexander Semke's avatar Alexander Semke

Only save the settings in the different pages of the settings dialog if

there were any changes done there.
parent a98bdcae
......@@ -101,6 +101,9 @@ QLocale::Language SettingsGeneralPage::decimalSeparatorLocale() const {
}
void SettingsGeneralPage::applySettings() {
if (!m_changed)
return;
KConfigGroup group = KSharedConfig::openConfig()->group(QLatin1String("Settings_General"));
group.writeEntry(QLatin1String("LoadOnStart"), ui.cbLoadOnStart->currentIndex());
group.writeEntry(QLatin1String("TitleBar"), ui.cbTitleBar->currentIndex());
......
......@@ -37,12 +37,15 @@
*/
SettingsSpreadsheetPage::SettingsSpreadsheetPage(QWidget* parent) : SettingsPage(parent) {
ui.setupUi(this);
connect(ui.chkShowColumnType, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
connect(ui.chkShowPlotDesignation, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
connect(ui.chkShowColumnType, &QCheckBox::stateChanged, this, &SettingsSpreadsheetPage::changed);
connect(ui.chkShowPlotDesignation, &QCheckBox::stateChanged, this, &SettingsSpreadsheetPage::changed);
loadSettings();
}
void SettingsSpreadsheetPage::applySettings() {
if (!m_changed)
return;
KConfigGroup group = KSharedConfig::openConfig()->group(QLatin1String("Settings_Spreadsheet"));
group.writeEntry(QLatin1String("ShowColumnType"), ui.chkShowColumnType->isChecked());
group.writeEntry(QLatin1String("ShowPlotDesignation"), ui.chkShowPlotDesignation->isChecked());
......
......@@ -62,16 +62,19 @@ SettingsWorksheetPage::SettingsWorksheetPage(QWidget* parent) : SettingsPage(par
if (TeXRenderer::executableExists(QLatin1String("latex")))
ui.cbTexEngine->addItem(QLatin1String("LaTeX"), QLatin1String("latex"));
connect(m_cbThemes, SIGNAL(currentThemeChanged(QString)), this, SLOT(changed()) );
connect(ui.chkPresenterModeInteractive, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
connect(ui.chkDoubleBuffering, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
connect(ui.cbTexEngine, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()) );
connect(ui.cbTexEngine, SIGNAL(currentIndexChanged(int)), this, SLOT(checkTeX(int)) );
connect(m_cbThemes, &ThemesComboBox::currentThemeChanged, this, &SettingsWorksheetPage::changed);
connect(ui.chkPresenterModeInteractive, &QCheckBox::stateChanged, this, &SettingsWorksheetPage::changed);
connect(ui.chkDoubleBuffering, &QCheckBox::stateChanged, this, &SettingsWorksheetPage::changed);
connect(ui.cbTexEngine, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsWorksheetPage::changed);
connect(ui.cbTexEngine, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsWorksheetPage::checkTeX);
loadSettings();
}
void SettingsWorksheetPage::applySettings() {
if (!m_changed)
return;
KConfigGroup group = KSharedConfig::openConfig()->group(QLatin1String("Settings_Worksheet"));
if (m_cbThemes->currentText() == i18n("Default"))
group.writeEntry(QLatin1String("Theme"), QString());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment