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 "ZodiacalLight.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 "StelActionMgr.hpp"
#include <QDebug> #include <QDebug>
#include <QFrame> #include <QFrame>
skipping to change at line 80 skipping to change at line 81
atmosphereDialog = NULL; atmosphereDialog = NULL;
} }
void ViewDialog::retranslate() void ViewDialog::retranslate()
{ {
if (dialog) if (dialog)
{ {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
updateZhrDescription(); updateZhrDescription();
populateLists(); populateLists();
populateLightPollution();
//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)
skipping to change at line 124 skipping to change at line 126
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate())); 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);
#ifdef Q_OS_WIN
//Kinetic scrolling for tablet pc and pc //Kinetic scrolling for tablet pc and pc
QList<QWidget *> addscroll; QList<QWidget *> addscroll;
addscroll << ui->projectionListWidget << ui->culturesListWidget << u i->skyCultureTextBrowser << ui->landscapesListWidget; addscroll << ui->projectionListWidget << ui->culturesListWidget << u i->skyCultureTextBrowser << ui->landscapesListWidget;
StelDialog::installKineticScrolling(addscroll); StelDialog::installKineticScrolling(addscroll);
#endif
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
skipping to change at line 152 skipping to change at line 156
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);
ui->milkyWayBrightnessDoubleSpinBox->setValue(mw->getIntensity()); ui->milkyWayBrightnessDoubleSpinBox->setValue(mw->getIntensity());
connect(ui->milkyWayBrightnessDoubleSpinBox, SIGNAL(valueChanged(dou ble)), mw, SLOT(setIntensity(double))); connect(ui->milkyWayBrightnessDoubleSpinBox, SIGNAL(valueChanged(dou ble)), mw, SLOT(setIntensity(double)));
ZodiacalLight* zl = GETSTELMODULE(ZodiacalLight);
ui->zodiacalLightBrightnessDoubleSpinBox->setValue(zl->getIntensity(
));
connect(ui->zodiacalLightBrightnessDoubleSpinBox, SIGNAL(valueChange
d(double)), zl, SLOT(setIntensity(double)));
ui->starTwinkleAmountDoubleSpinBox->setValue(StelApp::getInstance(). getCore()->getSkyDrawer()->getTwinkleAmount()); ui->starTwinkleAmountDoubleSpinBox->setValue(StelApp::getInstance(). getCore()->getSkyDrawer()->getTwinkleAmount());
connect(ui->starTwinkleAmountDoubleSpinBox, SIGNAL(valueChanged(doub le)), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setTwinkleAmou nt(double))); connect(ui->starTwinkleAmountDoubleSpinBox, SIGNAL(valueChanged(doub le)), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setTwinkleAmou nt(double)));
ui->adaptationCheckbox->setChecked(StelApp::getInstance().getCore()- >getSkyDrawer()->getFlagLuminanceAdaptation()); ui->adaptationCheckbox->setChecked(StelApp::getInstance().getCore()- >getSkyDrawer()->getFlagLuminanceAdaptation());
connect(ui->adaptationCheckbox, SIGNAL(toggled(bool)), StelApp::getI nstance().getCore()->getSkyDrawer(), SLOT(setFlagLuminanceAdaptation(bool)) ); connect(ui->adaptationCheckbox, SIGNAL(toggled(bool)), StelApp::getI nstance().getCore()->getSkyDrawer(), SLOT(setFlagLuminanceAdaptation(bool)) );
// Limit Magnitudes // Limit Magnitudes
const StelSkyDrawer* drawer = StelApp::getInstance().getCore()->getS kyDrawer(); const StelSkyDrawer* drawer = StelApp::getInstance().getCore()->getS kyDrawer();
ui->starLimitMagnitudeCheckBox->setChecked(drawer->getFlagStarMagnit udeLimit()); ui->starLimitMagnitudeCheckBox->setChecked(drawer->getFlagStarMagnit udeLimit());
ui->nebulaLimitMagnitudeCheckBox->setChecked(drawer->getFlagNebulaMa gnitudeLimit()); ui->nebulaLimitMagnitudeCheckBox->setChecked(drawer->getFlagNebulaMa gnitudeLimit());
skipping to change at line 224 skipping to change at line 232
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);
connectCheckBox(ui->showGroundCheckBox, "actionShow_Ground"); connectCheckBox(ui->showGroundCheckBox, "actionShow_Ground");
connectCheckBox(ui->showFogCheckBox, "actionShow_Fog"); connectCheckBox(ui->showFogCheckBox, "actionShow_Fog");
connectGroupBox(ui->atmosphereGroupBox, "actionShow_Atmosphere"); connectGroupBox(ui->atmosphereGroupBox, "actionShow_Atmosphere");
connectCheckBox(ui->landscapeIlluminationCheckBox, "actionShow_Lands capeIllumination");
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->getFlagLandscapeSe ui->landscapeBrightnessCheckBox->setChecked(lmgr->getFlagLandscapeUs
tsMinimalBrightness()); eMinimalBrightness());
connect(ui->landscapeBrightnessCheckBox, SIGNAL(toggled(bool)), lmgr connect(ui->landscapeBrightnessCheckBox, SIGNAL(toggled(bool)), this
, SLOT(setFlagLandscapeSetsMinimalBrightness(bool))); , SLOT(setFlagLandscapeUseMinimalBrightness(bool)));
ui->landscapeBrightnessSpinBox->setValue(lmgr->getDefaultMinimalBrig
htness());
connect(ui->landscapeBrightnessSpinBox, SIGNAL(valueChanged(double))
, lmgr, SLOT(setDefaultMinimalBrightness(double)));
ui->localLandscapeBrightnessCheckBox->setChecked(lmgr->getFlagLandsc
apeSetsMinimalBrightness());
connect(ui->localLandscapeBrightnessCheckBox, SIGNAL(toggled(bool)),
lmgr, SLOT(setFlagLandscapeSetsMinimalBrightness(bool)));
populateLandscapeMinimalBrightness();
// Light pollution // Light pollution
populateLightPollution(); populateLightPollution();
ui->useLocationDataCheckBox->setChecked(lmgr->getFlagUseLightPolluti onFromDatabase()); ui->useLocationDataCheckBox->setChecked(lmgr->getFlagUseLightPolluti onFromDatabase());
connect(ui->useLocationDataCheckBox, SIGNAL(toggled(bool)), lmgr, SL OT(setFlagUseLightPollutionFromDatabase(bool))); connect(ui->useLocationDataCheckBox, SIGNAL(toggled(bool)), lmgr, SL OT(setFlagUseLightPollutionFromDatabase(bool)));
connect(lmgr, SIGNAL(lightPollutionUsageChanged(bool)), this, SLOT(p opulateLightPollution())); 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 p::getInstance().getCore()->getSkyDrawer(), SLOT(setBortleScaleIndex(int))) ; connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), StelAp p::getInstance().getCore()->getSkyDrawer(), SLOT(setBortleScaleIndex(int))) ;
connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setBortleScaleToolTip(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 // atmosphere details
//ui->pressureDoubleSpinBox->setValue(StelApp::getInstance().getCore
()->getSkyDrawer()->getAtmospherePressure());
//connect(ui->pressureDoubleSpinBox, SIGNAL(valueChanged(double)), S
telApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAtmospherePressure
(double)));
//ui->temperatureDoubleSpinBox->setValue(StelApp::getInstance().getC
ore()->getSkyDrawer()->getAtmosphereTemperature());
//connect(ui->temperatureDoubleSpinBox, SIGNAL(valueChanged(double))
, StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAtmosphereTempe
rature(double)));
//ui->extinctionDoubleSpinBox->setValue(StelApp::getInstance().getCo
re()->getSkyDrawer()->getExtinctionCoefficient());
//connect(ui->extinctionDoubleSpinBox, SIGNAL(valueChanged(double)),
StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setExtinctionCoeffi
cient(double)));
//// instead
connect(ui->pushButtonAtmosphereDetails, SIGNAL(clicked()), this, SL OT(showAtmosphereDialog())); connect(ui->pushButtonAtmosphereDetails, SIGNAL(clicked()), this, SL OT(showAtmosphereDialog()));
// 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
connectCheckBox(ui->showEquatorLineCheckBox, "actionShow_Equator_Lin e"); connectCheckBox(ui->showEquatorLineCheckBox, "actionShow_Equator_Lin e");
skipping to change at line 288 skipping to change at line 294
connectCheckBox(ui->showConstellationBoundariesCheckBox, "actionShow _Constellation_Boundaries"); connectCheckBox(ui->showConstellationBoundariesCheckBox, "actionShow _Constellation_Boundaries");
connectCheckBox(ui->showConstellationArtCheckBox, "actionShow_Conste llation_Art"); connectCheckBox(ui->showConstellationArtCheckBox, "actionShow_Conste llation_Art");
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);
connect(ui->nativeNameCheckBox, SIGNAL(clicked(bool)), ssmgr, SLOT(s
etFlagNativeNames(bool)));
ui->nativeNameCheckBox->setChecked(ssmgr->getFlagNativeNames());
// GZ NEW allow to display short names and inhibit translation.
connect(ui->skyCultureNamesStyleComboBox, SIGNAL(currentIndexChanged
(int)), cmgr, SLOT(setConstellationDisplayStyle(int)));
// Sky layers // Sky layers. This not yet finished and not visible in releases.
populateSkyLayersList(); populateSkyLayersList();
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::setFlagLandscapeUseMinimalBrightness(bool b)
{
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
lmgr->setFlagLandscapeUseMinimalBrightness(b);
populateLandscapeMinimalBrightness();
}
void ViewDialog::populateLandscapeMinimalBrightness()
{
if (ui->landscapeBrightnessCheckBox->isChecked())
{
ui->localLandscapeBrightnessCheckBox->setEnabled(true);
ui->landscapeBrightnessSpinBox->setEnabled(true);
}
else
{
ui->localLandscapeBrightnessCheckBox->setEnabled(false);
ui->landscapeBrightnessSpinBox->setEnabled(false);
}
}
void ViewDialog::populateLightPollution() void ViewDialog::populateLightPollution()
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
LandscapeMgr *lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr *lmgr = GETSTELMODULE(LandscapeMgr);
int bIdx = core->getSkyDrawer()->getBortleScaleIndex(); int bIdx = core->getSkyDrawer()->getBortleScaleIndex();
if (lmgr->getFlagUseLightPollutionFromDatabase()) if (lmgr->getFlagUseLightPollutionFromDatabase())
{ {
StelLocation loc = core->getCurrentLocation(); StelLocation loc = core->getCurrentLocation();
bIdx = loc.bortleScaleIndex; bIdx = loc.bortleScaleIndex;
if (!loc.planetName.contains("Earth")) // location not on Ea rth... if (!loc.planetName.contains("Earth")) // location not on Ea rth...
skipping to change at line 357 skipping to change at line 388
nelm.append("7.1–7.5"); nelm.append("7.1–7.5");
nelm.append("6.6–7.0"); nelm.append("6.6–7.0");
nelm.append("6.1–6.5"); nelm.append("6.1–6.5");
nelm.append("5.6–6.0"); nelm.append("5.6–6.0");
nelm.append("5.1-5.5"); nelm.append("5.1-5.5");
nelm.append("4.6–5.0"); nelm.append("4.6–5.0");
nelm.append("4.1–4.5"); nelm.append("4.1–4.5");
nelm.append("4.0"); nelm.append("4.0");
QString tooltip = QString("%1 (%2 %3)") QString tooltip = QString("%1 (%2 %3)")
.arg(list.at(i).toLocal8Bit().constData()) .arg(list.at(i))
.arg(q_("The naked-eye limiting magnitude is")) .arg(q_("The naked-eye limiting magnitude is"))
.arg(nelm.at(i).toLocal8Bit().constData()); .arg(nelm.at(i));
ui->lightPollutionSpinBox->setToolTip(tooltip); 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();
// populate language printing combo. (taken from DeltaT combo)
ConstellationMgr* cmgr=GETSTELMODULE(ConstellationMgr);
Q_ASSERT(cmgr);
Q_ASSERT(ui->skyCultureNamesStyleComboBox);
QComboBox* cultureNamesStyleComboBox = ui->skyCultureNamesStyleCombo
Box;
cultureNamesStyleComboBox->blockSignals(true);
cultureNamesStyleComboBox->clear();
cultureNamesStyleComboBox->addItem(q_("Abbreviated"), Constellation
Mgr::constellationsAbbreviated);
cultureNamesStyleComboBox->addItem(q_("Native"), Constellation
Mgr::constellationsNative); // Please make this always a transcript into E
uropean letters!
cultureNamesStyleComboBox->addItem(q_("Translated"), Constellation
Mgr::constellationsTranslated);
//cultureNamesStyleComboBox->addItem(q_("English"), Constellation
Mgr::constellationsEnglish); // This is not useful.
//Restore the selection
int index = cultureNamesStyleComboBox->findData(cmgr->getConstellati
onDisplayStyle(), Qt::UserRole, Qt::MatchCaseSensitive);
if (index==-1) index=2; // Default: Translated
cultureNamesStyleComboBox->setCurrentIndex(index);
cultureNamesStyleComboBox->blockSignals(false);
const StelCore* core = StelApp::getInstance().getCore(); const StelCore* core = StelApp::getInstance().getCore();
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
// Fill the projection list // Fill the projection list
l = ui->projectionListWidget; l = ui->projectionListWidget;
l->blockSignals(true); l->blockSignals(true);
l->clear(); l->clear();
const QStringList mappings = core->getAllProjectionTypeKeys(); const QStringList mappings = core->getAllProjectionTypeKeys();
foreach (QString s, mappings) foreach (QString s, mappings)
skipping to change at line 463 skipping to change at line 511
void ViewDialog::skyCultureChanged(const QString& cultureName) void ViewDialog::skyCultureChanged(const QString& cultureName)
{ {
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);
} }
// fill the description text window, not the names in the sky.
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 lang = app.getLocaleMgr().getAppLanguage(); QString lang = app.getLocaleMgr().getAppLanguage();
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);
} }
QString descPath = StelFileMgr::findFile("skycultures/" + skyCulture Id + "/description."+lang+".utf8"); QString descPath = StelFileMgr::findFile("skycultures/" + skyCulture Id + "/description."+lang+".utf8");
 End of changes. 16 change blocks. 
25 lines changed or deleted 80 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/