ViewDialog.cpp   ViewDialog.cpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2008 Fabien Chereau * Copyright (C) 2008 Fabien Chereau
* Copyright (C) 2012 Timothy Reaves
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "ViewDialog.hpp" #include "ViewDialog.hpp"
#include "ui_viewDialog.h" #include "ui_viewDialog.h"
#include "AddRemoveLandscapesDialog.hpp" #include "AddRemoveLandscapesDialog.hpp"
#include "AtmosphereDialog.hpp" #include "AtmosphereDialog.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelSkyCultureMgr.hpp" #include "StelSkyCultureMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
skipping to change at line 47 skipping to change at line 48
#include "GridLinesMgr.hpp" #include "GridLinesMgr.hpp"
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include "StelSkyLayerMgr.hpp" #include "StelSkyLayerMgr.hpp"
#include "StelGuiBase.hpp" #include "StelGuiBase.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include <QDebug> #include <QDebug>
#include <QFrame> #include <QFrame>
#include <QFile> #include <QFile>
#include <QFileInfo>
#include <QSettings> #include <QSettings>
#include <QTimer> #include <QTimer>
#include <QDialog> #include <QDialog>
ViewDialog::ViewDialog() ViewDialog::ViewDialog()
{ {
ui = new Ui_viewDialogForm; ui = new Ui_viewDialogForm;
addRemoveLandscapesDialog = NULL; addRemoveLandscapesDialog = NULL;
atmosphereDialog=NULL; atmosphereDialog=NULL;
} }
skipping to change at line 68 skipping to change at line 70
ViewDialog::~ViewDialog() ViewDialog::~ViewDialog()
{ {
delete ui; delete ui;
ui=NULL; ui=NULL;
delete addRemoveLandscapesDialog; delete addRemoveLandscapesDialog;
addRemoveLandscapesDialog = NULL; addRemoveLandscapesDialog = NULL;
delete atmosphereDialog; delete atmosphereDialog;
atmosphereDialog = NULL; atmosphereDialog = NULL;
} }
void ViewDialog::languageChanged() void ViewDialog::retranslate()
{ {
if (dialog) if (dialog)
{ {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
shootingStarsZHRChanged(); setZhrFromControls();
populateLists(); populateLists();
//Hack to shrink the tabs to optimal size after language cha
nge
//by causing the list items to be laid out again.
ui->stackListWidget->setWrapping(false);
} }
} }
void ViewDialog::styleChanged() void ViewDialog::styleChanged()
{ {
if (dialog) if (dialog)
{ {
populateLists(); populateLists();
} }
} }
void ViewDialog::createDialogContent() void ViewDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(languageChanged())); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate()));
// Set the Sky tab activated by default // Set the Sky tab activated by default
ui->stackedWidget->setCurrentIndex(0); ui->stackedWidget->setCurrentIndex(0);
ui->stackListWidget->setCurrentRow(0); ui->stackListWidget->setCurrentRow(0);
//ui->viewTabWidget->removeTab(4); //ui->viewTabWidget->removeTab(4);
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
populateLists(); populateLists();
skipping to change at line 144 skipping to change at line 150
ui->planetOrbitCheckBox->setChecked(ssmgr->getFlagOrbits()); ui->planetOrbitCheckBox->setChecked(ssmgr->getFlagOrbits());
connect(ui->planetOrbitCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT( setFlagOrbits(bool))); connect(ui->planetOrbitCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT( setFlagOrbits(bool)));
ui->planetLightSpeedCheckBox->setChecked(ssmgr->getFlagLightTravelTi me()); ui->planetLightSpeedCheckBox->setChecked(ssmgr->getFlagLightTravelTi me());
connect(ui->planetLightSpeedCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT(setFlagLightTravelTime(bool))); connect(ui->planetLightSpeedCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT(setFlagLightTravelTime(bool)));
// Shooting stars section // Shooting stars section
MeteorMgr* mmgr = GETSTELMODULE(MeteorMgr); MeteorMgr* mmgr = GETSTELMODULE(MeteorMgr);
Q_ASSERT(mmgr); Q_ASSERT(mmgr);
switch(mmgr->getZHR()) updateZhrControls(mmgr->getZHR());
{ connect(mmgr, SIGNAL(zhrChanged(int)),
case 0: ui->zhrNone->setChecked(true); break; this, SLOT(updateZhrControls(int)));
case 80: ui->zhr80->setChecked(true); break; connect(ui->zhrNone, SIGNAL(clicked()), this, SLOT(setZhrFromControl
case 10000: ui->zhr10000->setChecked(true); break; s()));
case 144000: ui->zhr144000->setChecked(true); break; connect(ui->zhr10, SIGNAL(clicked()), this, SLOT(setZhrFromControls(
default: ui->zhr10->setChecked(true); break; )));
} connect(ui->zhr80, SIGNAL(clicked()), this, SLOT(setZhrFromControls(
shootingStarsZHRChanged(); )));
connect(ui->zhrNone, SIGNAL(clicked()), this, SLOT(shootingStarsZHRC connect(ui->zhr10000, SIGNAL(clicked()), this, SLOT(setZhrFromContro
hanged())); ls()));
connect(ui->zhr10, SIGNAL(clicked()), this, SLOT(shootingStarsZHRCha connect(ui->zhr144000, SIGNAL(clicked()), this, SLOT(setZhrFromContr
nged())); ols()));
connect(ui->zhr80, SIGNAL(clicked()), this, SLOT(shootingStarsZHRCha
nged()));
connect(ui->zhr10000, SIGNAL(clicked()), this, SLOT(shootingStarsZHR
Changed()));
connect(ui->zhr144000, SIGNAL(clicked()), this, SLOT(shootingStarsZH
RChanged()));
// Labels section // Labels section
StarMgr* smgr = GETSTELMODULE(StarMgr); StarMgr* smgr = GETSTELMODULE(StarMgr);
ui->starLabelCheckBox->setChecked(smgr->getFlagLabels()); ui->starLabelCheckBox->setChecked(smgr->getFlagLabels());
connect(ui->starLabelCheckBox, SIGNAL(toggled(bool)), smgr, SLOT(set FlagLabels(bool))); connect(ui->starLabelCheckBox, SIGNAL(toggled(bool)), smgr, SLOT(set FlagLabels(bool)));
StelGuiBase* gui = StelApp::getInstance().getGui(); StelGuiBase* gui = StelApp::getInstance().getGui();
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr); NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
ui->nebulaLabelCheckBox->setChecked(nmgr->getFlagHints()); ui->nebulaLabelCheckBox->setChecked(nmgr->getFlagHints());
a = gui->getGuiActions("actionShow_Nebulas"); a = gui->getGuiActions("actionShow_Nebulas");
skipping to change at line 248 skipping to change at line 248
ui->showHorizonLineCheckBox->setChecked(glmgr->getFlagHorizonLine()) ; ui->showHorizonLineCheckBox->setChecked(glmgr->getFlagHorizonLine()) ;
a = gui->getGuiActions("actionShow_Horizon_Line"); a = gui->getGuiActions("actionShow_Horizon_Line");
connect(a, SIGNAL(toggled(bool)), ui->showHorizonLineCheckBox, SLOT( setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showHorizonLineCheckBox, SLOT( setChecked(bool)));
connect(ui->showHorizonLineCheckBox, SIGNAL(toggled(bool)), a, SLOT( setChecked(bool))); connect(ui->showHorizonLineCheckBox, SIGNAL(toggled(bool)), a, SLOT( setChecked(bool)));
ui->showEquatorialGridCheckBox->setChecked(glmgr->getFlagEquatorGrid ()); ui->showEquatorialGridCheckBox->setChecked(glmgr->getFlagEquatorGrid ());
a = gui->getGuiActions("actionShow_Equatorial_Grid"); a = gui->getGuiActions("actionShow_Equatorial_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showEquatorialGridCheckBox, SL OT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showEquatorialGridCheckBox, SL OT(setChecked(bool)));
connect(ui->showEquatorialGridCheckBox, SIGNAL(toggled(bool)), a, SL OT(setChecked(bool))); connect(ui->showEquatorialGridCheckBox, SIGNAL(toggled(bool)), a, SL OT(setChecked(bool)));
ui->showGalacticGridCheckBox->setChecked(glmgr->getFlagGalacticGrid(
));
a = gui->getGuiActions("actionShow_Galactic_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showGalacticGridCheckBox, SLOT
(setChecked(bool)));
connect(ui->showGalacticGridCheckBox, SIGNAL(toggled(bool)), a, SLOT
(setChecked(bool)));
ui->showGalacticPlaneLineCheckBox->setChecked(glmgr->getFlagGalactic
PlaneLine());
a = gui->getGuiActions("actionShow_Galactic_Plane_Line");
connect(a, SIGNAL(toggled(bool)), ui->showGalacticPlaneLineCheckBox,
SLOT(setChecked(bool)));
connect(ui->showGalacticPlaneLineCheckBox, SIGNAL(toggled(bool)), a,
SLOT(setChecked(bool)));
ui->showAzimuthalGridCheckBox->setChecked(glmgr->getFlagAzimuthalGri d()); ui->showAzimuthalGridCheckBox->setChecked(glmgr->getFlagAzimuthalGri d());
a = gui->getGuiActions("actionShow_Azimuthal_Grid"); a = gui->getGuiActions("actionShow_Azimuthal_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showAzimuthalGridCheckBox, SLO T(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showAzimuthalGridCheckBox, SLO T(setChecked(bool)));
connect(ui->showAzimuthalGridCheckBox, SIGNAL(toggled(bool)), a, SLO T(setChecked(bool))); connect(ui->showAzimuthalGridCheckBox, SIGNAL(toggled(bool)), a, SLO T(setChecked(bool)));
ui->showEquatorialJ2000GridCheckBox->setChecked(glmgr->getFlagEquato rJ2000Grid()); ui->showEquatorialJ2000GridCheckBox->setChecked(glmgr->getFlagEquato rJ2000Grid());
a = gui->getGuiActions("actionShow_Equatorial_J2000_Grid"); a = gui->getGuiActions("actionShow_Equatorial_J2000_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showEquatorialJ2000GridCheckBo x, SLOT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showEquatorialJ2000GridCheckBo x, SLOT(setChecked(bool)));
connect(ui->showEquatorialJ2000GridCheckBox, SIGNAL(toggled(bool)), a, SLOT(setChecked(bool))); connect(ui->showEquatorialJ2000GridCheckBox, SIGNAL(toggled(bool)), a, SLOT(setChecked(bool)));
skipping to change at line 338 skipping to change at line 348
} }
l->setCurrentItem(l->findItems(core->projectionTypeKeyToNameI18n(cor e->getCurrentProjectionTypeKey()), Qt::MatchExactly).at(0)); l->setCurrentItem(l->findItems(core->projectionTypeKeyToNameI18n(cor e->getCurrentProjectionTypeKey()), Qt::MatchExactly).at(0));
l->blockSignals(false); l->blockSignals(false);
ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::Fra meJ2000)->getHtmlSummary()); ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::Fra meJ2000)->getHtmlSummary());
// Fill the landscape list // Fill the landscape list
l = ui->landscapesListWidget; l = ui->landscapesListWidget;
l->blockSignals(true); l->blockSignals(true);
l->clear(); l->clear();
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
l->addItems(lmgr->getAllLandscapeNames()); QStringList landscapeList = lmgr->getAllLandscapeNames();
l->setCurrentItem(l->findItems(lmgr->getCurrentLandscapeName(), Qt:: foreach (const QString landscapeId, landscapeList)
MatchExactly).at(0)); {
QString label = q_(landscapeId);
QListWidgetItem* item = new QListWidgetItem(label);
item->setData(Qt::UserRole, landscapeId);
l->addItem(item);
}
QString selectedLandscapeId = lmgr->getCurrentLandscapeName();
for (int i = 0; i < l->count(); i++)
{
if (l->item(i)->data(Qt::UserRole).toString() == selectedLan
dscapeId)
{
l->setCurrentRow(i);
break;
}
}
l->blockSignals(false); l->blockSignals(false);
ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescr iption()); ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescr iption());
ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getDefaultLandsc apeID()==lmgr->getCurrentLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getDefaultLandsc apeID()==lmgr->getCurrentLandscapeID());
ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getDefaultLandsc apeID()!=lmgr->getCurrentLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getDefaultLandsc apeID()!=lmgr->getCurrentLandscapeID());
} }
void ViewDialog::populateSkyLayersList() void ViewDialog::populateSkyLayersList()
{ {
ui->skyLayerListWidget->clear(); ui->skyLayerListWidget->clear();
StelSkyLayerMgr* skyLayerMgr = GETSTELMODULE(StelSkyLayerMgr); StelSkyLayerMgr* skyLayerMgr = GETSTELMODULE(StelSkyLayerMgr);
skipping to change at line 388 skipping to change at line 413
{ {
StelApp::getInstance().getSkyCultureMgr().setCurrentSkyCultureNameI1 8(cultureName); StelApp::getInstance().getSkyCultureMgr().setCurrentSkyCultureNameI1 8(cultureName);
updateSkyCultureText(); updateSkyCultureText();
const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu reID(); const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu reID();
ui->useAsDefaultSkyCultureCheckBox->setChecked(b); ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b); ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
} }
void ViewDialog::updateSkyCultureText() void ViewDialog::updateSkyCultureText()
{ {
StelApp& app = StelApp::getInstance();
QString skyCultureId = app.getSkyCultureMgr().getCurrentSkyCultureID
();
QString descPath; QString descPath;
try try
{ {
QString lang = StelApp::getInstance().getLocaleMgr().getApp QString lang = app.getLocaleMgr().getAppLanguage();
Language(); if (!QString("pt_BR zh_CN zh_HK zh_TW").contains(lang))
if (!QString("pt_BR zh_CN zh_HK zh_TW").contains(lang)) {
{ lang = lang.split("_").at(0);
lang = lang.split("_").at(0); }
} descPath = StelFileMgr::findFile("skycultures/" + skyCulture
descPath = StelFileMgr::findFile("skycultures/" + StelApp:: Id + "/description."+lang+".utf8");
getInstance().getSkyCultureMgr().getCurrentSkyCultureID() + "/description."
+lang+".utf8");
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
try try
{ {
descPath = StelFileMgr::findFile("skycultures/" + St elApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID() + "/descri ption.en.utf8"); descPath = StelFileMgr::findFile("skycultures/" + sk yCultureId + "/description.en.utf8");
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "WARNING: can't find description for s kyculture" << StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultur eID(); qWarning() << "WARNING: can't find description for s kyculture" << skyCultureId;
} }
} }
QStringList searchPaths; QStringList searchPaths;
try try
{ {
searchPaths << StelFileMgr::findFile("skycultures/" + StelAp p::getInstance().getSkyCultureMgr().getCurrentSkyCultureID()); searchPaths << StelFileMgr::findFile("skycultures/" + skyCul tureId);
} }
catch (std::runtime_error& e) {} catch (std::runtime_error& e) {}
ui->skyCultureTextBrowser->setSearchPaths(searchPaths); ui->skyCultureTextBrowser->setSearchPaths(searchPaths);
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(app.getGui());
Q_ASSERT(gui); Q_ASSERT(gui);
ui->skyCultureTextBrowser->document()->setDefaultStyleSheet(QString( gui->getStelStyle().htmlStyleSheet)); ui->skyCultureTextBrowser->document()->setDefaultStyleSheet(QString( gui->getStelStyle().htmlStyleSheet));
if (descPath.isEmpty()) if (descPath.isEmpty())
{ {
ui->skyCultureTextBrowser->setHtml(q_("No description")); ui->skyCultureTextBrowser->setHtml(q_("No description"));
} }
else else
{ {
QFile f(descPath); QFile f(descPath);
f.open(QIODevice::ReadOnly); f.open(QIODevice::ReadOnly);
ui->skyCultureTextBrowser->setHtml(QString::fromUtf8(f.readA QString htmlFile = QString::fromUtf8(f.readAll());
ll())); #if QT_VERSION == 0x040800
// Workaround for https://bugreports.qt-project.org/browse/Q
TBUG-24077
QString path = QFileInfo(f).path();
QString newtag = "<img src=\"" + path + "/\\1";
htmlFile.replace(QRegExp("<img src=\"(\\w)"), newtag);
#endif
ui->skyCultureTextBrowser->setHtml(htmlFile);
} }
} }
void ViewDialog::projectionChanged(const QString& projectionNameI18n) void ViewDialog::projectionChanged(const QString& projectionNameI18n)
{ {
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
core->setCurrentProjectionTypeKey(core->projectionNameI18nToTypeKey( projectionNameI18n)); core->setCurrentProjectionTypeKey(core->projectionNameI18nToTypeKey( projectionNameI18n));
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
ui->projectionTextBrowser->document()->setDefaultStyleSheet(QString( gui->getStelStyle().htmlStyleSheet)); ui->projectionTextBrowser->document()->setDefaultStyleSheet(QString( gui->getStelStyle().htmlStyleSheet));
ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::Fra meJ2000)->getHtmlSummary()); ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::Fra meJ2000)->getHtmlSummary());
} }
void ViewDialog::landscapeChanged(QListWidgetItem* item) void ViewDialog::landscapeChanged(QListWidgetItem* item)
{ {
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
lmgr->setCurrentLandscapeName(item->text()); lmgr->setCurrentLandscapeName(item->data(Qt::UserRole).toString());
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
ui->landscapeTextBrowser->document()->setDefaultStyleSheet(QString(g ui->getStelStyle().htmlStyleSheet)); ui->landscapeTextBrowser->document()->setDefaultStyleSheet(QString(g ui->getStelStyle().htmlStyleSheet));
ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescr iption()); ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescr iption());
ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getDefaultLandsc apeID()==lmgr->getCurrentLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getDefaultLandsc apeID()==lmgr->getCurrentLandscapeID());
ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getDefaultLandsc apeID()!=lmgr->getCurrentLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getDefaultLandsc apeID()!=lmgr->getCurrentLandscapeID());
//StelSkyDrawer *drawer=StelApp::getInstance().getSkyDrawer(); //StelSkyDrawer *drawer=StelApp::getInstance().getSkyDrawer();
// GZ: Reset values that might have changed. // GZ: Reset values that might have changed.
ui->showFogCheckBox->setChecked(lmgr->getFlagFog()); ui->showFogCheckBox->setChecked(lmgr->getFlagFog());
ui->lightPollutionSpinBox->setValue(StelApp::getInstance().getCore() ->getSkyDrawer()->getBortleScale()); ui->lightPollutionSpinBox->setValue(StelApp::getInstance().getCore() ->getSkyDrawer()->getBortleScale());
skipping to change at line 479 skipping to change at line 513
{ {
if(atmosphereDialog == NULL) if(atmosphereDialog == NULL)
atmosphereDialog = new AtmosphereDialog(); atmosphereDialog = new AtmosphereDialog();
//ui->temperatureDoubleSpinBox->setValue(StelApp::getInstance().get Core()->getSkyDrawer()->getAtmosphereTemperature()); //ui->temperatureDoubleSpinBox->setValue(StelApp::getInstance().get Core()->getSkyDrawer()->getAtmosphereTemperature());
//ui->extinctionDoubleSpinBox->setValue(StelApp::getInstance().getC ore()->getSkyDrawer()->getExtinctionCoefficient()); //ui->extinctionDoubleSpinBox->setValue(StelApp::getInstance().getC ore()->getSkyDrawer()->getExtinctionCoefficient());
//ui->pressureDoubleSpinBox->setValue(StelApp::getInstance().getCor e()->getSkyDrawer()->getAtmospherePressure()); //ui->pressureDoubleSpinBox->setValue(StelApp::getInstance().getCor e()->getSkyDrawer()->getAtmospherePressure());
atmosphereDialog->setVisible(true); atmosphereDialog->setVisible(true);
} }
void ViewDialog::shootingStarsZHRChanged() void ViewDialog::setZhrFromControls()
{ {
MeteorMgr* mmgr = GETSTELMODULE(MeteorMgr); MeteorMgr* mmgr = GETSTELMODULE(MeteorMgr);
int zhr=-1; int zhr=-1;
if (ui->zhrNone->isChecked()) if (ui->zhrNone->isChecked())
{ {
mmgr->setFlagShow(false); mmgr->setFlagShow(false);
zhr = 0; zhr = 0;
} }
else else
{ {
skipping to change at line 504 skipping to change at line 538
if (ui->zhr80->isChecked()) if (ui->zhr80->isChecked())
zhr = 80; zhr = 80;
if (ui->zhr10000->isChecked()) if (ui->zhr10000->isChecked())
zhr = 10000; zhr = 10000;
if (ui->zhr144000->isChecked()) if (ui->zhr144000->isChecked())
zhr = 144000; zhr = 144000;
if (zhr!=mmgr->getZHR()) if (zhr!=mmgr->getZHR())
{ {
mmgr->setZHR(zhr); mmgr->setZHR(zhr);
} }
updateZhrDescription(zhr);
}
void ViewDialog::updateZhrControls(int zhr)
{
// As the radio buttons are tied to the clicked() signal,
// it won't be triggered by setting the value programmatically.
switch(zhr)
{
case 0: ui->zhrNone->setChecked(true); break;
case 80: ui->zhr80->setChecked(true); break;
case 10000: ui->zhr10000->setChecked(true); break;
case 144000: ui->zhr144000->setChecked(true); break;
default: ui->zhr10->setChecked(true); break;
}
updateZhrDescription(zhr);
}
void ViewDialog::updateZhrDescription(int zhr)
{
switch (zhr) switch (zhr)
{ {
case 0: case 0:
ui->zhrLabel->setText("<small><i>"+q_("No shooting s tars")+"</i></small>"); ui->zhrLabel->setText("<small><i>"+q_("No shooting s tars")+"</i></small>");
break; break;
case 10: case 10:
ui->zhrLabel->setText("<small><i>"+q_("Normal rate") +"</i></small>"); ui->zhrLabel->setText("<small><i>"+q_("Normal rate") +"</i></small>");
break; break;
case 80: case 80:
ui->zhrLabel->setText("<small><i>"+q_("Standard Pers eids rate")+"</i></small>"); ui->zhrLabel->setText("<small><i>"+q_("Standard Pers eids rate")+"</i></small>");
break; break;
case 10000: case 10000:
ui->zhrLabel->setText("<small><i>"+q_("Exceptional L eonid rate")+"</i></small>"); ui->zhrLabel->setText("<small><i>"+q_("Exceptional L eonid rate")+"</i></small>");
break; break;
case 144000: case 144000:
ui->zhrLabel->setText("<small><i>"+q_("Highest rate ever (1966 Leonids)")+"</i></small>"); ui->zhrLabel->setText("<small><i>"+q_("Highest rate ever (1966 Leonids)")+"</i></small>");
break; break;
default: default:
ui->zhrLabel->setText(QString("<small><i>")+"Error"+ "</i></small>"); ui->zhrLabel->setText(QString("<small><i>")+"Error"+ "</i></small>");
} }
} }
void ViewDialog::starsLabelsValueChanged(int v) void ViewDialog::starsLabelsValueChanged(int v)
{ {
StarMgr* smgr = GETSTELMODULE(StarMgr); StarMgr* smgr = GETSTELMODULE(StarMgr);
float a= ((float)v)/10.f; float a= ((float)v)/10.f;
smgr->setLabelsAmount(a); smgr->setLabelsAmount(a);
} }
void ViewDialog::setCurrentLandscapeAsDefault(void) void ViewDialog::setCurrentLandscapeAsDefault(void)
 End of changes. 21 change blocks. 
44 lines changed or deleted 105 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/