OcularsGuiPanel.cpp   OcularsGuiPanel.cpp 
skipping to change at line 45 skipping to change at line 45
#include <QPushButton> #include <QPushButton>
#include <QSignalMapper> #include <QSignalMapper>
#include <QWidget> #include <QWidget>
OcularsGuiPanel::OcularsGuiPanel(Oculars* plugin, OcularsGuiPanel::OcularsGuiPanel(Oculars* plugin,
QGraphicsWidget *parent, QGraphicsWidget *parent,
Qt::WindowFlags wFlags): Qt::WindowFlags wFlags):
QGraphicsWidget(parent, wFlags), QGraphicsWidget(parent, wFlags),
ocularsPlugin(plugin), ocularsPlugin(plugin),
parentWidget(parent), parentWidget(parent),
borderPath(0) borderPath(Q_NULLPTR)
{ {
setMaximumSize(300, 400); setMaximumSize(300, 400);
setContentsMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0);
//TODO: set font? //TODO: set font?
//First create the layout and populate it, then set it? //First create the layout and populate it, then set it?
mainLayout = new QGraphicsLinearLayout(Qt::Vertical); mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
//Button bar //Button bar
buttonBar = new QGraphicsWidget(); buttonBar = new QGraphicsWidget();
skipping to change at line 179 skipping to change at line 179
float scale = lineHeight*1.5; // TODO: change hardcoded 1.5 to edita ble value of scaling coefficient float scale = lineHeight*1.5; // TODO: change hardcoded 1.5 to edita ble value of scaling coefficient
QPixmap pa(":/graphicGui/btTimeRewind-on.png"); QPixmap pa(":/graphicGui/btTimeRewind-on.png");
QPixmap prevArrow = pa.scaledToHeight(scale, Qt::SmoothTransformatio n); QPixmap prevArrow = pa.scaledToHeight(scale, Qt::SmoothTransformatio n);
QPixmap paOff(":/graphicGui/btTimeRewind-off.png"); QPixmap paOff(":/graphicGui/btTimeRewind-off.png");
QPixmap prevArrowOff = paOff.scaledToHeight(scale, Qt::SmoothTransfo rmation); QPixmap prevArrowOff = paOff.scaledToHeight(scale, Qt::SmoothTransfo rmation);
QPixmap na(":/graphicGui/btTimeForward-on.png"); QPixmap na(":/graphicGui/btTimeForward-on.png");
QPixmap nextArrow = na.scaledToHeight(scale, Qt::SmoothTransformatio n); QPixmap nextArrow = na.scaledToHeight(scale, Qt::SmoothTransformatio n);
QPixmap naOff(":/graphicGui/btTimeForward-off.png"); QPixmap naOff(":/graphicGui/btTimeForward-off.png");
QPixmap nextArrowOff = naOff.scaledToHeight(scale, Qt::SmoothTransfo rmation); QPixmap nextArrowOff = naOff.scaledToHeight(scale, Qt::SmoothTransfo rmation);
StelActionMgr* actionsMgr = StelApp::getInstance().getStelActionMana ger(); StelActionMgr* actionMgr = StelApp::getInstance().getStelActionManag er();
QString ocularsGroup = N_("Oculars"); // Possible group name: Ocular s on-screen control panel QString ocularsGroup = N_("Oculars"); // Possible group name: Ocular s on-screen control panel
actionsMgr->addAction("actionToggle_Oculars_Previous_Ocular", ocular actionMgr->addAction("actionToggle_Oculars_Previous_Ocular", oculars
sGroup, N_("Previous ocular"), this, "updateOcularControls()", "", ""); Group, N_("Previous ocular"), this, "updateOcularControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Next_Ocular", ocularsGro actionMgr->addAction("actionToggle_Oculars_Next_Ocular", ocularsGrou
up, N_("Next ocular"), this, "updateOcularControls()", "", ""); p, N_("Next ocular"), this, "updateOcularControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Previous_Lens", ocularsG actionMgr->addAction("actionToggle_Oculars_Previous_Lens", ocularsGr
roup, N_("Previous lens"), this, "updateLensControls()", "", ""); oup, N_("Previous lens"), this, "updateLensControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Next_Lens", ocularsGroup actionMgr->addAction("actionToggle_Oculars_Next_Lens", ocularsGroup,
, N_("Next lens"), this, "updateLensControls()", "", ""); N_("Next lens"), this, "updateLensControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Previous_CCD", ocularsGr actionMgr->addAction("actionToggle_Oculars_Previous_CCD", ocularsGro
oup, N_("Previous CCD frame"), this, "updateCcdControls()", "", ""); up, N_("Previous CCD frame"), this, "updateCcdControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Next_CCD", ocularsGroup, actionMgr->addAction("actionToggle_Oculars_Next_CCD", ocularsGroup,
N_("Next CCD frame"), this, "updateCcdControls()", "", ""); N_("Next CCD frame"), this, "updateCcdControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Previous_Telescope", ocu actionMgr->addAction("actionToggle_Oculars_Previous_Telescope", ocul
larsGroup, N_("Previous telescope"), this, "updateTelescopeControls()", "", arsGroup, N_("Previous telescope"), this, "updateTelescopeControls()", "",
""); "");
actionsMgr->addAction("actionToggle_Oculars_Next_Telescope", oculars actionMgr->addAction("actionToggle_Oculars_Next_Telescope", ocularsG
Group, N_("Next telescope"), this, "updateTelescopeControls()", "", ""); roup, N_("Next telescope"), this, "updateTelescopeControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Rotate_Frame_Reset", ocu actionMgr->addAction("actionToggle_Oculars_Rotate_Frame_Reset", ocul
larsGroup, N_("Reset the sensor frame rotation"), this, "updateCcdControls( arsGroup, N_("Reset the sensor frame rotation"), this, "updateCcdControls()
)", "", ""); ", "", "");
actionsMgr->addAction("actionToggle_Oculars_Rotate_Frame_15_Counterc actionMgr->addAction("actionToggle_Oculars_Rotate_Frame_15_Countercl
lockwise", ocularsGroup, N_("Rotate the sensor frame 15 degrees countercloc ockwise", ocularsGroup, N_("Rotate the sensor frame 15 degrees counterclock
kwise"), this, "updateCcdControls()", "", ""); wise"), this, "updateCcdControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Rotate_Frame_5_Countercl actionMgr->addAction("actionToggle_Oculars_Rotate_Frame_5_Counterclo
ockwise", ocularsGroup, N_("Rotate the sensor frame 5 degrees counterclockw ckwise", ocularsGroup, N_("Rotate the sensor frame 5 degrees counterclockwi
ise"), this, "updateCcdControls()", "", ""); se"), this, "updateCcdControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Rotate_Frame_1_Countercl actionMgr->addAction("actionToggle_Oculars_Rotate_Frame_1_Counterclo
ockwise", ocularsGroup, N_("Rotate the sensor frame 1 degree counterclockwi ckwise", ocularsGroup, N_("Rotate the sensor frame 1 degree counterclockwis
se"), this, "updateCcdControls()", "", ""); e"), this, "updateCcdControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Rotate_Frame_15_Clockwis actionMgr->addAction("actionToggle_Oculars_Rotate_Frame_15_Clockwise
e", ocularsGroup, N_("Rotate the sensor frame 15 degrees clockwise"), this, ", ocularsGroup, N_("Rotate the sensor frame 15 degrees clockwise"), this,
"updateCcdControls()", "", ""); "updateCcdControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Rotate_Frame_5_Clockwise actionMgr->addAction("actionToggle_Oculars_Rotate_Frame_5_Clockwise"
", ocularsGroup, N_("Rotate the sensor frame 5 degrees clockwise"), this, " , ocularsGroup, N_("Rotate the sensor frame 5 degrees clockwise"), this, "u
updateCcdControls()", "", ""); pdateCcdControls()", "", "");
actionsMgr->addAction("actionToggle_Oculars_Rotate_Frame_1_Clockwise actionMgr->addAction("actionToggle_Oculars_Rotate_Frame_1_Clockwise"
", ocularsGroup, N_("Rotate the sensor frame 1 degree clockwise"), this, "u , ocularsGroup, N_("Rotate the sensor frame 1 degree clockwise"), this, "up
pdateCcdControls()", "", ""); dateCcdControls()", "", "");
prevOcularButton = new StelButton(ocularControls, prevOcularButton = new StelButton(ocularControls,
prevArrow, prevArrow,
prevArrowOff, prevArrowOff,
QPixmap(), QPixmap(),
"actionToggle_Oculars_Previous_Ocu lar"); "actionToggle_Oculars_Previous_Ocu lar");
prevOcularButton->setToolTip(q_("Previous ocular")); prevOcularButton->setToolTip(q_("Previous ocular"));
nextOcularButton = new StelButton(ocularControls, nextOcularButton = new StelButton(ocularControls,
nextArrow, nextArrow,
nextArrowOff, nextArrowOff,
skipping to change at line 588 skipping to change at line 588
updateTelescopeControls();//Contains a call to updatePosition() updateTelescopeControls();//Contains a call to updatePosition()
} }
void OcularsGuiPanel::updateLensControls() void OcularsGuiPanel::updateLensControls()
{ {
Lens* lens = ocularsPlugin->selectedLens(); Lens* lens = ocularsPlugin->selectedLens();
int index = ocularsPlugin->selectedLensIndex; int index = ocularsPlugin->selectedLensIndex;
QString fullName; QString fullName;
QString multiplerString; QString multiplerString;
if (lens != NULL) if (lens != Q_NULLPTR)
{ {
QString name = lens->getName(); QString name = lens->getName();
if (name.isEmpty()) if (name.isEmpty())
{ {
fullName = QString(q_("Lens #%1")).arg(index); fullName = QString(q_("Lens #%1")).arg(index);
} }
else else
{ {
fullName = QString(q_("Lens #%1: %2")).arg(index).ar g(name); fullName = QString(q_("Lens #%1: %2")).arg(index).ar g(name);
} }
multiplerString = QString(q_("Multiplicity: %1")).arg(lens-> getMultipler()); multiplerString = QString(q_("Multiplicity: %1")).arg(lens-> getMultipler());
multiplerString.append(QChar(0x00D7)); multiplerString.append(QChar(0x02E3)); // Was 0x00D7
} }
else else
{ {
fullName = QString(q_("Lens: None")); fullName = QString(q_("Lens: None"));
multiplerString = QString(q_("Multiplicity: N/A")); multiplerString = QString(q_("Multiplicity: N/A"));
} }
fieldLensName->setPlainText(fullName); fieldLensName->setPlainText(fullName);
fieldLensMultipler->setPlainText(multiplerString); fieldLensMultipler->setPlainText(multiplerString);
fieldOcularFl->setToolTip(q_("Focal length of eyepiece")); fieldOcularFl->setToolTip(q_("Focal length of eyepiece"));
skipping to change at line 857 skipping to change at line 857
nextTelescopeButton->setVisible(true); nextTelescopeButton->setVisible(true);
fieldTelescopeName->setVisible(true); fieldTelescopeName->setVisible(true);
fieldMagnification->setToolTip(q_("Magnification pro vided by this ocular/lens/telescope combination")); fieldMagnification->setToolTip(q_("Magnification pro vided by this ocular/lens/telescope combination"));
fieldFov->setToolTip(q_("Actual field of view provid ed by this ocular/lens/telescope combination")); fieldFov->setToolTip(q_("Actual field of view provid ed by this ocular/lens/telescope combination"));
fieldExitPupil->setToolTip(q_("Exit pupil provided b y this ocular/lens/telescope combination")); fieldExitPupil->setToolTip(q_("Exit pupil provided b y this ocular/lens/telescope combination"));
} }
double mag = ocular->magnification(telescope, lens); double mag = ocular->magnification(telescope, lens);
QString magnificationString = QString::number(mag, 'f', 1); QString magnificationString = QString::number(mag, 'f', 1);
magnificationString.append(QChar(0x00D7)); magnificationString.append(QChar(0x02E3)); // Was 0x00D7
magnificationString.append(QString(" (%1D)").arg(QString::nu
mber(mag/telescope->diameter(), 'f', 2)));
QString magnificationLabel = QString(q_("Magnification: %1") ).arg(magnificationString); QString magnificationLabel = QString(q_("Magnification: %1") ).arg(magnificationString);
fieldMagnification->setPlainText(magnificationLabel); fieldMagnification->setPlainText(magnificationLabel);
fieldMagnification->setPos(posX, posY); fieldMagnification->setPos(posX, posY);
posY += fieldMagnification->boundingRect().height(); posY += fieldMagnification->boundingRect().height();
widgetHeight += fieldMagnification->boundingRect().height(); widgetHeight += fieldMagnification->boundingRect().height();
if (mag>0) if (mag>0)
{ {
double exitPupil = telescope->diameter()/mag; double exitPupil = telescope->diameter()/mag;
if (ocular->isBinoculars()) if (ocular->isBinoculars())
 End of changes. 6 change blocks. 
44 lines changed or deleted 46 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/