Exoplanet.cpp   Exoplanet.cpp 
skipping to change at line 28 skipping to change at line 28
#include "Exoplanet.hpp" #include "Exoplanet.hpp"
#include "Exoplanets.hpp" #include "Exoplanets.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelLocaleMgr.hpp"
#include "renderer/StelRenderer.hpp" #include "renderer/StelRenderer.hpp"
#include "renderer/StelTextureNew.hpp" #include "renderer/StelTextureNew.hpp"
#include <QTextStream> #include <QTextStream>
#include <QDebug> #include <QDebug>
#include <QVariant> #include <QVariant>
#include <QVariantMap> #include <QVariantMap>
#include <QVariant> #include <QVariant>
#include <QList> #include <QList>
skipping to change at line 160 skipping to change at line 161
if (getVMagnitude(core, false)>20.f) if (getVMagnitude(core, false)>20.f)
{ {
return 20.f; return 20.f;
} }
else else
{ {
return getVMagnitude(core, false) - 1.f; return getVMagnitude(core, false) - 1.f;
} }
} }
QString Exoplanet::getNameI18n(void) const
{
// Use SkyTranslator for translation star names
StelTranslator trans = StelApp::getInstance().getLocaleMgr().getSkyT
ranslator();
return trans.qtranslate(designation);
}
QString Exoplanet::getInfoString(const StelCore* core, const InfoStringGrou p& flags) const QString Exoplanet::getInfoString(const StelCore* core, const InfoStringGrou p& flags) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
if (flags&Name) if (flags&Name)
{ {
oss << "<h2>" << designation << "</h2>";
oss << "<h2>" << getNameI18n() << "</h2>";
} }
if (flags&Magnitude) if (flags&Magnitude)
{ {
if (Vmag<99) if (Vmag<99 && !GETSTELMODULE(Exoplanets)->getDisplayMode())
{ {
if (core->getSkyDrawer()->getFlagHasAtmosphere()) if (core->getSkyDrawer()->getFlagHasAtmosphere())
{ {
oss << q_("Magnitude: <b>%1</b> (extincted t o: <b>%2</b>)").arg(QString::number(getVMagnitude(core, false), 'f', 2), oss << q_("Magnitude: <b>%1</b> (extincted t o: <b>%2</b>)").arg(QString::number(getVMagnitude(core, false), 'f', 2),
QString::number(getVMagnitude(core, true), 'f', 2)) << "<br>"; QString::number(getVMagnitude(core, true), 'f', 2)) << "<br>";
} }
else else
{ {
oss << q_("Magnitude: <b>%1</b>").arg(QStrin g::number(getVMagnitude(core, false), 'f', 2)) << "<br>"; oss << q_("Magnitude: <b>%1</b>").arg(QStrin g::number(getVMagnitude(core, false), 'f', 2)) << "<br>";
} }
skipping to change at line 375 skipping to change at line 384
StelUtils::getDateFromJulianDay(core->getJDay()+0.5, &year, &month, &day); StelUtils::getDateFromJulianDay(core->getJDay()+0.5, &year, &month, &day);
discovery.clear(); discovery.clear();
foreach(const exoplanetData &p, exoplanets) foreach(const exoplanetData &p, exoplanets)
{ {
if (p.discovered>0) if (p.discovered>0)
{ {
discovery.append(p.discovered); discovery.append(p.discovered);
} }
} }
qSort(discovery.begin(),discovery.end()); qSort(discovery.begin(),discovery.end());
if (discovery.at(0)<=year && discovery.at(0)>0) if (!discovery.isEmpty())
{ {
return true; if (discovery.at(0)<=year && discovery.at(0)>0)
} {
else return true;
{ }
return false;
} }
return false;
} }
void Exoplanet::update(double deltaTime) void Exoplanet::update(double deltaTime)
{ {
labelsFader.update((int)(deltaTime*1000)); labelsFader.update((int)(deltaTime*1000));
} }
void Exoplanet::draw(StelCore* core, StelRenderer* renderer, StelProjectorP projector, void Exoplanet::draw(StelCore* core, StelRenderer* renderer, StelProjectorP projector,
StelTextureNew* markerTexture) StelTextureNew* markerTexture)
{ {
skipping to change at line 432 skipping to change at line 441
{ {
Vec3d win; Vec3d win;
if(!projector->project(XYZ, win)){return;} if(!projector->project(XYZ, win)){return;}
if (GETSTELMODULE(Exoplanets)->getDisplayMode()) if (GETSTELMODULE(Exoplanets)->getDisplayMode())
{ {
renderer->drawTexturedRect(win[0] - 4, win[1 ] - 4, 8, 8); renderer->drawTexturedRect(win[0] - 4, win[1 ] - 4, 8, 8);
} }
else else
{ {
renderer->drawTexturedRect(win[0] - 5, win[1 ] - 5, 10, 10); renderer->drawTexturedRect(win[0] - 5, win[1 ] - 5, 10, 10);
renderer->drawText(TextParams(XYZ, projector , designation).shift(shift, shift).useGravity()); renderer->drawText(TextParams(XYZ, projector , getNameI18n()).shift(shift, shift).useGravity());
} }
} }
} }
} }
 End of changes. 8 change blocks. 
9 lines changed or deleted 19 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/