Satellites.cpp   Satellites.cpp 
skipping to change at line 112 skipping to change at line 112
qDebug() << "Stellites::init no Satellites section e xists in main config file - creating with defaults"; qDebug() << "Stellites::init no Satellites section e xists in main config file - creating with defaults";
restoreDefaultConfigIni(); restoreDefaultConfigIni();
} }
// populate settings from main config file. // populate settings from main config file.
readSettingsFromConfig(); readSettingsFromConfig();
satellitesJsonPath = StelFileMgr::findFile("modules/Satellit es", (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable)) + "/satellites.json"; satellitesJsonPath = StelFileMgr::findFile("modules/Satellit es", (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable)) + "/satellites.json";
// Load and find resources used in the plugin // Load and find resources used in the plugin
texPointer = StelApp::getInstance().getTextureManager().crea teTexture("pointeur5.png"); texPointer = StelApp::getInstance().getTextureManager().crea teTexture("textures/pointeur5.png");
Satellite::hintTexture = StelApp::getInstance().getTextureMa nager().createTexture(":/satellites/satellite_hint.png"); Satellite::hintTexture = StelApp::getInstance().getTextureMa nager().createTexture(":/satellites/satellite_hint.png");
// key bindings and other actions // key bindings and other actions
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance() .getGui()); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance() .getGui());
gui->addGuiActions("actionShow_Satellite_ConfigDialog", "Sat ellite Config Dialog", "Shift+Ctrl+Z", "Plugin Key Bindings", true, false); gui->addGuiActions("actionShow_Satellite_ConfigDialog", "Sat ellite Config Dialog", "Alt+Z", "Plugin Key Bindings", true, false);
gui->addGuiActions("actionShow_Satellite_Hints", "Satellite Hints", "Ctrl+Z", "Plugin Key Bindings", true, false); gui->addGuiActions("actionShow_Satellite_Hints", "Satellite Hints", "Ctrl+Z", "Plugin Key Bindings", true, false);
gui->getGuiActions("actionShow_Satellite_Hints")->setChecked (hintFader); gui->getGuiActions("actionShow_Satellite_Hints")->setChecked (hintFader);
gui->addGuiActions("actionShow_Satellite_Labels", "Satellite Labels", "Shift+Z", "Plugin Key Bindings", true, false); gui->addGuiActions("actionShow_Satellite_Labels", "Satellite Labels", "Shift+Z", "Plugin Key Bindings", true, false);
gui->getGuiActions("actionShow_Satellite_Labels")->setChecke d(Satellite::showLabels); gui->getGuiActions("actionShow_Satellite_Labels")->setChecke d(Satellite::showLabels);
// Gui toolbar button // Gui toolbar button
pxmapGlow = new QPixmap(":/graphicGui/gui/glow32x32.png"); pxmapGlow = new QPixmap(":/graphicGui/glow32x32.png");
pxmapOnIcon = new QPixmap(":/satellites/bt_satellites_on.png "); pxmapOnIcon = new QPixmap(":/satellites/bt_satellites_on.png ");
pxmapOffIcon = new QPixmap(":/satellites/bt_satellites_off.p ng"); pxmapOffIcon = new QPixmap(":/satellites/bt_satellites_off.p ng");
toolbarButton = new StelButton(NULL, *pxmapOnIcon, *pxmapOff Icon, *pxmapGlow, gui->getGuiActions("actionShow_Satellite_Hints")); toolbarButton = new StelButton(NULL, *pxmapOnIcon, *pxmapOff Icon, *pxmapGlow, gui->getGuiActions("actionShow_Satellite_Hints"));
gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGr oup"); gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGr oup");
connect(gui->getGuiActions("actionShow_Satellite_ConfigDialo g"), SIGNAL(toggled(bool)), configDialog, SLOT(setVisible(bool))); connect(gui->getGuiActions("actionShow_Satellite_ConfigDialo g"), SIGNAL(toggled(bool)), configDialog, SLOT(setVisible(bool)));
connect(gui->getGuiActions("actionShow_Satellite_Hints"), SI GNAL(toggled(bool)), this, SLOT(setFlagHints(bool))); connect(gui->getGuiActions("actionShow_Satellite_Hints"), SI GNAL(toggled(bool)), this, SLOT(setFlagHints(bool)));
connect(gui->getGuiActions("actionShow_Satellite_Labels"), S IGNAL(toggled(bool)), this, SLOT(setFlagLabels(bool))); connect(gui->getGuiActions("actionShow_Satellite_Labels"), S IGNAL(toggled(bool)), this, SLOT(setFlagLabels(bool)));
} }
catch (std::runtime_error &e) catch (std::runtime_error &e)
skipping to change at line 169 skipping to change at line 169
updateTimer->setSingleShot(false); // recurring check for update updateTimer->setSingleShot(false); // recurring check for update
updateTimer->setInterval(13000); // check once every 13 seconds to see if it is time for an update updateTimer->setInterval(13000); // check once every 13 seconds to see if it is time for an update
connect(updateTimer, SIGNAL(timeout()), this, SLOT(checkForUpdate()) ); connect(updateTimer, SIGNAL(timeout()), this, SLOT(checkForUpdate()) );
updateTimer->start(); updateTimer->start();
earth = GETSTELMODULE(SolarSystem)->getEarth(); earth = GETSTELMODULE(SolarSystem)->getEarth();
GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this); GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this);
// Handle changes to the observer location: // Handle changes to the observer location:
connect(StelApp::getInstance().getCore()->getNavigator(), SIGNAL(loc ationChanged(StelLocation)), this, SLOT(observerLocationChanged(StelLocatio n))); connect(StelApp::getInstance().getCore()->getNavigator(), SIGNAL(loc ationChanged(StelLocation)), this, SLOT(observerLocationChanged(StelLocatio n)));
//Load the module's custom style sheets
QFile styleSheetFile;
styleSheetFile.setFileName(":/satellites/normalStyle.css");
if(styleSheetFile.open(QFile::ReadOnly|QFile::Text))
{
normalStyleSheet = styleSheetFile.readAll();
}
styleSheetFile.close();
styleSheetFile.setFileName(":/satellites/nightStyle.css");
if(styleSheetFile.open(QFile::ReadOnly|QFile::Text))
{
nightStyleSheet = styleSheetFile.readAll();
}
styleSheetFile.close();
}
void Satellites::setStelStyle(const QString&)
{
configDialog->updateStyle();
}
const StelStyle Satellites::getModuleStyleSheet(const StelStyle& style)
{
StelStyle pluginStyle(style);
if (style.confSectionName == "color")
{
pluginStyle.qtStyleSheet.append(normalStyleSheet);
}
else
{
pluginStyle.qtStyleSheet.append(nightStyleSheet);
}
return pluginStyle;
} }
double Satellites::getCallOrder(StelModuleActionName actionName) const double Satellites::getCallOrder(StelModuleActionName actionName) const
{ {
if (actionName==StelModule::ActionDraw) if (actionName==StelModule::ActionDraw)
return StelApp::getInstance().getModuleMgr().getModule("Star Mgr")->getCallOrder(actionName)+1.; return StelApp::getInstance().getModuleMgr().getModule("Star Mgr")->getCallOrder(actionName)+1.;
return 0; return 0;
} }
QList<StelObjectP> Satellites::searchAround(const Vec3d& av, double limitFo v, const StelCore* core) const QList<StelObjectP> Satellites::searchAround(const Vec3d& av, double limitFo v, const StelCore*) const
{ {
QList<StelObjectP> result; QList<StelObjectP> result;
if (!hintFader || StelApp::getInstance().getCore()->getNavigator()-> getCurrentLocation().planetName != earth->getEnglishName()) if (!hintFader || StelApp::getInstance().getCore()->getNavigator()-> getCurrentLocation().planetName != earth->getEnglishName())
return result; return result;
Vec3d v(av); Vec3d v(av);
v.normalize(); v.normalize();
double cosLimFov = cos(limitFov * M_PI/180.); double cosLimFov = cos(limitFov * M_PI/180.);
Vec3d equPos; Vec3d equPos;
skipping to change at line 544 skipping to change at line 578
{ {
downloadMgr->get(QNetworkRequest(QUrl(updateUrls.at(i)))); downloadMgr->get(QNetworkRequest(QUrl(updateUrls.at(i))));
} }
} }
void Satellites::updateDownloadComplete(QNetworkReply* reply) void Satellites::updateDownloadComplete(QNetworkReply* reply)
{ {
// check the download worked, and save the data to file if this is t he case. // check the download worked, and save the data to file if this is t he case.
if (reply->error() != QNetworkReply::NoError) if (reply->error() != QNetworkReply::NoError)
{ {
qWarning() << "Satellites::updateDownloadComplete FAILED to download" << reply->url() << " Error: " << reply->error(); qWarning() << "Satellites::updateDownloadComplete FAILED to download" << reply->url() << " Error: " << reply->errorString();
} }
else else
{ {
// download completed successfully. // download completed successfully.
try try
{ {
QString partialName = QString("tle%1.txt").arg(numbe rDownloadsComplete); QString partialName = QString("tle%1.txt").arg(numbe rDownloadsComplete);
QString tleTmpFilePath = StelFileMgr::findFile("modu les/Satellites", StelFileMgr::Flags(StelFileMgr::Writable|StelFileMgr::Dire ctory)) + "/" + partialName; QString tleTmpFilePath = StelFileMgr::findFile("modu les/Satellites", StelFileMgr::Flags(StelFileMgr::Writable|StelFileMgr::Dire ctory)) + "/" + partialName;
QFile tmpFile(tleTmpFilePath); QFile tmpFile(tleTmpFilePath);
tmpFile.remove(); tmpFile.remove();
 End of changes. 6 change blocks. 
5 lines changed or deleted 39 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/