NavStars.cpp   NavStars.cpp 
skipping to change at line 32 skipping to change at line 32
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelPropertyMgr.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "NavStars.hpp" #include "NavStars.hpp"
#include "NavStarsWindow.hpp" #include "NavStarsWindow.hpp"
#include <QList> #include <QList>
#include <QSharedPointer> #include <QSharedPointer>
#include <QMetaEnum> #include <QMetaEnum>
StelModule* NavStarsStelPluginInterface::getStelModule() const StelModule* NavStarsStelPluginInterface::getStelModule() const
{ {
skipping to change at line 61 skipping to change at line 62
info.displayedName = N_("Navigational Stars"); info.displayedName = N_("Navigational Stars");
info.authors = "Alexander Wolf"; info.authors = "Alexander Wolf";
info.contact = "http://stellarium.org/"; info.contact = "http://stellarium.org/";
info.description = N_("This plugin marks navigational stars from a s elected set."); info.description = N_("This plugin marks navigational stars from a s elected set.");
info.version = NAVSTARS_PLUGIN_VERSION; info.version = NAVSTARS_PLUGIN_VERSION;
return info; return info;
} }
NavStars::NavStars() NavStars::NavStars()
: currentNSSet(AngloAmerican) : currentNSSet(AngloAmerican)
, starNamesState(false)
, toolbarButton(NULL) , toolbarButton(NULL)
{ {
setObjectName("NavStars"); setObjectName("NavStars");
conf = StelApp::getInstance().getSettings(); conf = StelApp::getInstance().getSettings();
propMgr = StelApp::getInstance().getStelPropertyManager();
mainWindow = new NavStarsWindow(); mainWindow = new NavStarsWindow();
// Get the manager of stars for manipulation of the stars labels
smgr = GETSTELMODULE(StarMgr);
} }
NavStars::~NavStars() NavStars::~NavStars()
{ {
delete mainWindow; delete mainWindow;
} }
double NavStars::getCallOrder(StelModuleActionName actionName) const double NavStars::getCallOrder(StelModuleActionName actionName) const
{ {
if (actionName == StelModule::ActionDraw) if (actionName == StelModule::ActionDraw)
skipping to change at line 127 skipping to change at line 125
toolbarButton = new StelButton(NULL, toolbarButton = new StelButton(NULL,
QPixmap(":/NavStars/b tNavStars-on.png"), QPixmap(":/NavStars/b tNavStars-on.png"),
QPixmap(":/NavStars/b tNavStars-off.png"), QPixmap(":/NavStars/b tNavStars-off.png"),
QPixmap(":/graphicGui /glow32x32.png"), QPixmap(":/graphicGui /glow32x32.png"),
"actionShow_NavStars" ); "actionShow_NavStars" );
} }
gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGr oup"); gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGr oup");
} }
// Sync global settings for stars labels // Sync global settings for stars labels
connect(smgr, SIGNAL(starLabelsDisplayedChanged(bool)), connect(GETSTELMODULE(StarMgr), SIGNAL(starLabelsDisplayedChanged(bo
this, SLOT(starNamesChanged(bool))); ol)), this, SLOT(starNamesChanged(bool)));
starNamesState = false;
} }
void NavStars::deinit() void NavStars::deinit()
{ {
markerTexture.clear(); markerTexture.clear();
stars.clear(); stars.clear();
starNumbers.clear(); starNumbers.clear();
} }
bool NavStars::configureGui(bool show) bool NavStars::configureGui(bool show)
skipping to change at line 210 skipping to change at line 206
} }
void NavStars::update(double deltaTime) void NavStars::update(double deltaTime)
{ {
markerFader.update((int)(deltaTime*1000)); markerFader.update((int)(deltaTime*1000));
} }
void NavStars::setNavStarsMarks(const bool b) void NavStars::setNavStarsMarks(const bool b)
{ {
if (b) if (b != getNavStarsMarks())
{
// Save the display state of the star labels and hide them.
starNamesState = smgr->getFlagLabels();
smgr->setFlagLabels(false);
}
else
{ {
// Restore the star labels state. propMgr->setStelPropertyValue("StarMgr.flagLabelsDisplayed",
smgr->setFlagLabels(starNamesState); !b);
markerFader = b;
emit navStarsMarksChanged(b);
} }
markerFader = b;
emit navStarsMarksChanged(b);
} }
bool NavStars::getNavStarsMarks() const bool NavStars::getNavStarsMarks() const
{ {
return markerFader; return markerFader;
} }
void NavStars::starNamesChanged(const bool b) void NavStars::starNamesChanged(const bool b)
{ {
if (b && getNavStarsMarks()) if (b && getNavStarsMarks())
{ {
starNamesState=true;
setNavStarsMarks(false); setNavStarsMarks(false);
} }
} }
void NavStars::restoreDefaultConfiguration(void) void NavStars::restoreDefaultConfiguration(void)
{ {
// Remove the whole section from the configuration file // Remove the whole section from the configuration file
conf->remove("NavigationalStars"); conf->remove("NavigationalStars");
// Load the default values... // Load the default values...
loadConfiguration(); loadConfiguration();
 End of changes. 9 change blocks. 
20 lines changed or deleted 9 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/