ViewDialog.cpp   ViewDialog.cpp 
skipping to change at line 25 skipping to change at line 25
* *
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * 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 "GreatRedSpotDialog.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"
#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"
skipping to change at line 47 skipping to change at line 48
#include "MilkyWay.hpp" #include "MilkyWay.hpp"
#include "ZodiacalLight.hpp" #include "ZodiacalLight.hpp"
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
#include "SporadicMeteorMgr.hpp" #include "SporadicMeteorMgr.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 "StelMovementMgr.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> #include <QStringList>
ViewDialog::ViewDialog(QObject* parent) : StelDialog(parent) ViewDialog::ViewDialog(QObject* parent) : StelDialog(parent)
{ {
dialogName = "View";
ui = new Ui_viewDialogForm; ui = new Ui_viewDialogForm;
addRemoveLandscapesDialog = NULL; addRemoveLandscapesDialog = NULL;
atmosphereDialog=NULL; atmosphereDialog=NULL;
greatRedSpotDialog=NULL;
} }
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;
delete greatRedSpotDialog;
greatRedSpotDialog = NULL;
} }
void ViewDialog::retranslate() void ViewDialog::retranslate()
{ {
if (dialog) if (dialog)
{ {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
updateZhrDescription(); updateZhrDescription(GETSTELMODULE(SporadicMeteorMgr)->getZH R());
populateLists(); populateLists();
populateLightPollution(); setBortleScaleToolTip(StelApp::getInstance().getCore()->getS kyDrawer()->getBortleScaleIndex());
//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.
updateTabBarListWidgetWidth(); updateTabBarListWidgetWidth();
} }
} }
void ViewDialog::styleChanged() void ViewDialog::styleChanged()
{ {
if (dialog) if (dialog)
{ {
populateLists(); populateLists();
} }
} }
void ViewDialog::connectCheckBox(QCheckBox* checkBox, const QString& action
Id)
{
StelAction* action = StelApp::getInstance().getStelActionManager()->
findAction(actionId);
Q_ASSERT(action);
checkBox->setChecked(action->isChecked());
connect(action, SIGNAL(toggled(bool)), checkBox, SLOT(setChecked(boo
l)));
connect(checkBox, SIGNAL(toggled(bool)), action, SLOT(setChecked(boo
l)));
}
void ViewDialog::connectGroupBox(QGroupBox* groupBox, const QString& action Id) void ViewDialog::connectGroupBox(QGroupBox* groupBox, const QString& action Id)
{ {
StelAction* action = StelApp::getInstance().getStelActionManager()-> findAction(actionId); StelAction* action = StelApp::getInstance().getStelActionManager()-> findAction(actionId);
Q_ASSERT(action); Q_ASSERT(action);
groupBox->setChecked(action->isChecked()); groupBox->setChecked(action->isChecked());
connect(action, SIGNAL(toggled(bool)), groupBox, SLOT(setChecked(boo l))); connect(action, SIGNAL(toggled(bool)), groupBox, SLOT(setChecked(boo l)));
connect(groupBox, SIGNAL(toggled(bool)), action, SLOT(setChecked(boo l))); connect(groupBox, SIGNAL(toggled(bool)), action, SLOT(setChecked(boo l)));
} }
void ViewDialog::createDialogContent() void ViewDialog::createDialogContent()
skipping to change at line 134 skipping to change at line 131
//ui->viewTabWidget->removeTab(4); //ui->viewTabWidget->removeTab(4);
#ifdef Q_OS_WIN #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 #endif
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint)));
populateLists(); populateLists();
ui->viewportOffsetSpinBox->setValue((int) round(StelApp::getInstance ().getCore()->getCurrentStelProjectorParams().viewportCenterOffset[1] * 100 .0f));
connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QStr // Note: GZ had a day of "fun" on 20160411-12 sorting out the merge
ing&)), this, SLOT(skyCultureChanged(const QString&))); with the restructured method from trunk.
connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QS // I had to check whether all entries from re-arranged trunk are pre
tring&)), this, SLOT(projectionChanged(const QString&))); sent in the property-enabled versions here.
connect(ui->viewportOffsetSpinBox, SIGNAL(valueChanged(int)), this, // I hope I have everything working again.
SLOT(viewportVerticalShiftChanged(int))); // TODO: New method: populateLightPollution may be useful. Make sure
connect(ui->landscapesListWidget, SIGNAL(itemClicked(QListWidgetItem it is.
*)), this, SLOT(landscapeChanged(QListWidgetItem*))); // Jupiter's GRS must become property, and recheck the other "from t
runk" entries.
connectDoubleProperty(ui->viewportOffsetSpinBox, "StelMovementMgr.vi
ewportVerticalOffsetTarget");
connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QStr
ing&)),&StelApp::getInstance().getSkyCultureMgr(),SLOT(setCurrentSkyCulture
NameI18(QString)));
connect(&StelApp::getInstance().getSkyCultureMgr(), SIGNAL(currentSk
yCultureChanged(QString)), this, SLOT(skyCultureChanged()));
connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QS
tring&)), this, SLOT(changeProjection(const QString&)));
connect(StelApp::getInstance().getCore(), SIGNAL(currentProjectionTy
peChanged(StelCore::ProjectionType)),this,SLOT(projectionChanged()));
// Connect and initialize checkboxes and other widgets // Connect and initialize checkboxes and other widgets
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr); NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
// DSO // DSO
updateSelectedCatalogsCheckBoxes(); updateSelectedCatalogsCheckBoxes();
connect(nmgr, SIGNAL(catalogFiltersChanged(Nebula::CatalogGroup)), t his, SLOT(updateSelectedCatalogsCheckBoxes()));
connect(ui->buttonGroupDisplayedDSOCatalogs, SIGNAL(buttonClicked(in t)), this, SLOT(setSelectedCatalogsFromCheckBoxes())); connect(ui->buttonGroupDisplayedDSOCatalogs, SIGNAL(buttonClicked(in t)), this, SLOT(setSelectedCatalogsFromCheckBoxes()));
updateSelectedTypesCheckBoxes(); updateSelectedTypesCheckBoxes();
connect(nmgr, SIGNAL(typeFiltersChanged(Nebula::TypeGroup)), this, S LOT(updateSelectedTypesCheckBoxes()));
connect(ui->buttonGroupDisplayedDSOTypes, SIGNAL(buttonClicked(int)) , this, SLOT(setSelectedTypesFromCheckBoxes())); connect(ui->buttonGroupDisplayedDSOTypes, SIGNAL(buttonClicked(int)) , this, SLOT(setSelectedTypesFromCheckBoxes()));
ui->groupBoxDSOTypeFilters->setChecked(nmgr->getFlagTypeFiltersUsage connectGroupBox(ui->groupBoxDSOTypeFilters,"actionSet_Nebula_TypeFil
()); terUsage");
connect(ui->groupBoxDSOTypeFilters, SIGNAL(toggled(bool)), nmgr, SLO connectBoolProperty(ui->checkBoxProportionalHints, "NebulaMgr.hintsP
T(setFlagTypeFiltersUsage(bool))); roportional");
ui->checkBoxProportionalHints->setChecked(nmgr->getHintsProportional connectBoolProperty(ui->checkBoxSurfaceBrightnessUsage, "NebulaMgr.f
()); lagSurfaceBrightnessUsage");
connect(ui->checkBoxProportionalHints, SIGNAL(toggled(bool)), nmgr, connectBoolProperty(ui->checkBoxDesignationsOnlyUsage, "NebulaMgr.fl
SLOT(setHintsProportional(bool))); agDesignationLabels");
ui->checkBoxSurfaceBrightnessUsage->setChecked(nmgr->getFlagSurfaceB
rightnessUsage());
connect(ui->checkBoxSurfaceBrightnessUsage, SIGNAL(toggled(bool)), n
mgr, SLOT(setFlagSurfaceBrightnessUsage(bool)));
// Stars section
ui->starTwinkleCheckBox->setChecked(StelApp::getInstance().getCore()
->getSkyDrawer()->getFlagTwinkle());
connect(ui->starTwinkleCheckBox, SIGNAL(toggled(bool)), StelApp::get
Instance().getCore()->getSkyDrawer(), SLOT(setFlagTwinkle(bool)));
ui->starScaleRadiusDoubleSpinBox->setValue(StelApp::getInstance().ge
tCore()->getSkyDrawer()->getAbsoluteStarScale());
connect(ui->starScaleRadiusDoubleSpinBox, SIGNAL(valueChanged(double
)), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setAbsoluteStarS
cale(double)));
ui->starRelativeScaleDoubleSpinBox->setValue(StelApp::getInstance().
getCore()->getSkyDrawer()->getRelativeStarScale());
connect(ui->starRelativeScaleDoubleSpinBox, SIGNAL(valueChanged(doub
le)), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setRelativeSta
rScale(double)));
MilkyWay* mw = GETSTELMODULE(MilkyWay); // From Trunk, but seems OK here. It was close to end before.
ui->milkyWayBrightnessDoubleSpinBox->setValue(mw->getIntensity()); connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetIt
connect(ui->milkyWayBrightnessDoubleSpinBox, SIGNAL(valueChanged(dou em *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWi
ble)), mw, SLOT(setIntensity(double))); dgetItem*)));
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());
connect(ui->starTwinkleAmountDoubleSpinBox, SIGNAL(valueChanged(doub
le)), StelApp::getInstance().getCore()->getSkyDrawer(), SLOT(setTwinkleAmou
nt(double)));
ui->adaptationCheckbox->setChecked(StelApp::getInstance().getCore()- // Stars section
>getSkyDrawer()->getFlagLuminanceAdaptation()); connectGroupBox(ui->starGroupBox, "actionShow_Stars"); // NEW FROM T
connect(ui->adaptationCheckbox, SIGNAL(toggled(bool)), StelApp::getI RUNK
nstance().getCore()->getSkyDrawer(), SLOT(setFlagLuminanceAdaptation(bool)) connectBoolProperty(ui->starTwinkleCheckBox, "StelSkyDrawer.flagTwin
); kle");
connectDoubleProperty(ui->starScaleRadiusDoubleSpinBox,"StelSkyDrawe
r.absoluteStarScale");
connectDoubleProperty(ui->starRelativeScaleDoubleSpinBox, "StelSkyDr
awer.relativeStarScale");
connectDoubleProperty(ui->milkyWayBrightnessDoubleSpinBox, "MilkyWay
.intensity");
connectBoolProperty(ui->zodiacalLightCheckBox, "ZodiacalLight.flagZo
diacalLightDisplayed");
connectDoubleProperty(ui->zodiacalLightBrightnessDoubleSpinBox, "Zod
iacalLight.intensity");
connectDoubleProperty(ui->starTwinkleAmountDoubleSpinBox, "StelSkyDr
awer.twinkleAmount");
connectBoolProperty(ui->adaptationCheckbox, "StelSkyDrawer.flagLumin
anceAdaptation");
// Limit Magnitudes // Limit Magnitudes
const StelSkyDrawer* drawer = StelApp::getInstance().getCore()->getS kyDrawer();
// Stars // Stars
ui->starLimitMagnitudeCheckBox->setChecked(drawer->getFlagStarMagnit connectBoolProperty(ui->starLimitMagnitudeCheckBox,"StelSkyDrawer.fl
udeLimit()); agStarMagnitudeLimit");
ui->starLimitMagnitudeDoubleSpinBox->setValue(drawer->getCustomStarM connectDoubleProperty(ui->starLimitMagnitudeDoubleSpinBox, "StelSkyD
agnitudeLimit()); rawer.customStarMagLimit");
// Planets // Planets
ui->planetLimitMagnitudeCheckBox->setChecked(drawer->getFlagPlanetMa connectBoolProperty(ui->planetLimitMagnitudeCheckBox,"StelSkyDrawer.
gnitudeLimit()); flagPlanetMagnitudeLimit");
ui->planetLimitMagnitudeDoubleSpinBox->setValue(drawer->getCustomPla connectDoubleProperty(ui->planetLimitMagnitudeDoubleSpinBox,"StelSky
netMagnitudeLimit()); Drawer.customPlanetMagLimit");
// DSO // DSO
ui->nebulaLimitMagnitudeCheckBox->setChecked(drawer->getFlagNebulaMa connectBoolProperty(ui->nebulaLimitMagnitudeCheckBox,"StelSkyDrawer.
gnitudeLimit()); flagNebulaMagnitudeLimit");
ui->nebulaLimitMagnitudeDoubleSpinBox->setValue(drawer->getCustomNeb connectDoubleProperty(ui->nebulaLimitMagnitudeDoubleSpinBox,"StelSky
ulaMagnitudeLimit()); Drawer.customNebulaMagLimit");
connect(ui->starLimitMagnitudeCheckBox, SIGNAL(toggled(bool)),
drawer, SLOT(setFlagStarMagnitudeLimit(bool)));
connect(ui->planetLimitMagnitudeCheckBox, SIGNAL(toggled(bool)),
drawer, SLOT(setFlagPlanetMagnitudeLimit(bool)));
connect(ui->nebulaLimitMagnitudeCheckBox, SIGNAL(toggled(bool)),
drawer, SLOT(setFlagNebulaMagnitudeLimit(bool)));
connect(ui->starLimitMagnitudeDoubleSpinBox, SIGNAL(valueChanged(dou
ble)),
drawer, SLOT(setCustomStarMagnitudeLimit(double)));
connect(ui->planetLimitMagnitudeDoubleSpinBox, SIGNAL(valueChanged(d
ouble)),
drawer, SLOT(setCustomPlanetMagnitudeLimit(double)));
connect(ui->nebulaLimitMagnitudeDoubleSpinBox,
SIGNAL(valueChanged(double)),
drawer, SLOT(setCustomNebulaMagnitudeLimit(double)));
// Planets section // Planets section
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem); //connectCheckBox(ui->showPlanetCheckBox, "actionShow_Planets"); //
ui->showPlanetCheckBox->setChecked(ssmgr->getFlagPlanets()); ui element MAY HAVE BEEN RENAMED IN TRUNK?
connect(ui->showPlanetCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT(s connectGroupBox(ui->planetsGroupBox, "actionShow_Planets"); // THIS
etFlagPlanets(bool))); ONE FROM TRUNK
connectCheckBox(ui->planetMarkerCheckBox, "actionShow_Planets_Hints"
ui->planetMarkerCheckBox->setChecked(ssmgr->getFlagHints()); );
connect(ui->planetMarkerCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT
(setFlagHints(bool))); connectBoolProperty(ui->planetScaleMoonCheckBox, "SolarSystem.flagMo
onScale");
ui->planetScaleMoonCheckBox->setChecked(ssmgr->getFlagMoonScale()); connectDoubleProperty(ui->moonScaleFactor,"SolarSystem.moonScale");
connect(ui->planetScaleMoonCheckBox, SIGNAL(toggled(bool)), ssmgr, S
LOT(setFlagMoonScale(bool))); connectCheckBox(ui->planetOrbitCheckBox, "actionShow_Planets_Orbits"
ui->moonScaleFactor->setValue(ssmgr->getMoonScale()); );
connect(ui->moonScaleFactor, SIGNAL(valueChanged(double)), ssmgr, SL connectBoolProperty(ui->planetIsolatedOrbitCheckBox, "SolarSystem.fl
OT(setMoonScale(double))); agIsolatedOrbits");
connectBoolProperty(ui->planetIsolatedTrailsCheckBox, "SolarSystem.f
ui->planetOrbitCheckBox->setChecked(ssmgr->getFlagOrbits()); lagIsolatedTrails");
connect(ui->planetOrbitCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT( connectBoolProperty(ui->planetLightSpeedCheckBox, "SolarSystem.flagL
setFlagOrbits(bool))); ightTravelTime");
ui->planetIsolatedOrbitCheckBox->setChecked(ssmgr->getFlagIsolatedOr
bits());
connect(ui->planetIsolatedOrbitCheckBox, SIGNAL(toggled(bool)), ssmg
r, SLOT(setFlagIsolatedOrbits(bool)));
ui->planetIsolatedTrailsCheckBox->setChecked(ssmgr->getFlagIsolatedT
rails());
connect(ui->planetIsolatedTrailsCheckBox, SIGNAL(toggled(bool)), ssm
gr, SLOT(setFlagIsolatedTrails(bool)));
ui->planetLightSpeedCheckBox->setChecked(ssmgr->getFlagLightTravelTi // NEW SECTION FROM TRUNK: GreatRedSpot (Jupiter)
me()); // TODO: put under Properties system!
connect(ui->planetLightSpeedCheckBox, SIGNAL(toggled(bool)), ssmgr, SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
SLOT(setFlagLightTravelTime(bool))); Q_ASSERT(ssmgr);
bool grsFlag = ssmgr->getFlagCustomGrsSettings();
ui->customGrsSettingsCheckBox->setChecked(grsFlag);
connect(ui->customGrsSettingsCheckBox, SIGNAL(toggled(bool)), this,
SLOT(setFlagCustomGrsSettings(bool)));
ui->pushButtonGrsDetails->setEnabled(grsFlag);
connect(ui->pushButtonGrsDetails, SIGNAL(clicked()), this, SLOT(show
GreatRedSpotDialog()));
// Shooting stars section // Shooting stars section
SporadicMeteorMgr* mmgr = GETSTELMODULE(SporadicMeteorMgr); SporadicMeteorMgr* mmgr = GETSTELMODULE(SporadicMeteorMgr);
Q_ASSERT(mmgr); Q_ASSERT(mmgr);
connect(mmgr, SIGNAL(zhrChanged(int)), this, SLOT(setZHR(int))); int zhr = mmgr->getZHR();
connect(ui->zhrSlider, SIGNAL(valueChanged(int)), this, SLOT(setZHR( ui->zhrSlider->setValue(zhr);
int))); ui->zhrSpinBox->setValue(zhr);
connect(ui->zhrSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setZHR updateZhrDescription(zhr);
(int))); //connect to the data, instead of the GUI
setZHR(mmgr->getZHR()); connect(mmgr, SIGNAL(zhrChanged(int)), this, SLOT(updateZhrDescripti
on(int)));
connect(mmgr, SIGNAL(zhrChanged(int)), ui->zhrSlider, SLOT(setValue(
int)));
connect(mmgr, SIGNAL(zhrChanged(int)), ui->zhrSpinBox, SLOT(setValue
(int)));
connect(ui->zhrSlider, SIGNAL(valueChanged(int)), mmgr, SLOT(setZHR(
int)));
connect(ui->zhrSpinBox, SIGNAL(valueChanged(int)), mmgr, SLOT(setZHR
(int)));
// Labels section // Labels section
StarMgr* smgr = GETSTELMODULE(StarMgr);
connectCheckBox(ui->starLabelCheckBox, "actionShow_Stars_Labels"); connectCheckBox(ui->starLabelCheckBox, "actionShow_Stars_Labels");
connectGroupBox(ui->groupBoxLabelsAndMarkers, "actionShow_Nebulas"); connectGroupBox(ui->groupBoxLabelsAndMarkers, "actionShow_Nebulas");
connectCheckBox(ui->planetLabelCheckBox, "actionShow_Planets_Labels" ); connectCheckBox(ui->planetLabelCheckBox, "actionShow_Planets_Labels" );
ui->starsLabelsHorizontalSlider->setValue((int)(smgr->getLabelsAmoun connectDoubleProperty(ui->starsLabelsHorizontalSlider,"StarMgr.label
t()*10.f)); sAmount",0.0,10.0);
connect(ui->starsLabelsHorizontalSlider, SIGNAL(valueChanged(int)), connectDoubleProperty(ui->planetsLabelsHorizontalSlider, "SolarSyste
this, SLOT(starsLabelsValueChanged(int))); m.labelsAmount",0.0,10.0);
ui->planetsLabelsHorizontalSlider->setValue((int)(ssmgr->getLabelsAm connectDoubleProperty(ui->nebulasLabelsHorizontalSlider, "NebulaMgr.
ount()*10.f)); labelsAmount",0.0,10.0);
connect(ui->planetsLabelsHorizontalSlider, SIGNAL(valueChanged(int)) connectDoubleProperty(ui->nebulasHintsHorizontalSlider, "NebulaMgr.h
, this, SLOT(planetsLabelsValueChanged(int))); intsAmount",0.0,10.0);
ui->nebulasLabelsHorizontalSlider->setValue((int)(nmgr->getLabelsAmo
unt()*10.f));
connect(ui->nebulasLabelsHorizontalSlider, SIGNAL(valueChanged(int))
, this, SLOT(nebulasLabelsValueChanged(int)));
ui->nebulasHintsHorizontalSlider->setValue((int)(nmgr->getHintsAmoun
t()*10.f));
connect(ui->nebulasHintsHorizontalSlider, SIGNAL(valueChanged(int)),
this, SLOT(nebulasMarkersValueChanged(int)));
// Landscape section // Landscape section
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
Q_ASSERT(lmgr);
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"); connectCheckBox(ui->landscapeIlluminationCheckBox, "actionShow_Lands capeIllumination");
connectCheckBox(ui->landscapeLabelsCheckBox, "actionShow_LandscapeLa bels"); connectCheckBox(ui->landscapeLabelsCheckBox, "actionShow_LandscapeLa bels");
ui->landscapePositionCheckBox->setChecked(lmgr->getFlagLandscapeSets connectBoolProperty(ui->landscapePositionCheckBox, "LandscapeMgr.fla
Location()); gLandscapeSetsLocation");
connect(ui->landscapePositionCheckBox, SIGNAL(toggled(bool)), lmgr,
SLOT(setFlagLandscapeSetsLocation(bool))); connectBoolProperty(ui->landscapeBrightnessCheckBox,"LandscapeMgr.fl
agLandscapeUseMinimalBrightness");
connect(lmgr,SIGNAL(flagLandscapeUseMinimalBrightnessChanged(bool)),
ui->localLandscapeBrightnessCheckBox,SLOT(setEnabled(bool)));
connect(lmgr,SIGNAL(flagLandscapeUseMinimalBrightnessChanged(bool)),
ui->landscapeBrightnessSpinBox,SLOT(setEnabled(bool)));
ui->localLandscapeBrightnessCheckBox->setEnabled(lmgr->getFlagLandsc
apeUseMinimalBrightness());
ui->landscapeBrightnessSpinBox->setEnabled(lmgr->getFlagLandscapeUse
MinimalBrightness());
connectDoubleProperty(ui->landscapeBrightnessSpinBox,"LandscapeMgr.d
efaultMinimalBrightness");
connectBoolProperty(ui->localLandscapeBrightnessCheckBox,"LandscapeM
gr.flagLandscapeSetsMinimalBrightness");
connect(ui->landscapesListWidget, SIGNAL(currentItemChanged(QListWid
getItem*,QListWidgetItem*)), this, SLOT(changeLandscape(QListWidgetItem*)))
;
connect(lmgr, SIGNAL(currentLandscapeChanged(QString,QString)), this
, SLOT(landscapeChanged(QString,QString)));
connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this,
SLOT(setCurrentLandscapeAsDefault()));
connect(lmgr,SIGNAL(defaultLandscapeChanged(QString)),this,SLOT(upda
teDefaultLandscape()));
updateDefaultLandscape();
ui->landscapeBrightnessCheckBox->setChecked(lmgr->getFlagLandscapeUs connect(lmgr, SIGNAL(landscapesChanged()), this, SLOT(populateLists(
eMinimalBrightness()); )));
connect(ui->landscapeBrightnessCheckBox, SIGNAL(toggled(bool)), this connect(ui->pushButtonAddRemoveLandscapes, SIGNAL(clicked()), this,
, SLOT(setFlagLandscapeUseMinimalBrightness(bool))); SLOT(showAddRemoveLandscapesDialog()));
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
StelSkyDrawer* drawer = StelApp::getInstance().getCore()->getSkyDraw
er();
// TODO: In trunk, populateLightPollution has been added, while soci
s has setLightPollutionSpinBoxStatus.
// The trunk version also sets value of the spinbox, this seems more
complete.
//setLightPollutionSpinBoxStatus();
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)), ui->useLocat
ionDataCheckBox, SLOT(setChecked(bool)));
// TODO: Decide which is better?
//connect(lmgr, SIGNAL(lightPollutionUsageChanged(bool)), this, SLOT
(setLightPollutionSpinBoxStatus()));
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)), StelAp
p::getInstance().getCore()->getSkyDrawer(), SLOT(setBortleScaleIndex(int)))
;
connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), this,
SLOT(setBortleScaleToolTip(int)));
ui->autoChangeLandscapesCheckBox->setChecked(lmgr->getFlagLandscapeA ui->lightPollutionSpinBox->setValue(drawer->getBortleScaleIndex());
utoSelection()); connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), drawer
connect(ui->autoChangeLandscapesCheckBox, SIGNAL(toggled(bool)), lmg , SLOT(setBortleScaleIndex(int)));
r, SLOT(setFlagLandscapeAutoSelection(bool))); connect(drawer, SIGNAL(bortleScaleIndexChanged(int)), ui->lightPollu
tionSpinBox, SLOT(setValue(int)));
connect(drawer, SIGNAL(bortleScaleIndexChanged(int)), this, SLOT(set
BortleScaleToolTip(int)));
// Note: This has vanished in the merge on 20160411. -- Ah, moved to
ConfigurationDialog.
//connectBoolProperty(ui->autoChangeLandscapesCheckBox,"LandscapeMgr
.flagLandscapeAutoSelection");
// atmosphere details // atmosphere details
connect(ui->pushButtonAtmosphereDetails, SIGNAL(clicked()), this, SL OT(showAtmosphereDialog())); connect(ui->pushButtonAtmosphereDetails, SIGNAL(clicked()), this, SL OT(showAtmosphereDialog()));
ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getCurrentLandsc
apeID()==lmgr->getDefaultLandscapeID());
ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getCurrentLandsc
apeID()!=lmgr->getDefaultLandscapeID());
connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this,
SLOT(setCurrentLandscapeAsDefault()));
connect(GETSTELMODULE(LandscapeMgr), SIGNAL(landscapesChanged()), th
is, SLOT(populateLists()));
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");
connectCheckBox(ui->showEquatorJ2000LineCheckBox, "actionShow_Equato r_J2000_Line"); connectCheckBox(ui->showEquatorJ2000LineCheckBox, "actionShow_Equato r_J2000_Line");
connectCheckBox(ui->showEclipticLineJ2000CheckBox, "actionShow_Eclip tic_J2000_Line"); connectCheckBox(ui->showEclipticLineJ2000CheckBox, "actionShow_Eclip tic_J2000_Line");
connectCheckBox(ui->showEclipticLineOfDateCheckBox, "actionShow_Ecli ptic_Line"); connectCheckBox(ui->showEclipticLineOfDateCheckBox, "actionShow_Ecli ptic_Line");
connectCheckBox(ui->showMeridianLineCheckBox, "actionShow_Meridian_L ine"); connectCheckBox(ui->showMeridianLineCheckBox, "actionShow_Meridian_L ine");
connectCheckBox(ui->showLongitudeLineCheckBox, "actionShow_Longitude _Line"); connectCheckBox(ui->showLongitudeLineCheckBox, "actionShow_Longitude _Line");
connectCheckBox(ui->showHorizonLineCheckBox, "actionShow_Horizon_Lin e"); connectCheckBox(ui->showHorizonLineCheckBox, "actionShow_Horizon_Lin e");
connectCheckBox(ui->showEquatorialGridCheckBox, "actionShow_Equatori al_Grid"); connectCheckBox(ui->showEquatorialGridCheckBox, "actionShow_Equatori al_Grid");
connectCheckBox(ui->showGalacticGridCheckBox, "actionShow_Galactic_G rid"); connectCheckBox(ui->showGalacticGridCheckBox, "actionShow_Galactic_G rid");
connectCheckBox(ui->showGalacticEquatorLineCheckBox, "actionShow_Gal actic_Equator_Line"); connectCheckBox(ui->showGalacticEquatorLineCheckBox, "actionShow_Gal actic_Equator_Line");
connectCheckBox(ui->showAzimuthalGridCheckBox, "actionShow_Azimuthal _Grid"); connectCheckBox(ui->showAzimuthalGridCheckBox, "actionShow_Azimuthal _Grid");
connectCheckBox(ui->showEquatorialJ2000GridCheckBox, "actionShow_Equ atorial_J2000_Grid"); connectCheckBox(ui->showEquatorialJ2000GridCheckBox, "actionShow_Equ atorial_J2000_Grid");
connectCheckBox(ui->showEclipticGridJ2000CheckBox, "actionShow_Eclip tic_J2000_Grid"); connectCheckBox(ui->showEclipticGridJ2000CheckBox, "actionShow_Eclip tic_J2000_Grid");
connectCheckBox(ui->showEclipticGridOfDateCheckBox, "actionShow_Ecli ptic_Grid"); connectCheckBox(ui->showEclipticGridOfDateCheckBox, "actionShow_Ecli ptic_Grid");
connectCheckBox(ui->showCardinalPointsCheckBox, "actionShow_Cardinal _Points"); connectCheckBox(ui->showCardinalPointsCheckBox, "actionShow_Cardinal _Points");
connectCheckBox(ui->showPrecessionCirclesCheckBox, "actionShow_Prece ssion_Circles"); connectCheckBox(ui->showPrecessionCirclesCheckBox, "actionShow_Prece ssion_Circles");
connectCheckBox(ui->showPrimeVerticalLineCheckBox, "actionShow_Prime
_Vertical_Line");
connectCheckBox(ui->showColuresLineCheckBox, "actionShow_Colure_Line
s");
connectCheckBox(ui->showCircumpolarCirclesCheckBox, "actionShow_Circ
umpolar_Circles");
// Constellations // Constellations
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
connectCheckBox(ui->showConstellationLinesCheckBox, "actionShow_Cons tellation_Lines"); connectCheckBox(ui->showConstellationLinesCheckBox, "actionShow_Cons tellation_Lines");
connectCheckBox(ui->showConstellationLabelsCheckBox, "actionShow_Con stellation_Labels"); connectCheckBox(ui->showConstellationLabelsCheckBox, "actionShow_Con stellation_Labels");
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()); connectDoubleProperty(ui->constellationArtBrightnessSpinBox,"Constel
connect(ui->constellationArtBrightnessSpinBox, SIGNAL(valueChanged(d lationMgr.artIntensity");
ouble)), cmgr, SLOT(setArtIntensity(double))); connectDoubleProperty(ui->constellationLineThicknessSpinBox,"Constel
ui->constellationLineThicknessSpinBox->setValue(cmgr->getConstellati lationMgr.constellationLineThickness");
onLineThickness());
connect(ui->constellationLineThicknessSpinBox, SIGNAL(valueChanged(d
ouble)), cmgr, SLOT(setConstellationLineThickness(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 connect(&StelApp::getInstance().getSkyCultureMgr(), SIGNAL(defaultSk
kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu yCultureChanged(QString)),this,SLOT(updateDefaultSkyCulture()));
reID(); updateDefaultSkyCulture();
ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b); connectCheckBox(ui->nativeNameCheckBox,"actionShow_Skyculture_Native
connect(ui->nativeNameCheckBox, SIGNAL(clicked(bool)), ssmgr, SLOT(s names");
etFlagNativeNames(bool)));
ui->nativeNameCheckBox->setChecked(ssmgr->getFlagNativeNames()); // allow to display short names and inhibit translation.
// GZ NEW allow to display short names and inhibit translation. connectIntProperty(ui->skyCultureNamesStyleComboBox,"ConstellationMg
connect(ui->skyCultureNamesStyleComboBox, SIGNAL(currentIndexChanged r.constellationDisplayStyle");
(int)), cmgr, SLOT(setConstellationDisplayStyle(int)));
// Sky layers. This not yet finished and not visible in releases. // Sky layers. This not yet finished and not visible in releases.
// TODO: These 4 lines are commented away in trunk.
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->skyLayerEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(skyLayersEnabledChanged(int))); connect(ui->skyLayerEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(skyLayersEnabledChanged(int)));
QTimer* refreshTimer = new QTimer(this);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(updateFromProgra
m()));
refreshTimer->start(200);
updateTabBarListWidgetWidth(); updateTabBarListWidgetWidth();
} }
void ViewDialog::updateTabBarListWidgetWidth() void ViewDialog::updateTabBarListWidgetWidth()
{ {
ui->stackListWidget->setWrapping(false); ui->stackListWidget->setWrapping(false);
// Update list item sizes after translation // Update list item sizes after translation
ui->stackListWidget->adjustSize(); ui->stackListWidget->adjustSize();
skipping to change at line 487 skipping to change at line 478
ui->checkBoxInteractingGalaxiesType->setChecked(flags & Nebula::Type InteractingGalaxies); ui->checkBoxInteractingGalaxiesType->setChecked(flags & Nebula::Type InteractingGalaxies);
ui->checkBoxStarClustersType->setChecked(flags & Nebula::TypeStarClu sters); ui->checkBoxStarClustersType->setChecked(flags & Nebula::TypeStarClu sters);
ui->checkBoxBrightNebulaeType->setChecked(flags & Nebula::TypeBright Nebulae); ui->checkBoxBrightNebulaeType->setChecked(flags & Nebula::TypeBright Nebulae);
ui->checkBoxDarkNebulaeType->setChecked(flags & Nebula::TypeDarkNebu lae); ui->checkBoxDarkNebulaeType->setChecked(flags & Nebula::TypeDarkNebu lae);
ui->checkBoxPlanetaryNebulaeType->setChecked(flags & Nebula::TypePla netaryNebulae); ui->checkBoxPlanetaryNebulaeType->setChecked(flags & Nebula::TypePla netaryNebulae);
ui->checkBoxHydrogenRegionsType->setChecked(flags & Nebula::TypeHydr ogenRegions); ui->checkBoxHydrogenRegionsType->setChecked(flags & Nebula::TypeHydr ogenRegions);
ui->checkBoxSupernovaRemnantsType->setChecked(flags & Nebula::TypeSu pernovaRemnants); ui->checkBoxSupernovaRemnantsType->setChecked(flags & Nebula::TypeSu pernovaRemnants);
ui->checkBoxOtherType->setChecked(flags & Nebula::TypeOther); ui->checkBoxOtherType->setChecked(flags & Nebula::TypeOther);
} }
void ViewDialog::setFlagLandscapeUseMinimalBrightness(bool b) void ViewDialog::setFlagCustomGrsSettings(bool b)
{ {
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); GETSTELMODULE(SolarSystem)->setFlagCustomGrsSettings(b);
lmgr->setFlagLandscapeUseMinimalBrightness(b); ui->pushButtonGrsDetails->setEnabled(b);
populateLandscapeMinimalBrightness(); if (!b)
} greatRedSpotDialog->setVisible(false);
void ViewDialog::populateLandscapeMinimalBrightness()
{
if (ui->landscapeBrightnessCheckBox->isChecked())
{
ui->localLandscapeBrightnessCheckBox->setEnabled(true);
ui->landscapeBrightnessSpinBox->setEnabled(true);
}
else
{
ui->localLandscapeBrightnessCheckBox->setEnabled(false);
ui->landscapeBrightnessSpinBox->setEnabled(false);
}
} }
// 20160411. New function introduced with trunk merge. Not sure yet if usef ul or bad with property connections?.
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 529 skipping to change at line 508
if (bIdx<1) // ...or it observatory, or it unknown location if (bIdx<1) // ...or it observatory, or it unknown location
bIdx = loc.DEFAULT_BORTLE_SCALE_INDEX; bIdx = loc.DEFAULT_BORTLE_SCALE_INDEX;
ui->lightPollutionSpinBox->setEnabled(false); ui->lightPollutionSpinBox->setEnabled(false);
} }
else else
ui->lightPollutionSpinBox->setEnabled(true); ui->lightPollutionSpinBox->setEnabled(true);
ui->lightPollutionSpinBox->setValue(bIdx); ui->lightPollutionSpinBox->setValue(bIdx);
setBortleScaleToolTip(bIdx); setBortleScaleToolTip(bIdx);
} }
// The version from socis only enables the spinbox without setting its valu
e. TODO: Decide which is better?
void ViewDialog::setLightPollutionSpinBoxStatus()
{
LandscapeMgr *lmgr = GETSTELMODULE(LandscapeMgr);
ui->lightPollutionSpinBox->setEnabled(!lmgr->getFlagUseLightPollutio
nFromDatabase());
}
void ViewDialog::setBortleScaleToolTip(int Bindex) void ViewDialog::setBortleScaleToolTip(int Bindex)
{ {
int i = Bindex-1; int i = Bindex-1;
QStringList list, nelm; QStringList list, nelm;
//TRANSLATORS: Short description for Class 1 of the Bortle scale //TRANSLATORS: Short description for Class 1 of the Bortle scale
list.append(q_("Excellent dark-sky site")); list.append(q_("Excellent dark-sky site"));
//TRANSLATORS: Short description for Class 2 of the Bortle scale //TRANSLATORS: Short description for Class 2 of the Bortle scale
list.append(q_("Typical truly dark site")); list.append(q_("Typical truly dark site"));
//TRANSLATORS: Short description for Class 3 of the Bortle scale //TRANSLATORS: Short description for Class 3 of the Bortle scale
skipping to change at line 643 skipping to change at line 628
{ {
if (l->item(i)->data(Qt::UserRole).toString() == selectedLan dscapeName) 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 updateDefaultLandscape();
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);
ui->skyLayerListWidget->addItems(skyLayerMgr->getAllKeys()); ui->skyLayerListWidget->addItems(skyLayerMgr->getAllKeys());
} }
void ViewDialog::skyLayersSelectionChanged(const QString& s) void ViewDialog::skyLayersSelectionChanged(const QString& s)
skipping to change at line 678 skipping to change at line 662
ui->skyLayerTextBrowser->setHtml(html); ui->skyLayerTextBrowser->setHtml(html);
ui->skyLayerEnableCheckBox->setChecked(skyLayerMgr->getShowLayer(s)) ; ui->skyLayerEnableCheckBox->setChecked(skyLayerMgr->getShowLayer(s)) ;
} }
void ViewDialog::skyLayersEnabledChanged(int state) void ViewDialog::skyLayersEnabledChanged(int state)
{ {
StelSkyLayerMgr* skyLayerMgr = GETSTELMODULE(StelSkyLayerMgr); StelSkyLayerMgr* skyLayerMgr = GETSTELMODULE(StelSkyLayerMgr);
skyLayerMgr->showLayer(ui->skyLayerListWidget->currentItem()->text() , state); skyLayerMgr->showLayer(ui->skyLayerListWidget->currentItem()->text() , state);
} }
void ViewDialog::skyCultureChanged(const QString& cultureName) void ViewDialog::skyCultureChanged()
{ {
StelApp::getInstance().getSkyCultureMgr().setCurrentSkyCultureNameI1 QListWidget* l = ui->culturesListWidget;
8(cultureName); l->setCurrentItem(l->findItems(StelApp::getInstance().getSkyCultureM
gr().getCurrentSkyCultureNameI18(), Qt::MatchExactly).at(0));
updateSkyCultureText(); updateSkyCultureText();
const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS updateDefaultSkyCulture();
kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu
reID();
ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
} }
// fill the description text window, not the names in the sky. // 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 html = app.getSkyCultureMgr().getCurrentSkyCultureHtmlDescri
if (!QString("pt_BR zh_CN zh_HK zh_TW").contains(lang)) ption();
{
lang = lang.split("_").at(0);
}
QString descPath = StelFileMgr::findFile("skycultures/" + skyCulture
Id + "/description."+lang+".utf8");
if (descPath.isEmpty())
{
descPath = StelFileMgr::findFile("skycultures/" + skyCulture
Id + "/description.en.utf8");
if (descPath.isEmpty())
qWarning() << "WARNING: can't find description for s
kyculture" << skyCultureId;
}
QStringList searchPaths; QStringList searchPaths;
searchPaths << StelFileMgr::findFile("skycultures/" + skyCultureId); searchPaths << StelFileMgr::findFile("skycultures/" + skyCultureId);
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));
ui->skyCultureTextBrowser->setHtml(html);
if (descPath.isEmpty())
{
ui->skyCultureTextBrowser->setHtml(q_("No description"));
}
else
{
QFile f(descPath);
QString htmlFile;
if(f.open(QIODevice::ReadOnly))
{
htmlFile = QString::fromUtf8(f.readAll());
f.close();
}
ui->skyCultureTextBrowser->setHtml(htmlFile);
}
} }
void ViewDialog::projectionChanged(const QString& projectionNameI18n) void ViewDialog::changeProjection(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(
));
Q_ASSERT(gui);
ui->projectionTextBrowser->document()->setDefaultStyleSheet(QString(
gui->getStelStyle().htmlStyleSheet));
ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::Fra
meJ2000)->getHtmlSummary());
} }
void ViewDialog::viewportVerticalShiftChanged(const int shift) void ViewDialog::projectionChanged()
{ {
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
StelProjector::StelProjectorParams params=core->getCurrentStelProjec QListWidget* l = ui->projectionListWidget;
torParams(); l->setCurrentItem(l->findItems(core->projectionTypeKeyToNameI18n(cor
params.viewportCenterOffset[1]=qMax(-0.5f, qMin(shift/100.0f, 0.5f)) e->getCurrentProjectionTypeKey()), Qt::MatchExactly).at(0),QItemSelectionMo
; // Sanity check del::SelectCurrent);
ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::Fra
params.viewportCenter.set(params.viewportXywh[0]+(0.5f+params.viewpo meJ2000)->getHtmlSummary());
rtCenterOffset.v[0])*params.viewportXywh[2],
params.viewportXywh[1]+(0.5f+params.viewpo
rtCenterOffset.v[1])*params.viewportXywh[3]);
core->setCurrentStelProjectorParams(params);
} }
void ViewDialog::landscapeChanged(QListWidgetItem* item) void ViewDialog::changeLandscape(QListWidgetItem* item)
{ {
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
lmgr->setCurrentLandscapeName(item->data(Qt::UserRole).toString()); lmgr->setCurrentLandscapeName(item->data(Qt::UserRole).toString());
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( }
));
Q_ASSERT(gui); void ViewDialog::landscapeChanged(QString id, QString name)
ui->landscapeTextBrowser->document()->setDefaultStyleSheet(QString(g {
ui->getStelStyle().htmlStyleSheet)); Q_UNUSED(id)
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
for (int i = 0; i < ui->landscapesListWidget->count(); i++)
{
if (ui->landscapesListWidget->item(i)->data(Qt::UserRole).to
String() == name)
{
ui->landscapesListWidget->setCurrentRow(i, QItemSele
ctionModel::SelectCurrent);
break;
}
}
ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescr iption()); ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescr iption());
ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getDefaultLandsc updateDefaultLandscape();
apeID()==lmgr->getCurrentLandscapeID());
ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getDefaultLandsc
apeID()!=lmgr->getCurrentLandscapeID());
// Reset values that might have changed. // Reset values that might have changed.
ui->showFogCheckBox->setChecked(lmgr->getFlagFog()); ui->showFogCheckBox->setChecked(lmgr->getFlagFog());
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);
} }
void ViewDialog::showAtmosphereDialog() void ViewDialog::showAtmosphereDialog()
{ {
if(atmosphereDialog == NULL) if(atmosphereDialog == NULL)
atmosphereDialog = new AtmosphereDialog(); atmosphereDialog = new AtmosphereDialog();
atmosphereDialog->setVisible(true); atmosphereDialog->setVisible(true);
} }
void ViewDialog::setZHR(int zhr) void ViewDialog::showGreatRedSpotDialog()
{ {
SporadicMeteorMgr* mmgr = GETSTELMODULE(SporadicMeteorMgr); if(greatRedSpotDialog == NULL)
mmgr->blockSignals(true); greatRedSpotDialog = new GreatRedSpotDialog();
ui->zhrSlider->blockSignals(true);
ui->zhrSpinBox->blockSignals(true);
mmgr->setFlagShow(zhr > 0);
mmgr->setZHR(zhr);
ui->zhrSlider->setValue(zhr);
ui->zhrSpinBox->setValue(zhr);
updateZhrDescription();
mmgr->blockSignals(false); greatRedSpotDialog->setVisible(true);
ui->zhrSlider->blockSignals(false);
ui->zhrSpinBox->blockSignals(false);
}
void ViewDialog::updateZhrDescription()
{
int zhr = ui->zhrSpinBox->value();
switch (zhr)
{
case 0:
ui->zhrLabel->setText("<small><i>"+q_("No shooting s
tars")+"</i></small>");
break;
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
ui->zhrLabel->setText("<small><i>"+q_("Normal rate")
+"</i></small>");
break;
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>");
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:
ui->zhrLabel->setText("<small><i>"+q_("Meteor storm
rate")+"</i></small>");
break;
case 6000:
ui->zhrLabel->setText("<small><i>"+q_("Exceptional D
raconid rate")+"</i></small>");
break;
case 10000:
ui->zhrLabel->setText("<small><i>"+q_("Exceptional L
eonid rate")+"</i></small>");
break;
case 144000:
ui->zhrLabel->setText("<small><i>"+q_("Very high rat
e (1966 Leonids)")+"</i></small>");
break;
case 240000:
ui->zhrLabel->setText("<small><i>"+q_("Highest rate
ever (1833 Leonids)")+"</i></small>");
break;
default:
ui->zhrLabel->setText("");
break;
}
} }
void ViewDialog::starsLabelsValueChanged(int v) void ViewDialog::updateZhrDescription(int zhr)
{ {
StarMgr* smgr = GETSTELMODULE(StarMgr); // GZ changed to small regions instead of hard "case" to better see
float a= ((float)v)/10.f; a manual setting.
smgr->setLabelsAmount(a); if (zhr==0)
ui->zhrLabel->setText("<small><i>"+q_("No shooting stars")+"
</i></small>");
else if (zhr<=10)
ui->zhrLabel->setText("<small><i>"+q_("Normal rate")+"</i></
small>");
else if ((zhr>=20) && (zhr<=30)) // was 25
ui->zhrLabel->setText("<small><i>"+q_("Standard Orionids rat
e")+"</i></small>");
else if ((zhr>=90) && (zhr<=110)) // was 100
ui->zhrLabel->setText("<small><i>"+q_("Standard Perseids rat
e")+"</i></small>");
else if ((zhr>=108) && (zhr<=132)) // was 120
ui->zhrLabel->setText("<small><i>"+q_("Standard Geminids rat
e")+"</i></small>");
else if ((zhr>=180) && (zhr<=220)) // was 200
ui->zhrLabel->setText("<small><i>"+q_("Exceptional Perseid r
ate")+"</i></small>");
else if ((zhr>=900) && (zhr<=1100)) // was 1000
ui->zhrLabel->setText("<small><i>"+q_("Meteor storm rate")+"
</i></small>");
else if ((zhr>=5400) && (zhr<=6600)) // was 6000
ui->zhrLabel->setText("<small><i>"+q_("Exceptional Draconid
rate")+"</i></small>");
else if ((zhr>=9000) && (zhr<=11000)) // was 10000
ui->zhrLabel->setText("<small><i>"+q_("Exceptional Leonid ra
te")+"</i></small>");
else if ((zhr>=130000) && (zhr<=160000)) // was 144000
ui->zhrLabel->setText("<small><i>"+q_("Very high rate (1966
Leonids)")+"</i></small>");
else if (zhr>=230000) // was 240000
ui->zhrLabel->setText("<small><i>"+q_("Highest rate ever (18
33 Leonids)")+"</i></small>");
else
ui->zhrLabel->setText("");
} }
void ViewDialog::setCurrentLandscapeAsDefault(void) void ViewDialog::setCurrentLandscapeAsDefault(void)
{ {
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
Q_ASSERT(lmgr); Q_ASSERT(lmgr);
lmgr->setDefaultLandscapeID(lmgr->getCurrentLandscapeID()); lmgr->setDefaultLandscapeID(lmgr->getCurrentLandscapeID());
ui->useAsDefaultLandscapeCheckBox->setChecked(true);
ui->useAsDefaultLandscapeCheckBox->setEnabled(false);
} }
void ViewDialog::setCurrentCultureAsDefault(void) void ViewDialog::setCurrentCultureAsDefault(void)
{ {
StelApp::getInstance().getSkyCultureMgr().setDefaultSkyCultureID(Ste lApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID()); StelApp::getInstance().getSkyCultureMgr().setDefaultSkyCultureID(Ste lApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID());
ui->useAsDefaultSkyCultureCheckBox->setChecked(true);
ui->useAsDefaultSkyCultureCheckBox->setEnabled(false);
}
void ViewDialog::planetsLabelsValueChanged(int v)
{
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
float a= ((float)v)/10.f;
ssmgr->setLabelsAmount(a);
} }
void ViewDialog::nebulasLabelsValueChanged(int v) void ViewDialog::updateDefaultSkyCulture()
{ {
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
float a= ((float)v)/10.f;
nmgr->setLabelsAmount(a);
}
void ViewDialog::nebulasMarkersValueChanged(int v)
{
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
float a= ((float)v)/10.f;
nmgr->setHintsAmount(a);
}
// Update the widget to make sure it is synchrone if a value was changed pr
ogrammatically
void ViewDialog::updateFromProgram()
{
if (!dialog->isVisible())
return;
// Check that the useAsDefaultSkyCultureCheckBox needs to be updated // Check that the useAsDefaultSkyCultureCheckBox needs to be updated
bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCult ureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultureID() ; bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCult ureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultureID() ;
if (b!=ui->useAsDefaultSkyCultureCheckBox->isChecked()) ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
{ ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
ui->useAsDefaultSkyCultureCheckBox->setChecked(b); }
ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
}
void ViewDialog::updateDefaultLandscape()
{
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
Q_ASSERT(lmgr); Q_ASSERT(lmgr);
b = lmgr->getCurrentLandscapeID()==lmgr->getDefaultLandscapeID(); bool b = lmgr->getCurrentLandscapeID()==lmgr->getDefaultLandscapeID(
if (b!=ui->useAsDefaultLandscapeCheckBox->isChecked()) );
{ ui->useAsDefaultLandscapeCheckBox->setChecked(b);
ui->useAsDefaultLandscapeCheckBox->setChecked(b); ui->useAsDefaultLandscapeCheckBox->setEnabled(!b);
ui->useAsDefaultLandscapeCheckBox->setEnabled(!b);
}
} }
void ViewDialog::changePage(QListWidgetItem *current, QListWidgetItem *prev ious) void ViewDialog::changePage(QListWidgetItem *current, QListWidgetItem *prev ious)
{ {
if (!current) if (!current)
current = previous; current = previous;
ui->stackedWidget->setCurrentIndex(ui->stackListWidget->row(current) ); ui->stackedWidget->setCurrentIndex(ui->stackListWidget->row(current) );
} }
 End of changes. 69 change blocks. 
437 lines changed or deleted 313 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/