AngleMeasure.cpp   AngleMeasure.cpp 
skipping to change at line 467 skipping to change at line 467
StelUtils::radToDms(angle, sign, d, m, s); StelUtils::radToDms(angle, sign, d, m, s);
if (flagUseDmsFormat) if (flagUseDmsFormat)
return QString("%1d %2m %3s").arg(d).arg(m).arg(s, 0 , 'f', 2); return QString("%1d %2m %3s").arg(d).arg(m).arg(s, 0 , 'f', 2);
else else
return QString("%1%2 %3' %4\"").arg(d).arg(QChar(0x0 0B0)).arg(m).arg(s, 0, 'f', 2); return QString("%1%2 %3' %4\"").arg(d).arg(QChar(0x0 0B0)).arg(m).arg(s, 0, 'f', 2);
} }
} }
void AngleMeasure::enableAngleMeasure(bool b) void AngleMeasure::enableAngleMeasure(bool b)
{ {
flagShowAngleMeasure = b; if (b!=flagShowAngleMeasure)
lineVisible = b;
messageFader = b;
if (b)
{ {
//qDebug() << "AngleMeasure::enableAngleMeasure starting tim flagShowAngleMeasure = b;
er"; lineVisible = b;
messageTimer->start(); messageFader = b;
if (b)
{
//qDebug() << "AngleMeasure::enableAngleMeasure star
ting timer";
messageTimer->start();
}
// Immediate saving of settings
conf->setValue("AngleMeasure/enable_at_startup", flagShowAng
leMeasure);
emit flagAngleMeasureChanged(b);
} }
} }
void AngleMeasure::showPositionAngle(bool b) void AngleMeasure::showPositionAngle(bool b)
{ {
flagShowPA = b; flagShowPA = b;
// Immediate saving of settings
conf->setValue("AngleMeasure/show_position_angle", flagShowPA);
} }
void AngleMeasure::showPositionAngleHor(bool b) void AngleMeasure::showPositionAngleHor(bool b)
{ {
flagShowHorizontalPA = b; flagShowHorizontalPA = b;
// Immediate saving of settings
conf->setValue("AngleMeasure/show_position_angle_horizontal", flagSh
owHorizontalPA);
} }
void AngleMeasure::showEquatorial(bool b) void AngleMeasure::showEquatorial(bool b)
{ {
flagShowEquatorial = b; flagShowEquatorial = b;
// Immediate saving of settings
conf->setValue("AngleMeasure/show_equatorial", flagShowEquatorial);
} }
void AngleMeasure::showHorizontal(bool b) void AngleMeasure::showHorizontal(bool b)
{ {
flagShowHorizontal = b; flagShowHorizontal = b;
// Immediate saving of settings
conf->setValue("AngleMeasure/show_horizontal", flagShowHorizontal);
} }
void AngleMeasure::showHorizontalStartSkylinked(bool b) void AngleMeasure::showHorizontalStartSkylinked(bool b)
{ {
flagShowHorizontalStartSkylinked = b; flagShowHorizontalStartSkylinked = b;
// Immediate saving of settings
conf->setValue("AngleMeasure/link_horizontal_start_to_sky", flagShow
HorizontalStartSkylinked);
} }
void AngleMeasure::showHorizontalEndSkylinked(bool b) void AngleMeasure::showHorizontalEndSkylinked(bool b)
{ {
flagShowHorizontalEndSkylinked = b; flagShowHorizontalEndSkylinked = b;
// Immediate saving of settings
conf->setValue("AngleMeasure/link_horizontal_end_to_sky", flagShowHo
rizontalEndSkylinked);
} }
void AngleMeasure::useDmsFormat(bool b) void AngleMeasure::useDmsFormat(bool b)
{ {
flagUseDmsFormat=b; flagUseDmsFormat=b;
// Immediate saving of settings
conf->setValue("AngleMeasure/angle_format_dms", flagUseDmsFormat);
} }
void AngleMeasure::updateMessageText() void AngleMeasure::updateMessageText()
{ {
// TRANSLATORS: instructions for using the AngleMeasure plugin. // TRANSLATORS: instructions for using the AngleMeasure plugin.
messageEnabled = q_("The Angle Measure is enabled:"); messageEnabled = q_("The Angle Measure is enabled:");
// TRANSLATORS: instructions for using the AngleMeasure plugin. // TRANSLATORS: instructions for using the AngleMeasure plugin.
messageLeftButton = q_("Drag with the left button to measure, left-c lick to clear."); messageLeftButton = q_("Drag with the left button to measure, left-c lick to clear.");
// TRANSLATORS: instructions for using the AngleMeasure plugin. // TRANSLATORS: instructions for using the AngleMeasure plugin.
messageRightButton = q_("Right-clicking changes the end point only." ); messageRightButton = q_("Right-clicking changes the end point only." );
skipping to change at line 532 skipping to change at line 553
messageFader = false; messageFader = false;
} }
void AngleMeasure::restoreDefaultSettings() void AngleMeasure::restoreDefaultSettings()
{ {
Q_ASSERT(conf); Q_ASSERT(conf);
// Remove the old values... // Remove the old values...
conf->remove("AngleMeasure"); conf->remove("AngleMeasure");
// ...load the default values... // ...load the default values...
loadSettings(); loadSettings();
// ...and then save them.
saveSettings();
// But this doesn't save the colors, so: // But this doesn't save the colors, so:
conf->beginGroup("AngleMeasure"); conf->beginGroup("AngleMeasure");
conf->setValue("text_color", "0,0.5,1"); conf->setValue("text_color", "0,0.5,1");
conf->setValue("line_color", "0,0.5,1"); conf->setValue("line_color", "0,0.5,1");
conf->setValue("text_color_horizontal", "0.9,0.6,0.4"); conf->setValue("text_color_horizontal", "0.9,0.6,0.4");
conf->setValue("line_color_horizontal", "0.9,0.6,0.4"); conf->setValue("line_color_horizontal", "0.9,0.6,0.4");
conf->endGroup(); conf->endGroup();
} }
void AngleMeasure::loadSettings() void AngleMeasure::loadSettings()
{ {
conf->beginGroup("AngleMeasure"); enableAngleMeasure(conf->value("AngleMeasure/enable_at_startup", fal
se).toBool());
useDmsFormat(conf->value("angle_format_dms", false).toBool()); useDmsFormat(conf->value("AngleMeasure/angle_format_dms", false).toB
showPositionAngle(conf->value("show_position_angle", false).toBool() ool());
); showPositionAngle(conf->value("AngleMeasure/show_position_angle", fa
textColor = StelUtils::strToVec3f(conf->value("text_color", "0,0.5,1 lse).toBool());
").toString()); textColor = StelUtils::strToVec3f(conf->value("AngleMeasure/text_col
lineColor = StelUtils::strToVec3f(conf->value("line_color", "0,0.5,1 or", "0,0.5,1").toString());
").toString()); lineColor = StelUtils::strToVec3f(conf->value("AngleMeasure/line_col
horTextColor = StelUtils::strToVec3f(conf->value("text_color_horizon or", "0,0.5,1").toString());
tal", "0.9,0.6,0.4").toString()); horTextColor = StelUtils::strToVec3f(conf->value("AngleMeasure/text_
horLineColor = StelUtils::strToVec3f(conf->value("line_color_horizon color_horizontal", "0.9,0.6,0.4").toString());
tal", "0.9,0.6,0.4").toString()); horLineColor = StelUtils::strToVec3f(conf->value("AngleMeasure/line_
showPositionAngleHor(conf->value("show_position_angle_horizontal", f color_horizontal", "0.9,0.6,0.4").toString());
alse).toBool()); showPositionAngleHor(conf->value("AngleMeasure/show_position_angle_h
flagShowEquatorial = conf->value("show_equatorial", true).toBool(); orizontal", false).toBool());
flagShowHorizontal = conf->value("show_horizontal", false).toBool(); showEquatorial(conf->value("AngleMeasure/show_equatorial", true).toB
flagShowHorizontalStartSkylinked = conf->value("link_horizontal_star ool());
t_to_sky", false).toBool(); showHorizontal(conf->value("AngleMeasure/show_horizontal", false).to
flagShowHorizontalEndSkylinked = conf->value("link_horizontal_end_to Bool());
_sky", false).toBool(); showHorizontalStartSkylinked(conf->value("AngleMeasure/link_horizont
al_start_to_sky", false).toBool());
conf->endGroup(); showHorizontalEndSkylinked(conf->value("AngleMeasure/link_horizontal
} _end_to_sky", false).toBool());
void AngleMeasure::saveSettings()
{
conf->beginGroup("AngleMeasure");
conf->setValue("angle_format_dms", isDmsFormat());
conf->setValue("show_position_angle", isPaDisplayed());
conf->setValue("show_position_angle_horizontal", isHorPaDisplayed())
;
conf->setValue("show_equatorial", isEquatorial());
conf->setValue("show_horizontal", isHorizontal());
conf->setValue("link_horizontal_start_to_sky", isHorizontalStartSkyl
inked());
conf->setValue("link_horizontal_end_to_sky", isHorizontalEndSkylinke
d());
conf->endGroup();
} }
 End of changes. 11 change blocks. 
50 lines changed or deleted 56 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/