Oculars.cpp   Oculars.cpp 
skipping to change at line 509 skipping to change at line 509
} else { } else {
selectedTelescopeIndex = 0; selectedTelescopeIndex = 0;
} }
ocularDialog = new OcularDialog(this, &ccds, &oculars, &tele scopes); ocularDialog = new OcularDialog(this, &ccds, &oculars, &tele scopes);
initializeActivationActions(); initializeActivationActions();
determineMaxEyepieceAngle(); determineMaxEyepieceAngle();
guiPanelEnabled = settings->value("enable_control_panel", fa lse).toBool(); guiPanelEnabled = settings->value("enable_control_panel", fa lse).toBool();
enableGuiPanel(guiPanelEnabled); enableGuiPanel(guiPanelEnabled);
setFlagDecimalDegrees(settings->value("use_decimal_degrees",
false).toBool());
} catch (std::runtime_error& e) { } catch (std::runtime_error& e) {
qWarning() << "WARNING: unable to locate ocular.ini file or create a default one for Ocular plugin: " << e.what(); qWarning() << "WARNING: unable to locate ocular.ini file or create a default one for Ocular plugin: " << e.what();
ready = false; ready = false;
} }
//Load the module's custom style sheets //Load the module's custom style sheets
QFile styleSheetFile; QFile styleSheetFile;
styleSheetFile.setFileName(":/ocular/normalStyle.css"); styleSheetFile.setFileName(":/ocular/normalStyle.css");
if(styleSheetFile.open(QFile::ReadOnly|QFile::Text)) { if(styleSheetFile.open(QFile::ReadOnly|QFile::Text)) {
normalStyleSheet = styleSheetFile.readAll(); normalStyleSheet = styleSheetFile.readAll();
skipping to change at line 1469 skipping to change at line 1471
QString eFocalLength = QVariant(ocular->effectiveFoc alLength()).toString(); QString eFocalLength = QVariant(ocular->effectiveFoc alLength()).toString();
// TRANSLATORS: FL = Focal length // TRANSLATORS: FL = Focal length
QString eFocalLengthLabel = QString(q_("Ocular FL: % 1 mm")).arg(eFocalLength); QString eFocalLengthLabel = QString(q_("Ocular FL: % 1 mm")).arg(eFocalLength);
painter.drawText(xPosition, yPosition, eFocalLengthL abel); painter.drawText(xPosition, yPosition, eFocalLengthL abel);
yPosition-=lineHeight; yPosition-=lineHeight;
QString ocularFov = QString::number(ocular->appearen tFOV()); QString ocularFov = QString::number(ocular->appearen tFOV());
ocularFov.append(QChar(0x00B0));//Degree sign ocularFov.append(QChar(0x00B0));//Degree sign
// TRANSLATORS: aFOV = apparent field of view // TRANSLATORS: aFOV = apparent field of view
QString ocularFOVLabel = QString(q_("Ocular aFOV: %1 ")) QString ocularFOVLabel = QString(q_("Ocular aFOV: %1 "))
.arg(ocularFov); .arg(ocularFov);
painter.drawText(xPosition, yPosition, ocularFOVLabe l); painter.drawText(xPosition, yPosition, ocularFOVLabe l);
yPosition-=lineHeight; yPosition-=lineHeight;
// The telescope // The telescope
QString telescopeNumberLabel; QString telescopeNumberLabel;
QString telescopeName = telescope->name(); QString telescopeName = telescope->name();
if (telescopeName.isEmpty()) if (telescopeName.isEmpty())
{ {
telescopeNumberLabel = QString(q_("Telescope #%1")) telescopeNumberLabel = QString(q_("Telescope #%1"))
.arg(selectedTelescop eIndex); .arg(selectedTelescop eIndex);
skipping to change at line 1512 skipping to change at line 1514
QString fovLabel = QString(q_("FOV: %1")).arg(fovStr ing); QString fovLabel = QString(q_("FOV: %1")).arg(fovStr ing);
painter.drawText(xPosition, yPosition, fovLabel); painter.drawText(xPosition, yPosition, fovLabel);
} }
} }
// The CCD // The CCD
if (flagShowCCD) { if (flagShowCCD) {
QString ccdSensorLabel, ccdInfoLabel; QString ccdSensorLabel, ccdInfoLabel;
double fovX = ((int)(ccd->getActualFOVx(telescope) * 1000.0) ) / 1000.0; double fovX = ((int)(ccd->getActualFOVx(telescope) * 1000.0) ) / 1000.0;
double fovY = ((int)(ccd->getActualFOVy(telescope) * 1000.0) ) / 1000.0; double fovY = ((int)(ccd->getActualFOVy(telescope) * 1000.0) ) / 1000.0;
QString stringFovX = QString::number(fovX); ccdInfoLabel = QString(q_("Dimensions: %1")).arg(getDimensio
stringFovX.append(QChar(0x00B0));//Degree sign nsString(fovX, fovY));
QString stringFovY = QString::number(fovY);
stringFovY.append(QChar(0x00B0));//Degree sign
QString fovDimensions = stringFovX + QChar(0x00D7) + stringF
ovY;
ccdInfoLabel = QString(q_("Dimensions: %1")).arg(fovDimensio
ns);
QString name = ccd->name(); QString name = ccd->name();
if (name.isEmpty()) if (name.isEmpty())
{ {
ccdSensorLabel = QString(q_("Sensor #%1")).arg(selec tedCCDIndex); ccdSensorLabel = QString(q_("Sensor #%1")).arg(selec tedCCDIndex);
} }
else else
{ {
ccdSensorLabel = QString(q_("Sensor #%1: %2")) ccdSensorLabel = QString(q_("Sensor #%1: %2"))
.arg(selectedCCDIndex) .arg(selectedCCDIndex)
skipping to change at line 1620 skipping to change at line 1617
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
StelMovementMgr *movementManager = core->getMovementMgr(); StelMovementMgr *movementManager = core->getMovementMgr();
GridLinesMgr *gridManager = (GridLinesMgr *)StelApp::getInstance().g etModuleMgr().getModule("GridLinesMgr"); GridLinesMgr *gridManager = (GridLinesMgr *)StelApp::getInstance().g etModuleMgr().getModule("GridLinesMgr");
gridManager->setFlagAzimuthalGrid(flagAzimuthalGrid); gridManager->setFlagAzimuthalGrid(flagAzimuthalGrid);
gridManager->setFlagGalacticGrid(flagGalacticGrid); gridManager->setFlagGalacticGrid(flagGalacticGrid);
gridManager->setFlagEquatorGrid(flagEquatorGrid); gridManager->setFlagEquatorGrid(flagEquatorGrid);
gridManager->setFlagEquatorJ2000Grid(flagEquatorJ2000Grid); gridManager->setFlagEquatorJ2000Grid(flagEquatorJ2000Grid);
gridManager->setFlagEquatorLine(flagEquatorLine); gridManager->setFlagEquatorLine(flagEquatorLine);
gridManager->setFlagEclipticLine(flagEclipticLine); gridManager->setFlagEclipticLine(flagEclipticLine);
gridManager->setFlagEclipticJ2000Grid(flagEclipticJ2000Grid);
gridManager->setFlagMeridianLine(flagMeridianLine); gridManager->setFlagMeridianLine(flagMeridianLine);
gridManager->setFlagHorizonLine(flagHorizonLine); gridManager->setFlagHorizonLine(flagHorizonLine);
gridManager->setFlagGalacticPlaneLine(flagGalacticPlaneLine); gridManager->setFlagGalacticPlaneLine(flagGalacticPlaneLine);
movementManager->setFlagTracking(false); movementManager->setFlagTracking(false);
movementManager->setFlagEnableZoomKeys(true); movementManager->setFlagEnableZoomKeys(true);
movementManager->setFlagEnableMouseNavigation(true); movementManager->setFlagEnableMouseNavigation(true);
// Set the screen display // Set the screen display
// core->setMaskType(StelProjector::MaskNone); // core->setMaskType(StelProjector::MaskNone);
core->setFlipHorz(false); core->setFlipHorz(false);
skipping to change at line 1652 skipping to change at line 1650
if (flagShowOculars) { if (flagShowOculars) {
if (!zoomedIn) { if (!zoomedIn) {
GridLinesMgr *gridManager = (GridLinesMgr *)StelApp: :getInstance().getModuleMgr().getModule("GridLinesMgr"); GridLinesMgr *gridManager = (GridLinesMgr *)StelApp: :getInstance().getModuleMgr().getModule("GridLinesMgr");
// Current state // Current state
flagAzimuthalGrid = gridManager->getFlagAzimuthalGri d(); flagAzimuthalGrid = gridManager->getFlagAzimuthalGri d();
flagGalacticGrid = gridManager->getFlagGalacticGrid( ); flagGalacticGrid = gridManager->getFlagGalacticGrid( );
flagEquatorGrid = gridManager->getFlagEquatorGrid(); flagEquatorGrid = gridManager->getFlagEquatorGrid();
flagEquatorJ2000Grid = gridManager->getFlagEquatorJ2 000Grid(); flagEquatorJ2000Grid = gridManager->getFlagEquatorJ2 000Grid();
flagEquatorLine = gridManager->getFlagEquatorLine(); flagEquatorLine = gridManager->getFlagEquatorLine();
flagEclipticLine = gridManager->getFlagEclipticLine( ); flagEclipticLine = gridManager->getFlagEclipticLine( );
flagEclipticJ2000Grid = gridManager->getFlagEcliptic J2000Grid();
flagMeridianLine = gridManager->getFlagMeridianLine( ); flagMeridianLine = gridManager->getFlagMeridianLine( );
flagHorizonLine = gridManager->getFlagHorizonLine(); flagHorizonLine = gridManager->getFlagHorizonLine();
flagGalacticPlaneLine = gridManager->getFlagGalactic PlaneLine(); flagGalacticPlaneLine = gridManager->getFlagGalactic PlaneLine();
} }
// set new state // set new state
zoomOcular(); zoomOcular();
} else { } else {
//reset to original state //reset to original state
unzoomOcular(); unzoomOcular();
skipping to change at line 1678 skipping to change at line 1677
StelMovementMgr *movementManager = core->getMovementMgr(); StelMovementMgr *movementManager = core->getMovementMgr();
GridLinesMgr *gridManager = GridLinesMgr *gridManager =
(GridLinesMgr *)StelApp::getInstance().getModuleMgr().getMod ule("GridLinesMgr"); (GridLinesMgr *)StelApp::getInstance().getModuleMgr().getMod ule("GridLinesMgr");
gridManager->setFlagAzimuthalGrid(false); gridManager->setFlagAzimuthalGrid(false);
gridManager->setFlagGalacticGrid(false); gridManager->setFlagGalacticGrid(false);
gridManager->setFlagEquatorGrid(false); gridManager->setFlagEquatorGrid(false);
gridManager->setFlagEquatorJ2000Grid(false); gridManager->setFlagEquatorJ2000Grid(false);
gridManager->setFlagEquatorLine(false); gridManager->setFlagEquatorLine(false);
gridManager->setFlagEclipticLine(false); gridManager->setFlagEclipticLine(false);
gridManager->setFlagEclipticJ2000Grid(false);
gridManager->setFlagMeridianLine(false); gridManager->setFlagMeridianLine(false);
gridManager->setFlagHorizonLine(false); gridManager->setFlagHorizonLine(false);
gridManager->setFlagGalacticPlaneLine(false); gridManager->setFlagGalacticPlaneLine(false);
movementManager->setFlagTracking(true); movementManager->setFlagTracking(true);
movementManager->setFlagEnableZoomKeys(false); movementManager->setFlagEnableZoomKeys(false);
movementManager->setFlagEnableMouseNavigation(false); movementManager->setFlagEnableMouseNavigation(false);
// We won't always have a selected object // We won't always have a selected object
if (StelApp::getInstance().getStelObjectMgr().getWasSelected()) { if (StelApp::getInstance().getStelObjectMgr().getWasSelected()) {
skipping to change at line 1758 skipping to change at line 1758
if (index == selectedTelescopeIndex) if (index == selectedTelescopeIndex)
{ {
action->setCheckable(true); action->setCheckable(true);
action->setChecked(true); action->setChecked(true);
} }
telescopesSignalMapper->setMapping(action, QString("%1").arg (index)); telescopesSignalMapper->setMapping(action, QString("%1").arg (index));
} }
return submenu; return submenu;
} }
void Oculars::setFlagDecimalDegrees(const bool b)
{
flagDecimalDegrees = b;
settings->setValue("use_decimal_degrees", b);
settings->sync();
}
bool Oculars::getFlagDecimalDegrees() const
{
return flagDecimalDegrees;
}
QString Oculars::getDimensionsString(double fovX, double fovY) const
{
QString stringFovX, stringFovY;
if (getFlagDecimalDegrees())
{
if (fovX >= 1.0)
{
int degrees = (int)fovX;
int minutes = (int)((fovX - degrees) * 60);
stringFovX = QString::number(degrees) + QChar(0x00B0
) + QString::number(minutes) + QChar(0x2032);
}
else
{
int minutes = (int)(fovX * 60);
stringFovX = QString::number(minutes) + QChar(0x2032
);
}
if (fovY >= 1.0)
{
int degrees = (int)fovY;
int minutes = (int)((fovY - degrees) * 60);
stringFovY = QString::number(degrees) + QChar(0x00B0
) + QString::number(minutes) + QChar(0x2032);
}
else
{
int minutes = (int)(fovY * 60);
stringFovY = QString::number(minutes) + QChar(0x2032
);
}
}
else
{
stringFovX = QString::number(fovX) + QChar(0x00B0);
stringFovY = QString::number(fovY) + QChar(0x00B0);
}
return stringFovX + QChar(0x00D7) + stringFovY;
}
 End of changes. 7 change blocks. 
9 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/