CompassMarks.cpp   CompassMarks.cpp 
skipping to change at line 199 skipping to change at line 199
// Save the display state of the cardinal points and hide th em. // Save the display state of the cardinal points and hide th em.
cardinalPointsState = GETSTELMODULE(LandscapeMgr)->getFlagCa rdinalsPoints(); cardinalPointsState = GETSTELMODULE(LandscapeMgr)->getFlagCa rdinalsPoints();
GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints(false); GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints(false);
} else { } else {
// Restore the cardinal points state. // Restore the cardinal points state.
GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints(cardinal PointsState); GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints(cardinal PointsState);
} }
markFader = b; markFader = b;
// autosaving the state by default // autosaving the state by default
displayedAtStartup = b; displayedAtStartup = b;
saveConfiguration(); conf->setValue("CompassMarks/enable_at_startup", displayedAtStartup) ;
emit compassMarksChanged(b); emit compassMarksChanged(b);
} }
void CompassMarks::loadConfiguration() void CompassMarks::loadConfiguration()
{ {
Q_ASSERT(conf); Q_ASSERT(conf);
conf->beginGroup("CompassMarks"); conf->beginGroup("CompassMarks");
markColor = StelUtils::strToVec3f(conf->value("mark_color", "1,0,0") .toString()); markColor = StelUtils::strToVec3f(conf->value("mark_color", "1,0,0") .toString());
font.setPixelSize(conf->value("font_size", 10).toInt()); font.setPixelSize(conf->value("font_size", 10).toInt());
displayedAtStartup = conf->value("enable_at_startup", false).toBool( ); displayedAtStartup = conf->value("enable_at_startup", false).toBool( );
conf->endGroup(); conf->endGroup();
} }
void CompassMarks::saveConfiguration()
{
Q_ASSERT(conf);
conf->beginGroup("CompassMarks");
conf->setValue("font_size", font.pixelSize());
conf->setValue("enable_at_startup", displayedAtStartup);
// The rest is not saved!
conf->endGroup();
}
void CompassMarks::restoreDefaultConfiguration() void CompassMarks::restoreDefaultConfiguration()
{ {
Q_ASSERT(conf); Q_ASSERT(conf);
// Remove the whole section from the configuration file // Remove the whole section from the configuration file
conf->remove("CompassMarks"); conf->remove("CompassMarks");
// Load the default values... // Load the default values...
loadConfiguration(); loadConfiguration();
// ... then save them.
saveConfiguration();
// But this doesn't save the color, so... // But this doesn't save the color, so...
conf->beginGroup("CompassMarks"); conf->beginGroup("CompassMarks");
conf->setValue("mark_color", "1,0,0"); conf->setValue("mark_color", "1,0,0");
conf->endGroup(); conf->endGroup();
} }
void CompassMarks::cardinalPointsChanged(bool b) void CompassMarks::cardinalPointsChanged(bool b)
{ {
if (b && getCompassMarks()) { if (b && getCompassMarks()) {
cardinalPointsState = true; cardinalPointsState = true;
 End of changes. 3 change blocks. 
13 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/