mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Set the prefs-value alongside the button status
Previous code just set the button-"status" based on what we stored on the settings. This sets the corresponding value in our prefs-struct. This fixes the same issue as in 63f7f3, without the side effect of magically hiding the mean depth line. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b7940dec5c
commit
909cfe7135
1 changed files with 17 additions and 11 deletions
|
@ -620,6 +620,10 @@ void MainWindow::initialUiSetup()
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define TOOLBOX_PREF_BUTTON(pref, setting, button) \
|
||||||
|
prefs.pref = s.value(#setting).toBool(); \
|
||||||
|
ui.button->setChecked(prefs.pref);
|
||||||
|
|
||||||
void MainWindow::readSettings()
|
void MainWindow::readSettings()
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
|
@ -630,20 +634,22 @@ void MainWindow::readSettings()
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("TecDetails");
|
s.beginGroup("TecDetails");
|
||||||
ui.profCalcAllTissues->setChecked(s.value("calcalltissues").toBool());
|
TOOLBOX_PREF_BUTTON(calc_all_tissues, calcalltissues, profCalcAllTissues);
|
||||||
ui.profCalcCeiling->setChecked(s.value("calcceiling").toBool());
|
TOOLBOX_PREF_BUTTON(profile_calc_ceiling, calcceiling, profCalcCeiling);
|
||||||
ui.profDcCeiling->setChecked(s.value("dcceiling").toBool());
|
TOOLBOX_PREF_BUTTON(profile_dc_ceiling, dcceiling, profDcCeiling);
|
||||||
ui.profEad->setChecked(s.value("ead").toBool());
|
TOOLBOX_PREF_BUTTON(ead, ead, profEad);
|
||||||
ui.profIncrement3m->setChecked(s.value("calcceiling3m").toBool());
|
TOOLBOX_PREF_BUTTON(calc_ceiling_3m_incr, calcceiling3m, profIncrement3m);
|
||||||
ui.profMod->setChecked(s.value("mod").toBool());
|
TOOLBOX_PREF_BUTTON(mod, mod, profMod);
|
||||||
ui.profNdl_tts->setChecked(s.value("calcndltts").toBool());
|
TOOLBOX_PREF_BUTTON(calc_ndl_tts, calcndltts, profNdl_tts);
|
||||||
ui.profPhe->setChecked(s.value("phegraph").toBool());
|
TOOLBOX_PREF_BUTTON(pp_graphs.phe, phegraph, profPhe);
|
||||||
ui.profPn2->setChecked(s.value("pn2graph").toBool());
|
TOOLBOX_PREF_BUTTON(pp_graphs.pn2, pn2graph, profPn2);
|
||||||
ui.profPO2->setChecked(s.value("po2graph").toBool());
|
TOOLBOX_PREF_BUTTON(pp_graphs.po2, po2graph, profPO2);
|
||||||
ui.profRuler->setChecked(s.value("rulergraph").toBool());
|
ui.profRuler->setChecked(s.value("rulergraph").toBool());
|
||||||
ui.profSAC->setChecked(s.value("show_sac").toBool());
|
TOOLBOX_PREF_BUTTON(show_sac, show_sac, profSAC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef TOOLBOX_PREF_BUTTON
|
||||||
|
|
||||||
void MainWindow::writeSettings()
|
void MainWindow::writeSettings()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue