Skip to content

Commit

Permalink
Fix missing old-fashioned storing of new settings
Browse files Browse the repository at this point in the history
  • Loading branch information
gzotti committed Aug 27, 2024
1 parent ad96058 commit 4f80edf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/core/StelApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ class StelApp : public QObject
static void initStatic();
static void deinitStatic();

//! Allow immediate storing of config.ini entries.
//! Storing only takes place if property StelApp.flagImmediateSave is set.
//! Power feature: allow immediate storing of config.ini entries.
//! Storing only takes place if property StelApp.flagImmediateSave is set,
//! a flag activated with a manual config.ini entry gui/immediate_save_details=true
//! Items saved with this method still need to be saved as well with ConfigurationDialog::saveAllSettings()!
static void immediateSave(const QString &key, const QVariant &value);

//! Add a progression indicator to the GUI (if applicable).
Expand Down
22 changes: 10 additions & 12 deletions src/gui/ConfigurationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@ void ConfigurationDialog::saveAllSettings()
conf->setValue("astro/flag_planets_nomenclature_terminator_only",propMgr->getStelPropertyValue("NomenclatureMgr.flagShowTerminatorZoneOnly").toBool());
conf->setValue("astro/planet_nomenclature_solar_altitude_min", propMgr->getStelPropertyValue("NomenclatureMgr.terminatorMinAltitude").toInt());
conf->setValue("astro/planet_nomenclature_solar_altitude_max", propMgr->getStelPropertyValue("NomenclatureMgr.terminatorMaxAltitude").toInt());
conf->setValue("astro/planet_markers_mag_threshold", propMgr->getStelPropertyValue("SolarSystem.markerMagThreshold").toDouble());

// view dialog / markings tab settings
conf->setValue("viewing/flag_gridlines", propMgr->getStelPropertyValue("GridLinesMgr.gridlinesDisplayed").toBool());
Expand Down Expand Up @@ -1059,6 +1060,7 @@ void ConfigurationDialog::saveAllSettings()
conf->setValue("astro/flag_aberration", core->getUseAberration());
conf->setValue("astro/aberration_factor", core->getAberrationFactor());
conf->setValue("astro/flag_topocentric_coordinates", core->getUseTopocentricCoordinates());
conf->setValue("astro/solar_system_threads", propMgr->getStelPropertyValue("SolarSystem.extraThreads").toInt());

// view dialog / DSO tag settings
nmgr->storeCatalogFilters();
Expand Down Expand Up @@ -1116,19 +1118,15 @@ void ConfigurationDialog::saveAllSettings()

// configuration dialog / selected object info tab
const StelObject::InfoStringGroup& flags = gui->getInfoTextFilters();
if (flags == StelObject::InfoStringGroup(StelObject::None))
conf->setValue("gui/selected_object_info", "none");
else if (flags == StelObject::InfoStringGroup(StelObject::DefaultInfo))
conf->setValue("gui/selected_object_info", "default");
else if (flags == StelObject::InfoStringGroup(StelObject::ShortInfo))
conf->setValue("gui/selected_object_info", "short");
else if (flags == StelObject::InfoStringGroup(StelObject::AllInfo))
conf->setValue("gui/selected_object_info", "all");
else
{
conf->setValue("gui/selected_object_info", "custom");
static const QMap<StelObject::InfoStringGroup, QString>selectedObjectInfoMap={
{StelObject::InfoStringGroup(StelObject::None), "none"},
{StelObject::InfoStringGroup(StelObject::DefaultInfo), "default"},
{StelObject::InfoStringGroup(StelObject::ShortInfo), "short"},
{StelObject::InfoStringGroup(StelObject::AllInfo), "all"}
};
QString selectedObjectInfo=selectedObjectInfoMap.value(flags, "custom");
if (selectedObjectInfo=="custom")
saveCustomSelectedInfo();
}

// toolbar auto-hide status
conf->setValue("gui/auto_hide_horizontal_toolbar", propMgr->getStelPropertyValue("StelGui.autoHideHorizontalButtonBar").toBool());
Expand Down

0 comments on commit 4f80edf

Please sign in to comment.