Oculars.cpp   Oculars.cpp 
skipping to change at line 52 skipping to change at line 52
#include <QAction> #include <QAction>
#include <QGraphicsWidget> #include <QGraphicsWidget>
#include <QKeyEvent> #include <QKeyEvent>
#include <QDebug> #include <QDebug>
#include <QMenu> #include <QMenu>
#include <QMouseEvent> #include <QMouseEvent>
#include <QtNetwork> #include <QtNetwork>
#include <QPixmap> #include <QPixmap>
#include <QSignalMapper> #include <QSignalMapper>
#include <QDir>
#include <cmath> #include <cmath>
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
extern void qt_set_sequence_auto_mnemonic(bool b); extern void qt_set_sequence_auto_mnemonic(bool b);
#endif #endif
static QSettings *settings; //!< The settings as read in from the ini file. static QSettings *settings; //!< The settings as read in from the ini file.
/* ********************************************************************* */ /* ********************************************************************* */
skipping to change at line 82 skipping to change at line 83
} }
StelPluginInfo OcularsStelPluginInterface::getPluginInfo() const StelPluginInfo OcularsStelPluginInterface::getPluginInfo() const
{ {
// Allow to load the resources when used as a static plugin // Allow to load the resources when used as a static plugin
Q_INIT_RESOURCE(Oculars); Q_INIT_RESOURCE(Oculars);
StelPluginInfo info; StelPluginInfo info;
info.id = "Oculars"; info.id = "Oculars";
info.displayedName = N_("Oculars"); info.displayedName = N_("Oculars");
info.authors = "Timothy Reaves, Bogdan Marinov"; info.authors = "Timothy Reaves, Bogdan Marinov, Pawel Stolowski";
info.contact = "treaves@silverfieldstech.com"; info.contact = "treaves@silverfieldstech.com";
info.description = N_("Shows the sky as if looking through a telesco pe eyepiece. (Only magnification and field of view are simulated.) It can a lso show a sensor frame and a Telrad sight."); info.description = N_("Shows the sky as if looking through a telesco pe eyepiece. (Only magnification and field of view are simulated.) It can a lso show a sensor frame and a Telrad sight.");
return info; return info;
} }
Q_EXPORT_PLUGIN2(Oculars, OcularsStelPluginInterface) Q_EXPORT_PLUGIN2(Oculars, OcularsStelPluginInterface)
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
skipping to change at line 611 skipping to change at line 612
void Oculars::setScaleImageCircle(bool state) void Oculars::setScaleImageCircle(bool state)
{ {
if (state) { if (state) {
determineMaxEyepieceAngle(); determineMaxEyepieceAngle();
} }
useMaxEyepieceAngle = state; useMaxEyepieceAngle = state;
} }
void Oculars::setScreenFOVForCCD() void Oculars::setScreenFOVForCCD()
{ {
Lens *lens = selectedLensIndex >=0 ? lense[selectedLensIndex] : NUL L;
if (selectedCCDIndex > -1 && selectedTelescopeIndex > -1) { if (selectedCCDIndex > -1 && selectedTelescopeIndex > -1) {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
StelMovementMgr *movementManager = core->getMovementMgr(); StelMovementMgr *movementManager = core->getMovementMgr();
double actualFOVx = ccds[selectedCCDIndex]->getActualFOVx(te double actualFOVx = ccds[selectedCCDIndex]->getActualFOVx(te
lescopes[selectedTelescopeIndex]); lescopes[selectedTelescopeIndex], lens);
double actualFOVy = ccds[selectedCCDIndex]->getActualFOVy(te double actualFOVy = ccds[selectedCCDIndex]->getActualFOVy(te
lescopes[selectedTelescopeIndex]); lescopes[selectedTelescopeIndex], lens);
if (actualFOVx < actualFOVy) { if (actualFOVx < actualFOVy) {
actualFOVx = actualFOVy; actualFOVx = actualFOVy;
} }
movementManager->setFlagTracking(true); movementManager->setFlagTracking(true);
movementManager->zoomTo(actualFOVx * 3.0, 0.0); movementManager->zoomTo(actualFOVx * 3.0, 0.0);
} }
} }
void Oculars::enableGuiPanel(bool enable) void Oculars::enableGuiPanel(bool enable)
{ {
skipping to change at line 857 skipping to change at line 859
{ {
selectedTelescopeIndex--; selectedTelescopeIndex--;
if (selectedTelescopeIndex == -1) { if (selectedTelescopeIndex == -1) {
selectedTelescopeIndex = telescopes.count() - 1; selectedTelescopeIndex = telescopes.count() - 1;
} }
emit(selectedTelescopeChanged()); emit(selectedTelescopeChanged());
} }
void Oculars::decrementLensIndex() void Oculars::decrementLensIndex()
{ {
selectedLensIndex++; selectedLensIndex--;
if (selectedLensIndex == lense.count()) { if (selectedLensIndex == lense.count()) {
selectedLensIndex = -1; selectedLensIndex = -1;
} }
if (selectedLensIndex == -2) {
selectedLensIndex = lense.count() - 1;
}
emit(selectedLensChanged()); emit(selectedLensChanged());
} }
void Oculars::displayPopupMenu() void Oculars::displayPopupMenu()
{ {
QMenu* popup = new QMenu(&StelMainWindow::getInstance()); QMenu* popup = new QMenu(&StelMainWindow::getInstance());
if (flagShowOculars) if (flagShowOculars)
{ {
// We are in Oculars mode // We are in Oculars mode
skipping to change at line 1025 skipping to change at line 1030
ccdRotationSignalMapper->setMapping(rotateAction, QS tring("90")); ccdRotationSignalMapper->setMapping(rotateAction, QS tring("90"));
rotateAction = submenu->addAction(q_("&Reset rotatio n"), this, SLOT(ccdRotationReset())); rotateAction = submenu->addAction(q_("&Reset rotatio n"), this, SLOT(ccdRotationReset()));
popup->addMenu(submenu); popup->addMenu(submenu);
popup->addSeparator(); popup->addSeparator();
} }
if (flagShowCCD && selectedCCDIndex > -1 && telescopes.count () > 1) if (flagShowCCD && selectedCCDIndex > -1 && telescopes.count () > 1)
{ {
QMenu* submenu = addTelescopeSubmenu(popup); QMenu* submenu = addTelescopeSubmenu(popup);
popup->addMenu(submenu); popup->addMenu(submenu);
submenu = addLensSubmenu(popup);
popup->addMenu(submenu);
popup->addSeparator(); popup->addSeparator();
} }
} }
popup->exec(QCursor::pos()); popup->exec(QCursor::pos());
delete popup; delete popup;
} }
void Oculars::incrementCCDIndex() void Oculars::incrementCCDIndex()
{ {
skipping to change at line 1269 skipping to change at line 1276
//the first time this action is checked. See: //the first time this action is checked. See:
//http://doc.qt.nokia.com/4.7/signalsandslots.html#signals //http://doc.qt.nokia.com/4.7/signalsandslots.html#signals
actionShowOcular = shMgr->getGuiAction("actionShow_Ocular"); actionShowOcular = shMgr->getGuiAction("actionShow_Ocular");
actionShowOcular->setChecked(flagShowOculars); actionShowOcular->setChecked(flagShowOculars);
// Make a toolbar button // Make a toolbar button
try { try {
pxmapGlow = new QPixmap(":/graphicGui/glow32x32.png"); pxmapGlow = new QPixmap(":/graphicGui/glow32x32.png");
pxmapOnIcon = new QPixmap(":/ocular/bt_ocular_on.png"); pxmapOnIcon = new QPixmap(":/ocular/bt_ocular_on.png");
pxmapOffIcon = new QPixmap(":/ocular/bt_ocular_off.png"); pxmapOffIcon = new QPixmap(":/ocular/bt_ocular_off.png");
toolbarButton = new StelButton(NULL, toolbarButton = new StelButton(NULL,
*pxmapOnIcon,
*pxmapOnIcon, *pxmapOffIcon,
*pxmapGlow,
*pxmapOffIcon, actionShowOcular);
*pxmapGlow,
actionShowOcul
ar);
gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGr oup"); gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGr oup");
} catch (std::runtime_error& e) { } catch (std::runtime_error& e) {
qWarning() << "WARNING: unable create toolbar button for Ocu lars plugin: " << e.what(); qWarning() << "WARNING: unable create toolbar button for Ocu lars plugin: " << e.what();
} }
connect(actionShowOcular, SIGNAL(toggled(bool)), connect(actionShowOcular, SIGNAL(toggled(bool)),
this, SLOT(enableOcular(bool))); this, SLOT(enableOcular(bool)));
actionMenu = shMgr->getGuiAction("actionShow_Ocular_Menu"); actionMenu = shMgr->getGuiAction("actionShow_Ocular_Menu");
connect(actionMenu, SIGNAL(toggled(bool)), connect(actionMenu, SIGNAL(toggled(bool)),
this, SLOT(displayPopupMenu())); this, SLOT(displayPopupMenu()));
skipping to change at line 1302 skipping to change at line 1309
actionShowTelrad = shMgr->getGuiAction("actionShow_Telrad"); actionShowTelrad = shMgr->getGuiAction("actionShow_Telrad");
connect(actionShowTelrad, SIGNAL(toggled(bool)), connect(actionShowTelrad, SIGNAL(toggled(bool)),
this, SLOT(toggleTelrad(bool))); this, SLOT(toggleTelrad(bool)));
actionConfiguration = shMgr->getGuiAction("actionOpen_Oculars_Config uration"); actionConfiguration = shMgr->getGuiAction("actionOpen_Oculars_Config uration");
connect(actionConfiguration, SIGNAL(toggled(bool)), connect(actionConfiguration, SIGNAL(toggled(bool)),
ocularDialog, SLOT(setVisible(bool)) ); ocularDialog, SLOT(setVisible(bool)) );
connect(ocularDialog, SIGNAL(visibleChanged(bool)), connect(ocularDialog, SIGNAL(visibleChanged(bool)),
actionConfiguration, SLOT(setChecked (bool))); actionConfiguration, SLOT(setChecked (bool)));
// Select next telescope via keyboard
actionTelescopeIncrement = shMgr->getGuiAction("actionShow_Telescope
_Increment");
connect(actionTelescopeIncrement, SIGNAL(toggled(bool)), this, SLOT(
incrementTelescopeIndex()));
// Select previous telescope via keyboard
actionTelescopeDecrement = shMgr->getGuiAction("actionShow_Telescope
_Decrement");
connect(actionTelescopeDecrement, SIGNAL(toggled(bool)), this, SLOT(
decrementTelescopeIndex()));
// Select next eyepiece via keyboard
actionOcularIncrement = shMgr->getGuiAction("actionShow_Ocular_Incre
ment");
connect(actionOcularIncrement, SIGNAL(toggled(bool)), this, SLOT(inc
rementOcularIndex()));
// Select previous eyepiece via keyboard
actionOcularDecrement = shMgr->getGuiAction("actionShow_Ocular_Decre
ment");
connect(actionOcularDecrement, SIGNAL(toggled(bool)), this, SLOT(dec
rementOcularIndex()));
connect(this, SIGNAL(selectedCCDChanged()), this, SLOT(instrumentCha nged())); connect(this, SIGNAL(selectedCCDChanged()), this, SLOT(instrumentCha nged()));
connect(this, SIGNAL(selectedCCDChanged()), this, SLOT(setScreenFOVF orCCD())); connect(this, SIGNAL(selectedCCDChanged()), this, SLOT(setScreenFOVF orCCD()));
connect(this, SIGNAL(selectedOcularChanged()), this, SLOT(instrument Changed())); connect(this, SIGNAL(selectedOcularChanged()), this, SLOT(instrument Changed()));
connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(instrum entChanged())); connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(instrum entChanged()));
connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(setScre enFOVForCCD())); connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(setScre enFOVForCCD()));
connect(this, SIGNAL(selectedLensChanged()), this, SLOT(instrumentCh anged())); connect(this, SIGNAL(selectedLensChanged()), this, SLOT(instrumentCh anged()));
connect(ocularDialog, SIGNAL(requireSelectionChanged(bool)), this, S LOT(setRequireSelection(bool))); connect(ocularDialog, SIGNAL(requireSelectionChanged(bool)), this, S LOT(setRequireSelection(bool)));
connect(ocularDialog, SIGNAL(scaleImageCircleChanged(bool)), this, S LOT(setScaleImageCircle(bool))); connect(ocularDialog, SIGNAL(scaleImageCircleChanged(bool)), this, S LOT(setScaleImageCircle(bool)));
connect(ccdRotationSignalMapper, SIGNAL(mapped(QString)), this, SLOT (rotateCCD(QString))); connect(ccdRotationSignalMapper, SIGNAL(mapped(QString)), this, SLOT (rotateCCD(QString)));
skipping to change at line 1336 skipping to change at line 1359
break; break;
} }
} }
return binocularFound; return binocularFound;
} }
void Oculars::paintCCDBounds(StelRenderer* renderer) void Oculars::paintCCDBounds(StelRenderer* renderer)
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
StelProjector::StelProjectorParams params = core->getCurrentStelProj ectorParams(); StelProjector::StelProjectorParams params = core->getCurrentStelProj ectorParams();
Lens *lens = selectedLensIndex >=0 ? lense[selectedLensIndex] : NUL L;
renderer->setBlendMode(BlendMode_None); renderer->setBlendMode(BlendMode_None);
StelVertexBuffer<VertexP2>* vertices = StelVertexBuffer<VertexP2>* vertices =
renderer->createVertexBuffer<VertexP2>(PrimitiveType_LineStr ip); renderer->createVertexBuffer<VertexP2>(PrimitiveType_LineStr ip);
double screenFOV = params.fov; double screenFOV = params.fov;
const Vec2f offset = Vec2f(params.viewportCenter[0], params.viewport Center[1]); const Vec2f offset = Vec2f(params.viewportCenter[0], params.viewport Center[1]);
// draw sensor rectangle // draw sensor rectangle
if(selectedCCDIndex != -1) { if(selectedCCDIndex != -1) {
CCD *ccd = ccds[selectedCCDIndex]; CCD *ccd = ccds[selectedCCDIndex];
if (ccd) { if (ccd) {
renderer->setGlobalColor(0.77f, 0.14f, 0.16f, 0.5f); renderer->setGlobalColor(0.77f, 0.14f, 0.16f, 0.5f);
Telescope *telescope = telescopes[selectedTelescopeI ndex]; Telescope *telescope = telescopes[selectedTelescopeI ndex];
const double ccdXRatio = ccd->getActualFOVx(telescop const double ccdXRatio = ccd->getActualFOVx(telescop
e) / screenFOV; e, lens) / screenFOV;
const double ccdYRatio = ccd->getActualFOVy(telescop const double ccdYRatio = ccd->getActualFOVy(telescop
e) / screenFOV; e, lens) / screenFOV;
// As the FOV is based on the narrow aspect of the s creen, we need to calculate // As the FOV is based on the narrow aspect of the s creen, we need to calculate
// height & width based soley off of that dimension. // height & width based soley off of that dimension.
int aspectIndex = 2; int aspectIndex = 2;
if (params.viewportXywh[2] > params.viewportXywh[3]) { if (params.viewportXywh[2] > params.viewportXywh[3]) {
aspectIndex = 3; aspectIndex = 3;
} }
const float halfWidth = 0.5f * (params.viewportXywh [aspectIndex] * ccdYRatio); const float halfWidth = 0.5f * (params.viewportXywh [aspectIndex] * ccdYRatio);
const float halfHeight = 0.5f * (params.viewportXywh [aspectIndex] * ccdXRatio); const float halfHeight = 0.5f * (params.viewportXywh [aspectIndex] * ccdXRatio);
if (halfWidth > 0.0 && halfHeight > 0.0) if (halfWidth > 0.0 && halfHeight > 0.0)
skipping to change at line 1564 skipping to change at line 1588
{ {
lensNumberLabel = QString(q_("Lens # %1")).arg(selectedLensIndex); lensNumberLabel = QString(q_("Lens # %1")).arg(selectedLensIndex);
} }
else else
{ {
lensNumberLabel = QString (q_("Lens #%1: %2")).arg(selectedLensIndex).arg(lensName); lensNumberLabel = QString (q_("Lens #%1: %2")).arg(selectedLensIndex).arg(lensName);
} }
} }
else else
{ {
lensNumberLabel = QString (q_("Lens: none")) ; //FIXME lensNumberLabel = QString (q_("Lens: none")) ;
} }
renderer->drawText(TextParams(xPosition, yPosition, lensNumberLabel)); renderer->drawText(TextParams(xPosition, yPosition, lensNumberLabel));
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"))
skipping to change at line 1606 skipping to change at line 1630
QString fovString = QString::number(fov); QString fovString = QString::number(fov);
fovString.append(QChar(0x00B0));//Degree sign fovString.append(QChar(0x00B0));//Degree sign
QString fovLabel = QString(q_("FOV: %1")).arg(fovStr ing); QString fovLabel = QString(q_("FOV: %1")).arg(fovStr ing);
renderer->drawText(TextParams(xPosition, yPosition, fovLabel)); renderer->drawText(TextParams(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) double fovX = ((int)(ccd->getActualFOVx(telescope, lens) * 1
) / 1000.0; 000.0)) / 1000.0;
double fovY = ((int)(ccd->getActualFOVy(telescope) * 1000.0) double fovY = ((int)(ccd->getActualFOVy(telescope, lens) * 1
) / 1000.0; 000.0)) / 1000.0;
ccdInfoLabel = QString(q_("Dimensions: %1")).arg(getDimensio nsString(fovX, fovY)); ccdInfoLabel = QString(q_("Dimensions: %1")).arg(getDimensio nsString(fovX, fovY));
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"))
skipping to change at line 1659 skipping to change at line 1683
StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directo ry|StelFileMgr::Writable); StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directo ry|StelFileMgr::Writable);
QString ocularIniPath = StelFileMgr::findFile("modules/Oculars/", fl ags) + "ocular.ini"; QString ocularIniPath = StelFileMgr::findFile("modules/Oculars/", fl ags) + "ocular.ini";
// If the ini file does not already exist, create it from the resour ce in the QT resource // If the ini file does not already exist, create it from the resour ce in the QT resource
if(!QFileInfo(ocularIniPath).exists()) { if(!QFileInfo(ocularIniPath).exists()) {
QFile src(":/ocular/default_ocular.ini"); QFile src(":/ocular/default_ocular.ini");
if (!src.copy(ocularIniPath)) { if (!src.copy(ocularIniPath)) {
qWarning() << "Oculars::validateIniFile cannot copy default_ocular.ini resource to [non-existing] " qWarning() << "Oculars::validateIniFile cannot copy default_ocular.ini resource to [non-existing] "
+ ocularIniPath; + ocularIniPath;
} else { } else {
qDebug() << "Oculars::validateIniFile copied default _ocular.ini to " << ocularIniPath; qDebug() << "Oculars::validateIniFile copied default _ocular.ini to " << QDir::toNativeSeparators(ocularIniPath);
// The resource is read only, and the new file inher its this, so set write-able. // The resource is read only, and the new file inher its this, so set write-able.
QFile dest(ocularIniPath); QFile dest(ocularIniPath);
dest.setPermissions(dest.permissions() | QFile::Writ eOwner); dest.setPermissions(dest.permissions() | QFile::Writ eOwner);
} }
} else { } else {
qDebug() << "Oculars::validateIniFile ocular.ini exists at: " << ocularIniPath << ". Checking version..."; qDebug() << "Oculars::validateIniFile ocular.ini exists at: " << QDir::toNativeSeparators(ocularIniPath) << ". Checking version...";
QSettings settings(ocularIniPath, QSettings::IniFormat); QSettings settings(ocularIniPath, QSettings::IniFormat);
double ocularsVersion = settings.value("oculars_version", "0 .0").toDouble(); double ocularsVersion = settings.value("oculars_version", "0 .0").toDouble();
qWarning() << "Oculars::validateIniFile found existing ini f ile version " << ocularsVersion; qWarning() << "Oculars::validateIniFile found existing ini f ile version " << ocularsVersion;
if (ocularsVersion < MIN_OCULARS_INI_VERSION) { if (ocularsVersion < MIN_OCULARS_INI_VERSION) {
qWarning() << "Oculars::validateIniFile existing ini file version " << ocularsVersion qWarning() << "Oculars::validateIniFile existing ini file version " << ocularsVersion
<< " too ol d to use; required version is " << MIN_OCULARS_INI_VERSION << ". Copying ov er new one."; << " too ol d to use; required version is " << MIN_OCULARS_INI_VERSION << ". Copying ov er new one.";
// delete last "old" file, if it exists // delete last "old" file, if it exists
QFile deleteFile(ocularIniPath + ".old"); QFile deleteFile(ocularIniPath + ".old");
deleteFile.remove(); deleteFile.remove();
// Rename the old one, and copy over a new one // Rename the old one, and copy over a new one
QFile oldFile(ocularIniPath); QFile oldFile(ocularIniPath);
if (!oldFile.rename(ocularIniPath + ".old")) { if (!oldFile.rename(ocularIniPath + ".old")) {
qWarning() << "Oculars::validateIniFile cann ot move ocular.ini resource to ocular.ini.old at path " + ocularIniPath; qWarning() << "Oculars::validateIniFile cann ot move ocular.ini resource to ocular.ini.old at path " + QDir::toNativeSe parators(ocularIniPath);
} else { } else {
qWarning() << "Oculars::validateIniFile ocul ar.ini resource renamed to ocular.ini.old at path " + ocularIniPath; qWarning() << "Oculars::validateIniFile ocul ar.ini resource renamed to ocular.ini.old at path " + QDir::toNativeSepara tors(ocularIniPath);
QFile src(":/ocular/default_ocular.ini"); QFile src(":/ocular/default_ocular.ini");
if (!src.copy(ocularIniPath)) { if (!src.copy(ocularIniPath)) {
qWarning() << "Oculars::validateIniF ile cannot copy default_ocular.ini resource to [non-existing] " + ocularIni Path; qWarning() << "Oculars::validateIniF ile cannot copy default_ocular.ini resource to [non-existing] " + QDir::toN ativeSeparators(ocularIniPath);
} else { } else {
qDebug() << "Oculars::validateIniFil e copied default_ocular.ini to " << ocularIniPath; qDebug() << "Oculars::validateIniFil e copied default_ocular.ini to " << QDir::toNativeSeparators(ocularIniPath) ;
// The resource is read only, and th e new file inherits this... make sure the new file // The resource is read only, and th e new file inherits this... make sure the new file
// is writable by the Stellarium pro cess so that updates can be done. // is writable by the Stellarium pro cess so that updates can be done.
QFile dest(ocularIniPath); QFile dest(ocularIniPath);
dest.setPermissions(dest.permissions () | QFile::WriteOwner); dest.setPermissions(dest.permissions () | QFile::WriteOwner);
} }
} }
} }
} }
settings = new QSettings(ocularIniPath, QSettings::IniFormat, this); settings = new QSettings(ocularIniPath, QSettings::IniFormat, this);
} }
skipping to change at line 1715 skipping to change at line 1739
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->setFlagEclipticJ2000Grid(flagEclipticJ2000Grid);
gridManager->setFlagMeridianLine(flagMeridianLine); gridManager->setFlagMeridianLine(flagMeridianLine);
gridManager->setFlagHorizonLine(flagHorizonLine); gridManager->setFlagHorizonLine(flagHorizonLine);
gridManager->setFlagGalacticPlaneLine(flagGalacticPlaneLine); gridManager->setFlagGalacticPlaneLine(flagGalacticPlaneLine);
core->getSkyDrawer()->setFlagLuminanceAdaptation(flagAdaptation);
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);
core->setFlipVert(false); core->setFlipVert(false);
movementManager->zoomTo(movementManager->getInitFov()); movementManager->zoomTo(movementManager->getInitFov());
skipping to change at line 1748 skipping to change at line 1773
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(); flagEclipticJ2000Grid = gridManager->getFlagEcliptic J2000Grid();
flagMeridianLine = gridManager->getFlagMeridianLine( ); flagMeridianLine = gridManager->getFlagMeridianLine( );
flagHorizonLine = gridManager->getFlagHorizonLine(); flagHorizonLine = gridManager->getFlagHorizonLine();
flagGalacticPlaneLine = gridManager->getFlagGalactic PlaneLine(); flagGalacticPlaneLine = gridManager->getFlagGalactic PlaneLine();
flagAdaptation = StelApp::getInstance().getCore()->g etSkyDrawer()->getFlagLuminanceAdaptation();
} }
// 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 1775 skipping to change at line 1801
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->setFlagEclipticJ2000Grid(false);
gridManager->setFlagMeridianLine(false); gridManager->setFlagMeridianLine(false);
gridManager->setFlagHorizonLine(false); gridManager->setFlagHorizonLine(false);
gridManager->setFlagGalacticPlaneLine(false); gridManager->setFlagGalacticPlaneLine(false);
core->getSkyDrawer()->setFlagLuminanceAdaptation(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()) {
StelObjectP selectedObject = StelApp::getInstance().getStelO bjectMgr().getSelectedObject()[0]; StelObjectP selectedObject = StelApp::getInstance().getStelO bjectMgr().getSelectedObject()[0];
movementManager->moveToJ2000(selectedObject->getEquinoxEquat orialPos(core), 0.0, 1); movementManager->moveToJ2000(selectedObject->getEquinoxEquat orialPos(core), 0.0, 1);
} }
 End of changes. 22 change blocks. 
30 lines changed or deleted 60 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/