Nova.cpp   Nova.cpp 
skipping to change at line 38 skipping to change at line 38
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelPainter.hpp" #include "StelPainter.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>
const QString Nova::NOVA_TYPE = QStringLiteral("Nova");
Nova::Nova(const QVariantMap& map) Nova::Nova(const QVariantMap& map)
: initialized(false) : initialized(false)
, designation("") , designation("")
, novaName("") , novaName("")
, novaType("") , novaType("")
, maxMagnitude(21.) , maxMagnitude(21.)
, minMagnitude(21.) , minMagnitude(21.)
, peakJD(0.) , peakJD(0.)
, m2(-1) , m2(-1)
, m3(-1) , m3(-1)
skipping to change at line 110 skipping to change at line 112
return map; return map;
} }
QString Nova::getEnglishName() const QString Nova::getEnglishName() const
{ {
return novaName; return novaName;
} }
QString Nova::getNameI18n() const QString Nova::getNameI18n() const
{ {
return novaName; const StelTranslator& trans = StelApp::getInstance().getLocaleMgr().
getSkyTranslator();
// Parse the nova name to get parts to translation
QRegExp nn("^Nova\\s+(\\w+|\\w+\\s+\\w+)\\s+(\\d+|\\d+\\s+#\\d+)$");
QString nameI18n = novaName;
if (nn.exactMatch(novaName))
nameI18n = QString("%1 %2 %3").arg(trans.qtranslate("Nova",
"Nova template"), trans.qtranslate(nn.capturedTexts().at(1).trimmed(), "Gen
itive name of constellation"), nn.capturedTexts().at(2).trimmed());
else
nameI18n = trans.qtranslate(novaName);
return nameI18n;
} }
QString Nova::getDesignation() const QString Nova::getDesignation() const
{ {
return designation; return designation;
} }
QString Nova::getMaxBrightnessDate(const double JD) const QString Nova::getMaxBrightnessDate(const double JD) const
{ {
return StelApp::getInstance().getLocaleMgr().getPrintableDateLocal(J D); return StelApp::getInstance().getLocaleMgr().getPrintableDateLocal(J D);
} }
QString Nova::getInfoString(const StelCore* core, const InfoStringGroup& fl ags) const QString Nova::getInfoString(const StelCore* core, const InfoStringGroup& fl ags) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
double mag = getVMagnitude(core); double mag = getVMagnitude(core);
if (flags&Name) if (flags&Name)
{ {
QString name = novaName.isEmpty() ? QString("<h2>%1</h2>").a rg(designation) : QString("<h2>%1 (%2)</h2>").arg(novaName).arg(designation ); QString name = novaName.isEmpty() ? QString("<h2>%1</h2>").a rg(designation) : QString("<h2>%1 (%2)</h2>").arg(getNameI18n()).arg(design ation);
oss << name; oss << name;
} }
if (flags&ObjectType) if (flags&ObjectType)
oss << q_("Type: <b>%1</b> (%2)").arg(q_("nova")).arg(novaTy pe) << "<br />"; oss << q_("Type: <b>%1</b> (%2)").arg(q_("nova")).arg(novaTy pe) << "<br />";
if (flags&Magnitude) if (flags&Magnitude)
{ {
if (core->getSkyDrawer()->getFlagHasAtmosphere()) if (core->getSkyDrawer()->getFlagHasAtmosphere())
oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2</b>)"). arg(QString::number(mag, 'f', 2), oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2</b>)"). arg(QString::number(mag, 'f', 2),
skipping to change at line 334 skipping to change at line 345
StelUtils::spheToRect(RA, Dec, XYZ); StelUtils::spheToRect(RA, Dec, XYZ);
mag = getVMagnitudeWithExtinction(core); mag = getVMagnitudeWithExtinction(core);
sd->preDrawPointSource(painter); sd->preDrawPointSource(painter);
float mlimit = sd->getLimitMagnitude(); float mlimit = sd->getLimitMagnitude();
if (mag <= mlimit) if (mag <= mlimit)
{ {
sd->computeRCMag(mag, &rcMag); sd->computeRCMag(mag, &rcMag);
sd->drawPointSource(painter, Vec3f(XYZ[0],XYZ[1],XYZ[2]), rc Mag, color, false); sd->drawPointSource(painter, Vec3f(XYZ[0],XYZ[1],XYZ[2]), rc Mag, color, false);
painter->setColor(color[0], color[1], color[2], 1.f); painter->setColor(color[0], color[1], color[2], 1.f);
size = getAngularSize(NULL)*M_PI/180.*painter->getProjector( )->getPixelPerRadAtCenter(); size = getAngularSize(Q_NULLPTR)*M_PI/180.*painter->getProje ctor()->getPixelPerRadAtCenter();
shift = 6.f + size/1.8f; shift = 6.f + size/1.8f;
if (labelsFader.getInterstate()<=0.f && (mag+5.f)<mlimit && smgr->getFlagLabels()) if (labelsFader.getInterstate()<=0.f && (mag+5.f)<mlimit && smgr->getFlagLabels())
{ {
QString name = novaName.isEmpty() ? designation : no vaName; QString name = novaName.isEmpty() ? designation : no vaName;
painter->drawText(XYZ, name, 0, shift, shift, false) ; painter->drawText(XYZ, name, 0, shift, shift, false) ;
} }
} }
sd->postDrawPointSource(painter); sd->postDrawPointSource(painter);
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 17 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/