ViewDialog.cpp   ViewDialog.cpp 
skipping to change at line 39 skipping to change at line 39
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "LandscapeMgr.hpp" #include "LandscapeMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "NebulaMgr.hpp" #include "NebulaMgr.hpp"
#include "MeteorMgr.hpp" #include "MeteorMgr.hpp"
#include "MilkyWay.hpp" #include "MilkyWay.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 "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelActionMgr.hpp"
#include <QDebug> #include <QDebug>
#include <QFrame> #include <QFrame>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QSettings> #include <QSettings>
#include <QTimer> #include <QTimer>
#include <QDialog> #include <QDialog>
#include <QStringList>
ViewDialog::ViewDialog() ViewDialog::ViewDialog(QObject* parent) : StelDialog(parent)
{ {
ui = new Ui_viewDialogForm; ui = new Ui_viewDialogForm;
addRemoveLandscapesDialog = NULL; addRemoveLandscapesDialog = NULL;
atmosphereDialog=NULL; atmosphereDialog=NULL;
} }
ViewDialog::~ViewDialog() ViewDialog::~ViewDialog()
{ {
delete ui; delete ui;
ui=NULL; ui=NULL;
skipping to change at line 77 skipping to change at line 78
addRemoveLandscapesDialog = NULL; addRemoveLandscapesDialog = NULL;
delete atmosphereDialog; delete atmosphereDialog;
atmosphereDialog = NULL; atmosphereDialog = NULL;
} }
void ViewDialog::retranslate() void ViewDialog::retranslate()
{ {
if (dialog) if (dialog)
{ {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
setZhrFromControls(); updateZhrDescription();
populateLists(); populateLists();
//Hack to shrink the tabs to optimal size after language cha nge //Hack to shrink the tabs to optimal size after language cha nge
//by causing the list items to be laid out again. //by causing the list items to be laid out again.
ui->stackListWidget->setWrapping(false); ui->stackListWidget->setWrapping(false);
} }
} }
void ViewDialog::styleChanged() void ViewDialog::styleChanged()
{ {
if (dialog) if (dialog)
{ {
populateLists(); populateLists();
} }
} }
void ViewDialog::updateIconsColor() void ViewDialog::connectCheckBox(QCheckBox* checkBox, const QString& action Id)
{ {
QPixmap pixmap(50, 50); StelAction* action = StelApp::getInstance().getStelActionManager()->
QStringList icons; findAction(actionId);
icons << "sky" << "markings" << "landscape" << "starlore"; Q_ASSERT(action);
bool redIcon = false; checkBox->setChecked(action->isChecked());
if (StelApp::getInstance().getVisionModeNight()) connect(action, SIGNAL(toggled(bool)), checkBox, SLOT(setChecked(boo
redIcon = true; l)));
connect(checkBox, SIGNAL(toggled(bool)), action, SLOT(setChecked(boo
foreach(const QString &iconName, icons) l)));
{ }
pixmap.load(":/graphicGui/tabicon-" + iconName +".png");
if (redIcon) void ViewDialog::connectGroupBox(QGroupBox* groupBox, const QString& action
pixmap = StelButton::makeRed(pixmap); Id)
{
ui->stackListWidget->item(icons.indexOf(iconName))->setIcon( StelAction* action = StelApp::getInstance().getStelActionManager()->
QIcon(pixmap)); findAction(actionId);
} Q_ASSERT(action);
groupBox->setChecked(action->isChecked());
connect(action, SIGNAL(toggled(bool)), groupBox, SLOT(setChecked(boo
l)));
connect(groupBox, SIGNAL(toggled(bool)), action, SLOT(setChecked(boo
l)));
} }
void ViewDialog::createDialogContent() void ViewDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate())); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate()));
connect(&StelApp::getInstance(), SIGNAL(colorSchemeChanged(QString)) , this, SLOT(updateIconsColor()));
// Set the Sky tab activated by default // Set the Sky tab activated by default
ui->stackedWidget->setCurrentIndex(0); ui->stackedWidget->setCurrentIndex(0);
updateIconsColor();
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();
connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QStr ing&)), this, SLOT(skyCultureChanged(const QString&))); connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QStr ing&)), this, SLOT(skyCultureChanged(const QString&)));
connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QS tring&)), this, SLOT(projectionChanged(const QString&))); connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QS tring&)), this, SLOT(projectionChanged(const QString&)));
connect(ui->landscapesListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(landscapeChanged(QListWidgetItem*))); connect(ui->landscapesListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(landscapeChanged(QListWidgetItem*)));
// Connect and initialize checkboxes and other widgets // Connect and initialize checkboxes and other widgets
// Stars section // Stars section
QAction* a;
ui->starTwinkleCheckBox->setChecked(StelApp::getInstance().getCore() ->getSkyDrawer()->getFlagTwinkle()); ui->starTwinkleCheckBox->setChecked(StelApp::getInstance().getCore() ->getSkyDrawer()->getFlagTwinkle());
connect(ui->starTwinkleCheckBox, SIGNAL(toggled(bool)), StelApp::get Instance().getCore()->getSkyDrawer(), SLOT(setFlagTwinkle(bool))); connect(ui->starTwinkleCheckBox, SIGNAL(toggled(bool)), StelApp::get Instance().getCore()->getSkyDrawer(), SLOT(setFlagTwinkle(bool)));
ui->starScaleRadiusDoubleSpinBox->setValue(StelApp::getInstance().ge tCore()->getSkyDrawer()->getAbsoluteStarScale()); ui->starScaleRadiusDoubleSpinBox->setValue(StelApp::getInstance().ge tCore()->getSkyDrawer()->getAbsoluteStarScale());
connect(ui->starScaleRadiusDoubleSpinBox, SIGNAL(valueChanged(double )), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAbsoluteStarS cale(double))); connect(ui->starScaleRadiusDoubleSpinBox, SIGNAL(valueChanged(double )), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAbsoluteStarS cale(double)));
ui->starRelativeScaleDoubleSpinBox->setValue(StelApp::getInstance(). getCore()->getSkyDrawer()->getRelativeStarScale()); ui->starRelativeScaleDoubleSpinBox->setValue(StelApp::getInstance(). getCore()->getSkyDrawer()->getRelativeStarScale());
connect(ui->starRelativeScaleDoubleSpinBox, SIGNAL(valueChanged(doub le)), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setRelativeSta rScale(double))); connect(ui->starRelativeScaleDoubleSpinBox, SIGNAL(valueChanged(doub le)), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setRelativeSta rScale(double)));
MilkyWay* mw = GETSTELMODULE(MilkyWay); MilkyWay* mw = GETSTELMODULE(MilkyWay);
skipping to change at line 185 skipping to change at line 181
// Planets section // Planets section
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem); SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
ui->showPlanetCheckBox->setChecked(ssmgr->getFlagPlanets()); ui->showPlanetCheckBox->setChecked(ssmgr->getFlagPlanets());
connect(ui->showPlanetCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT(s etFlagPlanets(bool))); connect(ui->showPlanetCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT(s etFlagPlanets(bool)));
ui->planetMarkerCheckBox->setChecked(ssmgr->getFlagHints()); ui->planetMarkerCheckBox->setChecked(ssmgr->getFlagHints());
connect(ui->planetMarkerCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT (setFlagHints(bool))); connect(ui->planetMarkerCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT (setFlagHints(bool)));
ui->planetScaleMoonCheckBox->setChecked(ssmgr->getFlagMoonScale()); ui->planetScaleMoonCheckBox->setChecked(ssmgr->getFlagMoonScale());
connect(ui->planetScaleMoonCheckBox, SIGNAL(toggled(bool)), ssmgr, S LOT(setFlagMoonScale(bool))); connect(ui->planetScaleMoonCheckBox, SIGNAL(toggled(bool)), ssmgr, S LOT(setFlagMoonScale(bool)));
ui->moonScaleFactor->setValue(ssmgr->getMoonScale());
connect(ui->moonScaleFactor, SIGNAL(valueChanged(double)), ssmgr, SL
OT(setMoonScale(double)));
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);
updateZhrControls(mmgr->getZHR());
connect(mmgr, SIGNAL(zhrChanged(int)), ui->zhrSpinBox->setValue(mmgr->getZHR());
this, SLOT(updateZhrControls(int))); connect(mmgr, SIGNAL(zhrChanged(int)), this, SLOT(updateZhrControls(
connect(ui->zhrNone, SIGNAL(clicked()), this, SLOT(setZhrFromControl int)));
s())); connect(ui->zhrSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setZhr
connect(ui->zhr10, SIGNAL(clicked()), this, SLOT(setZhrFromControls( FromControls(int)));
))); updateZhrDescription();
connect(ui->zhr80, SIGNAL(clicked()), this, SLOT(setZhrFromControls(
)));
connect(ui->zhr1000, SIGNAL(clicked()), this, SLOT(setZhrFromControl
s()));
connect(ui->zhr10000, SIGNAL(clicked()), this, SLOT(setZhrFromContro
ls()));
connect(ui->zhr144000, SIGNAL(clicked()), this, SLOT(setZhrFromContr
ols()));
// Labels section // Labels section
StarMgr* smgr = GETSTELMODULE(StarMgr); StarMgr* smgr = GETSTELMODULE(StarMgr);
ui->starLabelCheckBox->setChecked(smgr->getFlagLabels()); connectCheckBox(ui->starLabelCheckBox, "actionShow_Stars_Labels");
connect(ui->starLabelCheckBox, SIGNAL(toggled(bool)), smgr, SLOT(set connectCheckBox(ui->nebulaLabelCheckBox, "actionShow_Nebulas");
FlagLabels(bool))); connectCheckBox(ui->planetLabelCheckBox, "actionShow_Planets_Labels"
);
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr); NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
ui->nebulaLabelCheckBox->setChecked(nmgr->getFlagHints());
a = gui->getGuiAction("actionShow_Nebulas");
connect(a, SIGNAL(toggled(bool)), ui->nebulaLabelCheckBox, SLOT(setC
hecked(bool)));
connect(ui->nebulaLabelCheckBox, SIGNAL(toggled(bool)), a, SLOT(setC
hecked(bool)));
ui->planetLabelCheckBox->setChecked(ssmgr->getFlagLabels());
connect(ui->planetLabelCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT(
setFlagLabels(bool)));
ui->starsLabelsHorizontalSlider->setValue((int)(smgr->getLabelsAmoun t()*10.f)); ui->starsLabelsHorizontalSlider->setValue((int)(smgr->getLabelsAmoun t()*10.f));
connect(ui->starsLabelsHorizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(starsLabelsValueChanged(int))); connect(ui->starsLabelsHorizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(starsLabelsValueChanged(int)));
ui->planetsLabelsHorizontalSlider->setValue((int)(ssmgr->getLabelsAm ount()*10.f)); ui->planetsLabelsHorizontalSlider->setValue((int)(ssmgr->getLabelsAm ount()*10.f));
connect(ui->planetsLabelsHorizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(planetsLabelsValueChanged(int))); connect(ui->planetsLabelsHorizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(planetsLabelsValueChanged(int)));
ui->nebulasLabelsHorizontalSlider->setValue((int)(nmgr->getHintsAmou nt()*10.f)); ui->nebulasLabelsHorizontalSlider->setValue((int)(nmgr->getHintsAmou nt()*10.f));
connect(ui->nebulasLabelsHorizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(nebulasLabelsValueChanged(int))); connect(ui->nebulasLabelsHorizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(nebulasLabelsValueChanged(int)));
// Landscape section // Landscape section
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
ui->showGroundCheckBox->setChecked(lmgr->getFlagLandscape()); connectCheckBox(ui->showGroundCheckBox, "actionShow_Ground");
a = gui->getGuiAction("actionShow_Ground"); connectCheckBox(ui->showFogCheckBox, "actionShow_Fog");
connect(a, SIGNAL(toggled(bool)), ui->showGroundCheckBox, SLOT(setCh connectGroupBox(ui->atmosphereGroupBox, "actionShow_Atmosphere");
ecked(bool)));
connect(ui->showGroundCheckBox, SIGNAL(toggled(bool)), a, SLOT(setCh
ecked(bool)));
ui->showFogCheckBox->setChecked(lmgr->getFlagFog());
connect(ui->showFogCheckBox, SIGNAL(toggled(bool)), lmgr, SLOT(setFl
agFog(bool)));
ui->showAtmosphereCheckBox->setChecked(lmgr->getFlagAtmosphere());
a = gui->getGuiAction("actionShow_Atmosphere");
connect(a, SIGNAL(toggled(bool)), ui->showAtmosphereCheckBox, SLOT(s
etChecked(bool)));
connect(ui->showAtmosphereCheckBox, SIGNAL(toggled(bool)), a, SLOT(s
etChecked(bool)));
ui->landscapePositionCheckBox->setChecked(lmgr->getFlagLandscapeSets Location()); ui->landscapePositionCheckBox->setChecked(lmgr->getFlagLandscapeSets Location());
connect(ui->landscapePositionCheckBox, SIGNAL(toggled(bool)), lmgr, SLOT(setFlagLandscapeSetsLocation(bool))); connect(ui->landscapePositionCheckBox, SIGNAL(toggled(bool)), lmgr, SLOT(setFlagLandscapeSetsLocation(bool)));
ui->landscapeBrightnessCheckBox->setChecked(lmgr->getFlagLandscapeNi ui->landscapeBrightnessCheckBox->setChecked(lmgr->getFlagLandscapeSe
ghtBrightness()); tsMinimalBrightness());
connect(ui->landscapeBrightnessCheckBox, SIGNAL(toggled(bool)), lmgr connect(ui->landscapeBrightnessCheckBox, SIGNAL(toggled(bool)), lmgr
, SLOT(setFlagLandscapeNightBrightness(bool))); , SLOT(setFlagLandscapeSetsMinimalBrightness(bool)));
ui->lightPollutionSpinBox->setValue(StelApp::getInstance().getCore() // Light pollution
->getSkyDrawer()->getBortleScale()); populateLightPollution();
ui->useLocationDataCheckBox->setChecked(lmgr->getFlagUseLightPolluti
onFromDatabase());
connect(ui->useLocationDataCheckBox, SIGNAL(toggled(bool)), lmgr, SL
OT(setFlagUseLightPollutionFromDatabase(bool)));
connect(lmgr, SIGNAL(lightPollutionUsageChanged(bool)), this, SLOT(p
opulateLightPollution()));
connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), lmgr, SLOT(setAtmosphereBortleLightPollution(int))); connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), lmgr, SLOT(setAtmosphereBortleLightPollution(int)));
connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), StelAp connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), StelAp
p::getInstance().getCore()->getSkyDrawer(), SLOT(setBortleScale(int))); p::getInstance().getCore()->getSkyDrawer(), SLOT(setBortleScaleIndex(int)))
;
connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), this,
SLOT(setBortleScaleToolTip(int)));
ui->autoChangeLandscapesCheckBox->setChecked(lmgr->getFlagLandscapeA utoSelection()); ui->autoChangeLandscapesCheckBox->setChecked(lmgr->getFlagLandscapeA utoSelection());
connect(ui->autoChangeLandscapesCheckBox, SIGNAL(toggled(bool)), lmg r, SLOT(setFlagLandscapeAutoSelection(bool))); connect(ui->autoChangeLandscapesCheckBox, SIGNAL(toggled(bool)), lmg r, SLOT(setFlagLandscapeAutoSelection(bool)));
// GZ: changes for refraction // GZ: changes for refraction
//ui->pressureDoubleSpinBox->setValue(StelApp::getInstance().getCore ()->getSkyDrawer()->getAtmospherePressure()); //ui->pressureDoubleSpinBox->setValue(StelApp::getInstance().getCore ()->getSkyDrawer()->getAtmospherePressure());
//connect(ui->pressureDoubleSpinBox, SIGNAL(valueChanged(double)), S telApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAtmospherePressure (double))); //connect(ui->pressureDoubleSpinBox, SIGNAL(valueChanged(double)), S telApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAtmospherePressure (double)));
//ui->temperatureDoubleSpinBox->setValue(StelApp::getInstance().getC ore()->getSkyDrawer()->getAtmosphereTemperature()); //ui->temperatureDoubleSpinBox->setValue(StelApp::getInstance().getC ore()->getSkyDrawer()->getAtmosphereTemperature());
//connect(ui->temperatureDoubleSpinBox, SIGNAL(valueChanged(double)) , StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAtmosphereTempe rature(double))); //connect(ui->temperatureDoubleSpinBox, SIGNAL(valueChanged(double)) , StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAtmosphereTempe rature(double)));
//ui->extinctionDoubleSpinBox->setValue(StelApp::getInstance().getCo re()->getSkyDrawer()->getExtinctionCoefficient()); //ui->extinctionDoubleSpinBox->setValue(StelApp::getInstance().getCo re()->getSkyDrawer()->getExtinctionCoefficient());
skipping to change at line 274 skipping to change at line 257
// GZ: Done // GZ: Done
ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getCurrentLandsc apeID()==lmgr->getDefaultLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getCurrentLandsc apeID()==lmgr->getDefaultLandscapeID());
ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getCurrentLandsc apeID()!=lmgr->getDefaultLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getCurrentLandsc apeID()!=lmgr->getDefaultLandscapeID());
connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentLandscapeAsDefault())); connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentLandscapeAsDefault()));
connect(GETSTELMODULE(LandscapeMgr), SIGNAL(landscapesChanged()), th is, SLOT(populateLists())); connect(GETSTELMODULE(LandscapeMgr), SIGNAL(landscapesChanged()), th is, SLOT(populateLists()));
connect(ui->pushButtonAddRemoveLandscapes, SIGNAL(clicked()), this, SLOT(showAddRemoveLandscapesDialog())); connect(ui->pushButtonAddRemoveLandscapes, SIGNAL(clicked()), this, SLOT(showAddRemoveLandscapesDialog()));
// Grid and lines // Grid and lines
GridLinesMgr* glmgr = GETSTELMODULE(GridLinesMgr); connectCheckBox(ui->showEquatorLineCheckBox, "actionShow_Equator_Lin
ui->showEquatorLineCheckBox->setChecked(glmgr->getFlagEquatorLine()) e");
; connectCheckBox(ui->showEclipticLineCheckBox, "actionShow_Ecliptic_L
a = gui->getGuiAction("actionShow_Equator_Line"); ine");
connect(a, SIGNAL(toggled(bool)), ui->showEquatorLineCheckBox, SLOT( connectCheckBox(ui->showMeridianLineCheckBox, "actionShow_Meridian_L
setChecked(bool))); ine");
connect(ui->showEquatorLineCheckBox, SIGNAL(toggled(bool)), a, SLOT( connectCheckBox(ui->showHorizonLineCheckBox, "actionShow_Horizon_Lin
setChecked(bool))); e");
connectCheckBox(ui->showEquatorialGridCheckBox, "actionShow_Equatori
ui->showEclipticLineCheckBox->setChecked(glmgr->getFlagEclipticLine( al_Grid");
)); connectCheckBox(ui->showGalacticGridCheckBox, "actionShow_Galactic_G
a = gui->getGuiAction("actionShow_Ecliptic_Line"); rid");
connect(a, SIGNAL(toggled(bool)), ui->showEclipticLineCheckBox, SLOT connectCheckBox(ui->showGalacticPlaneLineCheckBox, "actionShow_Galac
(setChecked(bool))); tic_Plane_Line");
connect(ui->showEclipticLineCheckBox, SIGNAL(toggled(bool)), a, SLOT connectCheckBox(ui->showAzimuthalGridCheckBox, "actionShow_Azimuthal
(setChecked(bool))); _Grid");
connectCheckBox(ui->showEquatorialJ2000GridCheckBox, "actionShow_Equ
ui->showMeridianLineCheckBox->setChecked(glmgr->getFlagMeridianLine( atorial_J2000_Grid");
)); connectCheckBox(ui->showEclipticGridJ2000CheckBox, "actionShow_Eclip
a = gui->getGuiAction("actionShow_Meridian_Line"); tic_J2000_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showMeridianLineCheckBox, SLOT connectCheckBox(ui->showCardinalPointsCheckBox, "actionShow_Cardinal
(setChecked(bool))); _Points");
connect(ui->showMeridianLineCheckBox, SIGNAL(toggled(bool)), a, SLOT
(setChecked(bool)));
ui->showHorizonLineCheckBox->setChecked(glmgr->getFlagHorizonLine())
;
a = gui->getGuiAction("actionShow_Horizon_Line");
connect(a, SIGNAL(toggled(bool)), ui->showHorizonLineCheckBox, SLOT(
setChecked(bool)));
connect(ui->showHorizonLineCheckBox, SIGNAL(toggled(bool)), a, SLOT(
setChecked(bool)));
ui->showEquatorialGridCheckBox->setChecked(glmgr->getFlagEquatorGrid
());
a = gui->getGuiAction("actionShow_Equatorial_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showEquatorialGridCheckBox, SL
OT(setChecked(bool)));
connect(ui->showEquatorialGridCheckBox, SIGNAL(toggled(bool)), a, SL
OT(setChecked(bool)));
ui->showGalacticGridCheckBox->setChecked(glmgr->getFlagGalacticGrid(
));
a = gui->getGuiAction("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->getGuiAction("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());
a = gui->getGuiAction("actionShow_Azimuthal_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showAzimuthalGridCheckBox, SLO
T(setChecked(bool)));
connect(ui->showAzimuthalGridCheckBox, SIGNAL(toggled(bool)), a, SLO
T(setChecked(bool)));
ui->showEquatorialJ2000GridCheckBox->setChecked(glmgr->getFlagEquato
rJ2000Grid());
a = gui->getGuiAction("actionShow_Equatorial_J2000_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showEquatorialJ2000GridCheckBo
x, SLOT(setChecked(bool)));
connect(ui->showEquatorialJ2000GridCheckBox, SIGNAL(toggled(bool)),
a, SLOT(setChecked(bool)));
ui->showEclipticGridJ2000CheckBox->setChecked(glmgr->getFlagEcliptic
J2000Grid());
a = gui->getGuiAction("actionShow_Ecliptic_J2000_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showEclipticGridJ2000CheckBox,
SLOT(setChecked(bool)));
connect(ui->showEclipticGridJ2000CheckBox, SIGNAL(toggled(bool)), a,
SLOT(setChecked(bool)));
ui->showCardinalPointsCheckBox->setChecked(lmgr->getFlagCardinalsPoi
nts());
a = gui->getGuiAction("actionShow_Cardinal_Points");
connect(a, SIGNAL(toggled(bool)), ui->showCardinalPointsCheckBox, SL
OT(setChecked(bool)));
connect(ui->showCardinalPointsCheckBox, SIGNAL(toggled(bool)), a, SL
OT(setChecked(bool)));
// Constellations // Constellations
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr); ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
connectCheckBox(ui->showConstellationLinesCheckBox, "actionShow_Cons
ui->showConstellationLinesCheckBox->setChecked(cmgr->getFlagLines()) tellation_Lines");
; connectCheckBox(ui->showConstellationLabelsCheckBox, "actionShow_Con
a = gui->getGuiAction("actionShow_Constellation_Lines"); stellation_Labels");
connect(a, SIGNAL(toggled(bool)), ui->showConstellationLinesCheckBox connectCheckBox(ui->showConstellationBoundariesCheckBox, "actionShow
, SLOT(setChecked(bool))); _Constellation_Boundaries");
connect(ui->showConstellationLinesCheckBox, SIGNAL(toggled(bool)), a connectCheckBox(ui->showConstellationArtCheckBox, "actionShow_Conste
, SLOT(setChecked(bool))); llation_Art");
ui->showConstellationLabelsCheckBox->setChecked(cmgr->getFlagLabels(
));
a = gui->getGuiAction("actionShow_Constellation_Labels");
connect(a, SIGNAL(toggled(bool)), ui->showConstellationLabelsCheckBo
x, SLOT(setChecked(bool)));
connect(ui->showConstellationLabelsCheckBox, SIGNAL(toggled(bool)),
a, SLOT(setChecked(bool)));
ui->showConstellationBoundariesCheckBox->setChecked(cmgr->getFlagBou
ndaries());
a = gui->getGuiAction("actionShow_Constellation_Boundaries");
connect(a, SIGNAL(toggled(bool)), ui->showConstellationBoundariesChe
ckBox, SLOT(setChecked(bool)));
connect(ui->showConstellationBoundariesCheckBox, SIGNAL(toggled(bool
)), a, SLOT(setChecked(bool)));
ui->showConstellationArtCheckBox->setChecked(cmgr->getFlagArt());
a = gui->getGuiAction("actionShow_Constellation_Art");
connect(a, SIGNAL(toggled(bool)), ui->showConstellationArtCheckBox,
SLOT(setChecked(bool)));
connect(ui->showConstellationArtCheckBox, SIGNAL(toggled(bool)), a,
SLOT(setChecked(bool)));
ui->constellationArtBrightnessSpinBox->setValue(cmgr->getArtIntensit y()); ui->constellationArtBrightnessSpinBox->setValue(cmgr->getArtIntensit y());
connect(ui->constellationArtBrightnessSpinBox, SIGNAL(valueChanged(d ouble)), cmgr, SLOT(setArtIntensity(double))); connect(ui->constellationArtBrightnessSpinBox, SIGNAL(valueChanged(d ouble)), cmgr, SLOT(setArtIntensity(double)));
// Starlore // Starlore
connect(ui->useAsDefaultSkyCultureCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentCultureAsDefault())); connect(ui->useAsDefaultSkyCultureCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentCultureAsDefault()));
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);
// Sky layers // Sky layers
skipping to change at line 374 skipping to change at line 296
connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(populateSkyLa yersList())); connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(populateSkyLa yersList()));
connect(ui->skyLayerListWidget, SIGNAL(currentTextChanged(const QStr ing&)), this, SLOT(skyLayersSelectionChanged(const QString&))); connect(ui->skyLayerListWidget, SIGNAL(currentTextChanged(const QStr ing&)), this, SLOT(skyLayersSelectionChanged(const QString&)));
connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetIt em *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWi dgetItem*))); connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetIt em *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWi dgetItem*)));
connect(ui->skyLayerEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(skyLayersEnabledChanged(int))); connect(ui->skyLayerEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(skyLayersEnabledChanged(int)));
QTimer* refreshTimer = new QTimer(this); QTimer* refreshTimer = new QTimer(this);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(updateFromProgra m())); connect(refreshTimer, SIGNAL(timeout()), this, SLOT(updateFromProgra m()));
refreshTimer->start(200); refreshTimer->start(200);
} }
void ViewDialog::populateLightPollution()
{
StelCore *core = StelApp::getInstance().getCore();
LandscapeMgr *lmgr = GETSTELMODULE(LandscapeMgr);
int bIdx = core->getSkyDrawer()->getBortleScaleIndex();
if (lmgr->getFlagUseLightPollutionFromDatabase())
{
StelLocation loc = core->getCurrentLocation();
bIdx = loc.bortleScaleIndex;
if (!loc.planetName.contains("Earth")) // location not on Ea
rth...
bIdx = 1;
if (bIdx<1) // ...or it observatory, or it unknown location
bIdx = loc.DEFAULT_BORTLE_SCALE_INDEX;
ui->lightPollutionSpinBox->setEnabled(false);
}
else
ui->lightPollutionSpinBox->setEnabled(true);
ui->lightPollutionSpinBox->setValue(bIdx);
setBortleScaleToolTip(bIdx);
}
void ViewDialog::setBortleScaleToolTip(int Bindex)
{
int i = Bindex-1;
QStringList list, nelm;
//TRANSLATORS: Short description for Class 1 of the Bortle scale
list.append(q_("Excellent dark-sky site"));
//TRANSLATORS: Short description for Class 2 of the Bortle scale
list.append(q_("Typical truly dark site"));
//TRANSLATORS: Short description for Class 3 of the Bortle scale
list.append(q_("Rural sky"));
//TRANSLATORS: Short description for Class 4 of the Bortle scale
list.append(q_("Rural/suburban transition"));
//TRANSLATORS: Short description for Class 5 of the Bortle scale
list.append(q_("Suburban sky"));
//TRANSLATORS: Short description for Class 6 of the Bortle scale
list.append(q_("Bright suburban sky"));
//TRANSLATORS: Short description for Class 7 of the Bortle scale
list.append(q_("Suburban/urban transition"));
//TRANSLATORS: Short description for Class 8 of the Bortle scale
list.append(q_("City sky"));
//TRANSLATORS: Short description for Class 9 of the Bortle scale
list.append(q_("Inner-city sky"));
nelm.append("7.6–8.0");
nelm.append("7.1–7.5");
nelm.append("6.6–7.0");
nelm.append("6.1–6.5");
nelm.append("5.6–6.0");
nelm.append("5.1-5.5");
nelm.append("4.6–5.0");
nelm.append("4.1–4.5");
nelm.append("4.0");
QString tooltip = QString("%1 (%2 %3)")
.arg(list.at(i).toLocal8Bit().constData())
.arg(q_("The naked-eye limiting magnitude is"))
.arg(nelm.at(i).toLocal8Bit().constData());
ui->lightPollutionSpinBox->setToolTip(tooltip);
}
void ViewDialog::populateLists() void ViewDialog::populateLists()
{ {
// Fill the culture list widget from the available list // Fill the culture list widget from the available list
QListWidget* l = ui->culturesListWidget; QListWidget* l = ui->culturesListWidget;
l->blockSignals(true); l->blockSignals(true);
l->clear(); l->clear();
l->addItems(StelApp::getInstance().getSkyCultureMgr().getSkyCultureL istI18()); l->addItems(StelApp::getInstance().getSkyCultureMgr().getSkyCultureL istI18());
l->setCurrentItem(l->findItems(StelApp::getInstance().getSkyCultureM gr().getCurrentSkyCultureNameI18(), Qt::MatchExactly).at(0)); l->setCurrentItem(l->findItems(StelApp::getInstance().getSkyCultureM gr().getCurrentSkyCultureNameI18(), Qt::MatchExactly).at(0));
l->blockSignals(false); l->blockSignals(false);
updateSkyCultureText(); updateSkyCultureText();
skipping to change at line 409 skipping to change at line 394
l->blockSignals(false); l->blockSignals(false);
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());
// 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);
QStringList landscapeList = lmgr->getAllLandscapeNames(); QStringList landscapeList = lmgr->getAllLandscapeNames();
foreach (const QString landscapeId, landscapeList) foreach (const QString landscapeName, landscapeList)
{ {
QString label = q_(landscapeId); QString label = q_(landscapeName);
QListWidgetItem* item = new QListWidgetItem(label); QListWidgetItem* item = new QListWidgetItem(label);
item->setData(Qt::UserRole, landscapeId); item->setData(Qt::UserRole, landscapeName);
l->addItem(item); l->addItem(item);
} }
QString selectedLandscapeId = lmgr->getCurrentLandscapeName(); l->sortItems(); // they may have been translated!
QString selectedLandscapeName = lmgr->getCurrentLandscapeName();
for (int i = 0; i < l->count(); i++) for (int i = 0; i < l->count(); i++)
{ {
if (l->item(i)->data(Qt::UserRole).toString() == selectedLan dscapeId) if (l->item(i)->data(Qt::UserRole).toString() == selectedLan dscapeName)
{ {
l->setCurrentRow(i); l->setCurrentRow(i);
break; break;
} }
} }
l->blockSignals(false); l->blockSignals(false);
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());
skipping to change at line 476 skipping to change at line 462
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(); StelApp& app = StelApp::getInstance();
QString skyCultureId = app.getSkyCultureMgr().getCurrentSkyCultureID (); QString skyCultureId = app.getSkyCultureMgr().getCurrentSkyCultureID ();
QString descPath; QString lang = app.getLocaleMgr().getAppLanguage();
try if (!QString("pt_BR zh_CN zh_HK zh_TW").contains(lang))
{ {
QString lang = app.getLocaleMgr().getAppLanguage(); lang = lang.split("_").at(0);
if (!QString("pt_BR zh_CN zh_HK zh_TW").contains(lang))
{
lang = lang.split("_").at(0);
}
descPath = StelFileMgr::findFile("skycultures/" + skyCulture
Id + "/description."+lang+".utf8");
} }
catch (std::runtime_error& e) QString descPath = StelFileMgr::findFile("skycultures/" + skyCulture
Id + "/description."+lang+".utf8");
if (descPath.isEmpty())
{ {
try descPath = StelFileMgr::findFile("skycultures/" + skyCulture
{ Id + "/description.en.utf8");
descPath = StelFileMgr::findFile("skycultures/" + sk if (descPath.isEmpty())
yCultureId + "/description.en.utf8");
}
catch (std::runtime_error& e)
{
qWarning() << "WARNING: can't find description for s kyculture" << skyCultureId; qWarning() << "WARNING: can't find description for s kyculture" << skyCultureId;
}
} }
QStringList searchPaths; QStringList searchPaths;
try searchPaths << StelFileMgr::findFile("skycultures/" + skyCultureId);
{
searchPaths << StelFileMgr::findFile("skycultures/" + skyCul
tureId);
}
catch (std::runtime_error& e) {}
ui->skyCultureTextBrowser->setSearchPaths(searchPaths); ui->skyCultureTextBrowser->setSearchPaths(searchPaths);
StelGui* gui = dynamic_cast<StelGui*>(app.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); QString htmlFile;
QString htmlFile = QString::fromUtf8(f.readAll()); if(f.open(QIODevice::ReadOnly))
#if QT_VERSION == 0x040800 {
// Workaround for https://bugreports.qt-project.org/browse/Q htmlFile = QString::fromUtf8(f.readAll());
TBUG-24077 f.close();
QString path = QFileInfo(f).path(); }
QString newtag = "<img src=\"" + path + "/\\1";
htmlFile.replace(QRegExp("<img src=\"(\\w)"), newtag);
#endif
ui->skyCultureTextBrowser->setHtml(htmlFile); 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);
skipping to change at line 552 skipping to change at line 523
lmgr->setCurrentLandscapeName(item->data(Qt::UserRole).toString()); 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()->getBortleScaleIndex());
} }
void ViewDialog::showAddRemoveLandscapesDialog() void ViewDialog::showAddRemoveLandscapesDialog()
{ {
if(addRemoveLandscapesDialog == NULL) if(addRemoveLandscapesDialog == NULL)
addRemoveLandscapesDialog = new AddRemoveLandscapesDialog(); addRemoveLandscapesDialog = new AddRemoveLandscapesDialog();
addRemoveLandscapesDialog->setVisible(true); addRemoveLandscapesDialog->setVisible(true);
} }
skipping to change at line 574 skipping to change at line 545
{ {
if(atmosphereDialog == NULL) if(atmosphereDialog == NULL)
atmosphereDialog = new AtmosphereDialog(); atmosphereDialog = new AtmosphereDialog();
//ui->temperatureDoubleSpinBox->setValue(StelApp::getInstance().getC ore()->getSkyDrawer()->getAtmosphereTemperature()); //ui->temperatureDoubleSpinBox->setValue(StelApp::getInstance().getC ore()->getSkyDrawer()->getAtmosphereTemperature());
//ui->extinctionDoubleSpinBox->setValue(StelApp::getInstance().getCo re()->getSkyDrawer()->getExtinctionCoefficient()); //ui->extinctionDoubleSpinBox->setValue(StelApp::getInstance().getCo re()->getSkyDrawer()->getExtinctionCoefficient());
//ui->pressureDoubleSpinBox->setValue(StelApp::getInstance().getCore ()->getSkyDrawer()->getAtmospherePressure()); //ui->pressureDoubleSpinBox->setValue(StelApp::getInstance().getCore ()->getSkyDrawer()->getAtmospherePressure());
atmosphereDialog->setVisible(true); atmosphereDialog->setVisible(true);
} }
void ViewDialog::setZhrFromControls() void ViewDialog::setZhrFromControls(int zhr)
{ {
MeteorMgr* mmgr = GETSTELMODULE(MeteorMgr); MeteorMgr* mmgr = GETSTELMODULE(MeteorMgr);
int zhr=-1; if (zhr==0)
if (ui->zhrNone->isChecked())
{ {
mmgr->setFlagShow(false); mmgr->setFlagShow(false);
zhr = 0;
} }
else else
{ {
mmgr->setFlagShow(true); mmgr->setFlagShow(true);
}
if (ui->zhr10->isChecked())
zhr = 10;
if (ui->zhr80->isChecked())
zhr = 80;
if (ui->zhr1000->isChecked())
zhr = 1000;
if (ui->zhr10000->isChecked())
zhr = 10000;
if (ui->zhr144000->isChecked())
zhr = 144000;
if (zhr!=mmgr->getZHR())
{
mmgr->setZHR(zhr); mmgr->setZHR(zhr);
} }
updateZhrDescription();
updateZhrDescription(zhr);
} }
void ViewDialog::updateZhrControls(int zhr) void ViewDialog::updateZhrControls(int zhr)
{ {
// As the radio buttons are tied to the clicked() signal, ui->zhrSpinBox->setValue(zhr);
// it won't be triggered by setting the value programmatically. updateZhrDescription();
switch(zhr)
{
case 0: ui->zhrNone->setChecked(true); break;
case 80: ui->zhr80->setChecked(true); break;
case 1000: ui->zhr1000->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) void ViewDialog::updateZhrDescription()
{ {
int zhr = ui->zhrSpinBox->value();
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 5:
case 6:
case 7:
case 8:
case 9:
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 25:
ui->zhrLabel->setText("<small><i>"+q_("Standard Orio
nids rate")+"</i></small>");
break;
case 100:
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 120:
ui->zhrLabel->setText("<small><i>"+q_("Standard Gemi
nids rate")+"</i></small>");
break;
case 200:
ui->zhrLabel->setText("<small><i>"+q_("Exceptional P
erseid rate")+"</i></small>");
break;
case 1000: case 1000:
ui->zhrLabel->setText("<small><i>"+q_("Meteor storm rate")+"</i></small>"); ui->zhrLabel->setText("<small><i>"+q_("Meteor storm rate")+"</i></small>");
break; break;
case 6000:
ui->zhrLabel->setText("<small><i>"+q_("Exceptional D
raconid rate")+"</i></small>");
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 ui->zhrLabel->setText("<small><i>"+q_("Very high rat
ever (1966 Leonids)")+"</i></small>"); e (1966 Leonids)")+"</i></small>");
break;
case 240000:
ui->zhrLabel->setText("<small><i>"+q_("Highest rate
ever (1833 Leonids)")+"</i></small>");
break; break;
default: default:
ui->zhrLabel->setText(QString("<small><i>")+"Error"+ ui->zhrLabel->setText("");
"</i></small>"); break;
} }
} }
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);
} }
 End of changes. 49 change blocks. 
275 lines changed or deleted 214 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/