• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Stellarium / stellarium / 3996069357

pending completion
3996069357

push

github

Ruslan Kabatsayev
Shorten some lines

5 of 5 new or added lines in 1 file covered. (100.0%)

14663 of 124076 relevant lines covered (11.82%)

22035.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/gui/ViewDialog.cpp
1
/*
2
 * Stellarium
3
 * Copyright (C) 2008 Fabien Chereau
4
 * Copyright (C) 2012 Timothy Reaves
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
19
*/
20

21

22
#include "ViewDialog.hpp"
23
#include "ui_viewDialog.h"
24
#include "AddRemoveLandscapesDialog.hpp"
25
#include "AtmosphereDialog.hpp"
26
#include "SkylightDialog.hpp"
27
#include "TonemappingDialog.hpp"
28
#include "GreatRedSpotDialog.hpp"
29
#include "ConfigureDSOColorsDialog.hpp"
30
#include "ConfigureOrbitColorsDialog.hpp"
31
#include "StelApp.hpp"
32
#include "StelCore.hpp"
33
#include "StelSkyCultureMgr.hpp"
34
#include "StelFileMgr.hpp"
35
#include "StelProjector.hpp"
36
#include "StelModuleMgr.hpp"
37
#include "SolarSystem.hpp"
38
#include "Planet.hpp"
39
#include "NebulaMgr.hpp"
40
#include "AsterismMgr.hpp"
41
#include "StelStyle.hpp"
42
#include "StelGuiBase.hpp"
43
#include "StelGui.hpp"
44
#include "StelActionMgr.hpp"
45
#include "StelPropertyMgr.hpp"
46
#include "StelHips.hpp"
47

48
#include <QDebug>
49
#include <QFrame>
50
#include <QFile>
51
#include <QFileInfo>
52
#include <QSettings>
53
#include <QTimer>
54
#include <QDialog>
55
#include <QStringList>
56
#include <QJsonArray>
57

58
ViewDialog::ViewDialog(QObject* parent) : StelDialog("View", parent)
×
59
        , addRemoveLandscapesDialog(nullptr)
×
60
        , atmosphereDialog(nullptr)
×
61
        , skylightDialog(nullptr)
×
62
        , tonemappingDialog(nullptr)
×
63
        , greatRedSpotDialog(nullptr)
×
64
        , configureDSOColorsDialog(nullptr)
×
65
        , configureOrbitColorsDialog(nullptr)
×
66
{
67
        ui = new Ui_viewDialogForm;        
×
68
}
×
69

70
ViewDialog::~ViewDialog()
×
71
{
72
        delete ui;
×
73
        ui=nullptr;
×
74
        delete addRemoveLandscapesDialog;
×
75
        addRemoveLandscapesDialog = nullptr;
×
76
        delete atmosphereDialog;
×
77
        atmosphereDialog = nullptr;
×
78
        delete skylightDialog;
×
79
        skylightDialog = nullptr;
×
80
        delete tonemappingDialog;
×
81
        tonemappingDialog = nullptr;
×
82
        delete greatRedSpotDialog;
×
83
        greatRedSpotDialog = nullptr;
×
84
        delete configureDSOColorsDialog;
×
85
        configureDSOColorsDialog = nullptr;
×
86
        delete configureOrbitColorsDialog;
×
87
        configureOrbitColorsDialog = nullptr;
×
88
}
×
89

90
void ViewDialog::retranslate()
×
91
{
92
        if (dialog)
×
93
        {
94
                ui->retranslateUi(dialog);
×
95
                updateZhrDescription(StelApp::getInstance().getModule("SporadicMeteorMgr")->property("zhr").toInt());
×
96
                populateLists();
×
97
                populateToolTips();
×
98
                populatePlanetMagnitudeAlgorithmsList();
×
99
                populatePlanetMagnitudeAlgorithmDescription();
×
100
                ui->lightPollutionWidget->retranslate();
×
101
                populateHipsGroups();
×
102
                updateHips();
×
103
                //Hack to shrink the tabs to optimal size after language change
104
                //by causing the list items to be laid out again.
105
                updateTabBarListWidgetWidth();
×
106
        }
107
}
×
108

109
void ViewDialog::styleChanged(const QString &style)
×
110
{
111
        StelDialog::styleChanged(style);
×
112
        if (dialog)
×
113
        {
114
                populateLists();
×
115
                populateToolTips();
×
116
                populatePlanetMagnitudeAlgorithmsList();
×
117
                populatePlanetMagnitudeAlgorithmDescription();
×
118
                populateHipsGroups();
×
119
        }
120
}
×
121

122
void ViewDialog::connectGroupBox(QGroupBox* groupBox, const QString& actionId)
×
123
{
124
        StelAction* action = StelApp::getInstance().getStelActionManager()->findAction(actionId);
×
125
        Q_ASSERT(action);
×
126
        groupBox->setChecked(action->isChecked());
×
127
        connect(action, SIGNAL(toggled(bool)), groupBox, SLOT(setChecked(bool)));
×
128
        connect(groupBox, SIGNAL(toggled(bool)), action, SLOT(setChecked(bool)));
×
129
}
×
130

131
void ViewDialog::createDialogContent()
×
132
{
133
        ui->setupUi(dialog);
×
134
        connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
×
135
        // Set the Sky tab activated by default
136
        ui->stackedWidget->setCurrentIndex(0);
×
137
        ui->stackListWidget->setCurrentRow(0);
×
138
        connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
×
139
        // Kinetic scrolling
140
        kineticScrollingList << ui->projectionListWidget << ui->culturesListWidget << ui->skyCultureTextBrowser << ui->landscapesListWidget
×
141
                             << ui->landscapeTextBrowser << ui->surveysListWidget << ui->surveysTextBrowser;
×
142
        StelGui* gui= dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
×
143
        if (gui)
×
144
        {
145
                enableKineticScrolling(gui->getFlagUseKineticScrolling());
×
146
                connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));
×
147
        }
148
        connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
×
149
        connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
×
150

151
        populateLists();
×
152
        populateToolTips();
×
153
        // fixed size for buttons
154
        QSize bs = QSize(24, 24);
×
155
        ui->pushButtonAtmosphereDetails->setFixedSize(bs);
×
156
        ui->pushButtonSkylightDetails->setFixedSize(bs);
×
157
        ui->tonemappingPushButton->setFixedSize(bs);
×
158
        ui->pushButtonOrbitColors->setFixedSize(bs);        
×
159

160
        // TODOs after properties merge:
161
        // Jupiter's GRS should become property, and recheck the other "from trunk" entries.
162
        connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QString&)),&StelApp::getInstance().getSkyCultureMgr(),SLOT(setCurrentSkyCultureNameI18(QString)));
×
163
        connect(&StelApp::getInstance().getSkyCultureMgr(), SIGNAL(currentSkyCultureChanged(QString)), this, SLOT(skyCultureChanged()));
×
164

165
        // Connect and initialize checkboxes and other widgets
166
        SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
×
167
        Q_ASSERT(ssmgr);
×
168
        // Stars section
169
        connectGroupBox(ui->starGroupBox, "actionShow_Stars");
×
170
        connectDoubleProperty(ui->starScaleRadiusDoubleSpinBox,"StelSkyDrawer.absoluteStarScale");
×
171
        connectDoubleProperty(ui->starRelativeScaleDoubleSpinBox, "StelSkyDrawer.relativeStarScale");
×
172
        connectBoolProperty(ui->starTwinkleCheckBox, "StelSkyDrawer.flagStarTwinkle");
×
173
        connectDoubleProperty(ui->starTwinkleAmountDoubleSpinBox, "StelSkyDrawer.twinkleAmount");
×
174
        connectBoolProperty(ui->starLimitMagnitudeCheckBox,"StelSkyDrawer.flagStarMagnitudeLimit");
×
175
        connectDoubleProperty(ui->starLimitMagnitudeDoubleSpinBox, "StelSkyDrawer.customStarMagLimit");
×
176
        connectBoolProperty(ui->spikyStarsCheckBox, "StelSkyDrawer.flagStarSpiky");
×
177
        connectCheckBox(ui->starLabelCheckBox, "actionShow_Stars_Labels");
×
178
        connectDoubleProperty(ui->starsLabelsHorizontalSlider,"StarMgr.labelsAmount",0.0,10.0);
×
179
        connectBoolProperty(ui->checkBoxAdditionalNamesStars, "StarMgr.flagAdditionalNamesDisplayed");
×
180
        connectBoolProperty(ui->checkBoxStarDesignationsOnlyUsage, "StarMgr.flagDesignationLabels");
×
181
        connectBoolProperty(ui->dblStarsDesignationsCheckBox, "StarMgr.flagDblStarsDesignation");
×
182
        connectBoolProperty(ui->varStarsDesignationsCheckBox, "StarMgr.flagVarStarsDesignation");
×
183
        connectBoolProperty(ui->hipDesignationsCheckBox, "StarMgr.flagHIPDesignation");
×
184

185
        // Sky section
186
        connectBoolProperty(ui->milkyWayCheckBox, "MilkyWay.flagMilkyWayDisplayed");
×
187
        connectDoubleProperty(ui->milkyWayBrightnessDoubleSpinBox, "MilkyWay.intensity");
×
188
        connectDoubleProperty(ui->milkyWaySaturationDoubleSpinBox, "MilkyWay.saturation");
×
189
        connectBoolProperty(ui->zodiacalLightCheckBox, "ZodiacalLight.flagZodiacalLightDisplayed");
×
190
        connectDoubleProperty(ui->zodiacalLightBrightnessDoubleSpinBox, "ZodiacalLight.intensity");
×
191
        connectBoolProperty(ui->adaptationCheckbox, "StelSkyDrawer.flagLuminanceAdaptation");
×
192
        connectDoubleProperty(ui->twilightAltitudeDoubleSpinBox, "SpecificTimeMgr.twilightAltitude");
×
193

194
        StelModule* lmgr = StelApp::getInstance().getModule("LandscapeMgr");
×
195
        Q_ASSERT(lmgr);
×
196
        // Light pollution
197
        ui->lightPollutionWidget->setup();
×
198

199
        // atmosphere details
200
        connect(ui->pushButtonAtmosphereDetails, SIGNAL(clicked()), this, SLOT(showAtmosphereDialog()));
×
201
        // This has to be manually enabled by the user
202
        StelPropertyMgr* propMgr = StelApp::getInstance().getStelPropertyManager();
×
203
        if (propMgr->getProperty("Skylight.flagGuiPublic")->getValue().toBool())
×
204
                connect(ui->pushButtonSkylightDetails, SIGNAL(clicked()), this, SLOT(showSkylightDialog()));
×
205
        else
206
                ui->pushButtonSkylightDetails->hide();
×
207
        // tonemapping details
208
        connect(ui->tonemappingPushButton, SIGNAL(clicked()), this, SLOT(showTonemappingDialog()));
×
209

210
        // Planets section
211
        connectGroupBox(ui->planetsGroupBox, "actionShow_Planets");
×
212
        connectCheckBox(ui->planetMarkerCheckBox, "actionShow_Planets_Hints");
×
213
        connectCheckBox(ui->planetOrbitCheckBox, "actionShow_Planets_Orbits");
×
214
        connectBoolProperty(ui->planetIsolatedOrbitCheckBox, "SolarSystem.flagIsolatedOrbits");
×
215
        connectBoolProperty(ui->planetOrbitOnlyCheckBox, "SolarSystem.flagPlanetsOrbitsOnly");
×
216
        connectBoolProperty(ui->planetOrbitPermanentCheckBox, "SolarSystem.flagPermanentOrbits");
×
217
        connectIntProperty(ui->planetOrbitsThicknessSpinBox, "SolarSystem.orbitsThickness");
×
218
        connect(ui->pushButtonOrbitColors, SIGNAL(clicked(bool)), this, SLOT(showConfigureOrbitColorsDialog()));
×
219
        populateOrbitsControls(ssmgr->getFlagOrbits());
×
220
        connect(ssmgr,SIGNAL(flagOrbitsChanged(bool)), this, SLOT(populateOrbitsControls(bool)));
×
221
        connectBoolProperty(ui->planetLightSpeedCheckBox, "SolarSystem.flagLightTravelTime");
×
222
        connectBoolProperty(ui->planetUseObjModelsCheckBox, "SolarSystem.flagUseObjModels");
×
223
        connectBoolProperty(ui->planetShowObjSelfShadowsCheckBox, "SolarSystem.flagShowObjSelfShadows");
×
224
        ui->planetShowObjSelfShadowsCheckBox->setEnabled(ssmgr->getFlagUseObjModels());
×
225
        connect(ssmgr,SIGNAL(flagUseObjModelsChanged(bool)),ui->planetShowObjSelfShadowsCheckBox, SLOT(setEnabled(bool)));
×
226
        connectBoolProperty(ui->planetLimitMagnitudeCheckBox,"StelSkyDrawer.flagPlanetMagnitudeLimit");
×
227
        connectDoubleProperty(ui->planetLimitMagnitudeDoubleSpinBox,"StelSkyDrawer.customPlanetMagLimit");
×
228
        connectBoolProperty(ui->planetScaleMoonCheckBox, "SolarSystem.flagMoonScale");
×
229
        connectDoubleProperty(ui->moonScaleFactor,"SolarSystem.moonScale");
×
230
        connectBoolProperty(ui->planetScaleMinorBodyCheckBox, "SolarSystem.flagMinorBodyScale");
×
231
        connectDoubleProperty(ui->minorBodyScaleFactor,"SolarSystem.minorBodyScale");
×
232
        connectBoolProperty(ui->planetScalePlanetsCheckBox, "SolarSystem.flagPlanetScale");
×
233
        connectDoubleProperty(ui->planetScaleFactor,"SolarSystem.planetScale");
×
234
        connectBoolProperty(ui->planetScaleSunCheckBox, "SolarSystem.flagSunScale");
×
235
        connectDoubleProperty(ui->sunScaleFactor,"SolarSystem.sunScale");
×
236
        connectCheckBox(ui->planetLabelCheckBox, "actionShow_Planets_Labels");
×
237
        connectCheckBox(ui->planetNomenclatureCheckBox, "actionShow_Planets_Nomenclature");
×
238
        connectDoubleProperty(ui->planetsLabelsHorizontalSlider, "SolarSystem.labelsAmount",0.0,10.0);        
×
239
        connectCheckBox(ui->planetNomenclatureCheckBox, "actionShow_Planets_Nomenclature");
×
240
        connectColorButton(ui->planetNomenclatureColor, "NomenclatureMgr.nomenclatureColor", "color/planet_nomenclature_color");
×
241
        connectColorButton(ui->planetLabelColor, "SolarSystem.labelsColor", "color/planet_names_color");
×
242
        connectColorButton(ui->planetTrailsColor, "SolarSystem.trailsColor", "color/object_trails_color");
×
243
        connectBoolProperty(ui->planetTrailsCheckBox, "SolarSystem.trailsDisplayed");
×
244
        connectIntProperty(ui->planetTrailsThicknessSpinBox, "SolarSystem.trailsThickness");        
×
245
        connectBoolProperty(ui->planetIsolatedTrailsCheckBox, "SolarSystem.flagIsolatedTrails");
×
246
        connectIntProperty(ui->planetIsolatedTrailsSpinBox, "SolarSystem.numberIsolatedTrails");
×
247
        connectBoolProperty(ui->drawMoonHaloCheckBox, "SolarSystem.flagDrawMoonHalo");
×
248
        connectBoolProperty(ui->drawSunGlareCheckBox, "SolarSystem.flagDrawSunHalo");
×
249
        connectBoolProperty(ui->drawSunCoronaCheckBox, "SolarSystem.flagPermanentSolarCorona");
×
250
        connectBoolProperty(ui->shadowEnlargementDanjonCheckBox, "SolarSystem.earthShadowEnlargementDanjon");
×
251
        populateTrailsControls(ssmgr->getFlagTrails());
×
252
        connect(ssmgr,SIGNAL(trailsDisplayedChanged(bool)), this, SLOT(populateTrailsControls(bool)));
×
253

254
        connectBoolProperty(ui->hidePlanetNomenclatureCheckBox, "NomenclatureMgr.flagHideLocalNomenclature");
×
255
        connectBoolProperty(ui->showTerminatorNomenclatureOnlyCheckBox, "NomenclatureMgr.flagShowTerminatorZoneOnly");
×
256
        connectIntProperty(ui->terminatorMinAltSpinbox, "NomenclatureMgr.terminatorMinAltitude");
×
257
        connectIntProperty(ui->terminatorMaxAltSpinbox, "NomenclatureMgr.terminatorMaxAltitude");
×
258
        connectBoolProperty(ui->showSpecialNomenclatureOnlyCheckBox, "NomenclatureMgr.specialNomenclatureOnlyDisplayed");
×
259
        StelModule* mnmgr = StelApp::getInstance().getModule("NomenclatureMgr");
×
260
        populateNomenclatureControls(mnmgr->property("flagShowNomenclature").toBool());
×
261
        connect(mnmgr, SIGNAL(flagShowNomenclatureChanged(bool)), this, SLOT(populateNomenclatureControls(bool)));
×
262

263
        populatePlanetMagnitudeAlgorithmsList();
×
264
        int idx = ui->planetMagnitudeAlgorithmComboBox->findData(Planet::getApparentMagnitudeAlgorithm(), Qt::UserRole, Qt::MatchCaseSensitive);
×
265
        if (idx==-1)
×
266
        {
267
                // Use Mallama&Hilton_2018 as default
268
                idx = ui->planetMagnitudeAlgorithmComboBox->findData(Planet::MallamaHilton_2018, Qt::UserRole, Qt::MatchCaseSensitive);
×
269
        }
270
        ui->planetMagnitudeAlgorithmComboBox->setCurrentIndex(idx);
×
271
        connect(ui->planetMagnitudeAlgorithmComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setPlanetMagnitudeAlgorithm(int)));
×
272
        populatePlanetMagnitudeAlgorithmDescription();
×
273

274
        // GreatRedSpot (Jupiter)
275
        connect(ui->pushButtonGrsDetails, SIGNAL(clicked()), this, SLOT(showGreatRedSpotDialog()));
×
276

277
        // Link Solar System Editor button if available...
278
        StelModule *sse=StelApp::getInstance().getModuleMgr().getModule("SolarSystemEditor", true);
×
279
        if (sse)
×
280
                connect(ui->pushButtonSSE, &QPushButton::clicked, sse, [=]{sse->configureGui(true);});
×
281
        else
282
                ui->pushButtonSSE->hide();
×
283

284
        // Shooting stars section
285
        StelModule* mmgr = StelApp::getInstance().getModule("SporadicMeteorMgr");
×
286
        Q_ASSERT(mmgr);
×
287
        connectIntProperty(ui->zhrSpinBox, "SporadicMeteorMgr.zhr");
×
288
        connectIntProperty(ui->zhrSlider, "SporadicMeteorMgr.zhr", ui->zhrSlider->minimum(), ui->zhrSlider->maximum());
×
289
        updateZhrDescription(mmgr->property("zhr").toInt());
×
290
        connect(mmgr, SIGNAL(zhrChanged(int)), this, SLOT(updateZhrDescription(int)));
×
291

292
        // DSO tab contents
293
        NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
×
294
        updateSelectedCatalogsCheckBoxes();
×
295
        connect(nmgr, SIGNAL(catalogFiltersChanged(int)), this, SLOT(updateSelectedCatalogsCheckBoxes()));
×
296
        connect(ui->selectAllCatalogs, SIGNAL(clicked()), nmgr, SLOT(selectAllCatalogs()));
×
297
        connect(ui->selectStandardCatalogs, SIGNAL(clicked()), nmgr, SLOT(selectStandardCatalogs()));
×
298
        connect(ui->selectPreferredCatalogs, SIGNAL(clicked()), nmgr, SLOT(loadCatalogFilters()));
×
299
        connect(ui->storePreferredCatalogs, SIGNAL(clicked()), nmgr, SLOT(storeCatalogFilters()));
×
300
        connect(ui->selectNoneCatalogs, SIGNAL(clicked()), nmgr, SLOT(selectNoneCatalogs()));
×
301
        connect(ui->buttonGroupDisplayedDSOCatalogs, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(setSelectedCatalogsFromCheckBoxes()));
×
302
        updateSelectedTypesCheckBoxes();
×
303
        connect(nmgr, SIGNAL(typeFiltersChanged(int)), this, SLOT(updateSelectedTypesCheckBoxes()));
×
304
        connect(ui->buttonGroupDisplayedDSOTypes, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(setSelectedTypesFromCheckBoxes()));
×
305
        connectGroupBox(ui->groupBoxDSOTypeFilters,"actionSet_Nebula_TypeFilterUsage");
×
306
        // DSO Labels section
307
        connectGroupBox(ui->groupBoxDSOLabelsAndMarkers, "actionShow_Nebulas");
×
308
        connectDoubleProperty(ui->nebulasLabelsHorizontalSlider, "NebulaMgr.labelsAmount",0.0,10.0);
×
309
        connectDoubleProperty(ui->nebulasHintsHorizontalSlider, "NebulaMgr.hintsAmount",0.0,10.0);
×
310
        connectBoolProperty(ui->checkBoxDesignationsOnlyUsage, "NebulaMgr.flagDesignationLabels");
×
311
        connectBoolProperty(ui->checkBoxProportionalHints, "NebulaMgr.hintsProportional");
×
312
        connectBoolProperty(ui->checkBoxOutlines, "NebulaMgr.flagOutlinesDisplayed");
×
313
        connectBoolProperty(ui->checkBoxSurfaceBrightnessUsage, "NebulaMgr.flagSurfaceBrightnessUsage");
×
314
        connectBoolProperty(ui->nebulaLimitMagnitudeCheckBox,"StelSkyDrawer.flagNebulaMagnitudeLimit");
×
315
        connectBoolProperty(ui->checkBoxAdditionalNamesDSO, "NebulaMgr.flagAdditionalNamesDisplayed");
×
316
        connectDoubleProperty(ui->nebulaLimitMagnitudeDoubleSpinBox,"StelSkyDrawer.customNebulaMagLimit");
×
317
        connectBoolProperty(ui->nebulaLimitSizeCheckBox, "NebulaMgr.flagUseSizeLimits");
×
318
        connectDoubleProperty(ui->nebulaLimitSizeMinDoubleSpinBox, "NebulaMgr.minSizeLimit");
×
319
        connectDoubleProperty(ui->nebulaLimitSizeMaxDoubleSpinBox, "NebulaMgr.maxSizeLimit");
×
320
        connect(ui->pushButtonConfigureDSOColors, SIGNAL(clicked()), this, SLOT(showConfigureDSOColorsDialog()));
×
321

322
        // Landscape section
323
        connectCheckBox(ui->showGroundCheckBox, "actionShow_Ground");
×
324
        connectCheckBox(ui->showFogCheckBox, "actionShow_Fog");
×
325
        connectCheckBox(ui->atmosphereCheckBox, "actionShow_Atmosphere");
×
326
        connectCheckBox(ui->landscapeIlluminationCheckBox, "actionShow_LandscapeIllumination");
×
327
        connectCheckBox(ui->landscapeLabelsCheckBox, "actionShow_LandscapeLabels");
×
328

329
        connectBoolProperty(ui->landscapePositionCheckBox, "LandscapeMgr.flagLandscapeSetsLocation");
×
330
        connectColorButton(ui->labelsColorButton, "LandscapeMgr.labelColor", "landscape/label_color");
×
331
        connectIntProperty(ui->labelsFontSizeSpinBox, "LandscapeMgr.labelFontSize");
×
332

333
        connectBoolProperty(ui->landscapeBrightnessCheckBox,"LandscapeMgr.flagLandscapeUseMinimalBrightness");
×
334
        connect(lmgr,SIGNAL(flagLandscapeUseMinimalBrightnessChanged(bool)),ui->localLandscapeBrightnessCheckBox,SLOT(setEnabled(bool)));
×
335
        connect(lmgr,SIGNAL(flagLandscapeUseMinimalBrightnessChanged(bool)),ui->landscapeBrightnessSpinBox,SLOT(setEnabled(bool)));
×
336
        ui->localLandscapeBrightnessCheckBox->setEnabled(lmgr->property("flagLandscapeUseMinimalBrightness").toBool());
×
337
        ui->landscapeBrightnessSpinBox->setEnabled(lmgr->property("flagLandscapeUseMinimalBrightness").toBool());
×
338
        connectDoubleProperty(ui->landscapeBrightnessSpinBox,"LandscapeMgr.defaultMinimalBrightness");
×
339
        connectBoolProperty(ui->localLandscapeBrightnessCheckBox,"LandscapeMgr.flagLandscapeSetsMinimalBrightness");
×
340
        connectBoolProperty(ui->landscapePolylineCheckBox, "LandscapeMgr.flagPolyLineDisplayedOnly");
×
341
        connectIntProperty(ui->landscapePolylineThicknessSpinBox, "LandscapeMgr.polyLineThickness");
×
342
        connect(ui->landscapesListWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(changeLandscape(QListWidgetItem*)));
×
343
        connect(lmgr, SIGNAL(currentLandscapeChanged(QString,QString)), this, SLOT(landscapeChanged(QString,QString)));
×
344
        connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentLandscapeAsDefault()));
×
345
        connect(lmgr,SIGNAL(defaultLandscapeChanged(QString)),this,SLOT(updateDefaultLandscape()));
×
346
        updateDefaultLandscape();
×
347
        connect(lmgr, SIGNAL(landscapesChanged()), this, SLOT(populateLists()));
×
348
        connect(ui->pushButtonAddRemoveLandscapes, SIGNAL(clicked()), this, SLOT(showAddRemoveLandscapesDialog()));
×
349

350
        // Grid and lines
351
        connectGroupBox(ui->celestialSphereGroupBox,              "actionShow_Gridlines");
×
352
        connectCheckBox(ui->showEquatorLineCheckBox,              "actionShow_Equator_Line");
×
353
        connectCheckBox(ui->showEquatorJ2000LineCheckBox,         "actionShow_Equator_J2000_Line");
×
354
        connectCheckBox(ui->showFixedEquatorLineCheckBox,         "actionShow_Fixed_Equator_Line");
×
355
        connectCheckBox(ui->showEclipticLineJ2000CheckBox,        "actionShow_Ecliptic_J2000_Line");
×
356
        connectCheckBox(ui->showEclipticLineOfDateCheckBox,       "actionShow_Ecliptic_Line");
×
357
        connectCheckBox(ui->showInvariablePlaneCheckBox,          "actionShow_Invariable_Plane_Line");
×
358
        connectCheckBox(ui->showSolarEquatorCheckBox,             "actionShow_Solar_Equator_Line");
×
359
        connectCheckBox(ui->showMeridianLineCheckBox,             "actionShow_Meridian_Line");
×
360
        connectCheckBox(ui->showLongitudeLineCheckBox,            "actionShow_Longitude_Line");
×
361
        connectCheckBox(ui->showQuadratureLineCheckBox,           "actionShow_Quadrature_Line");
×
362
        connectCheckBox(ui->showHorizonLineCheckBox,              "actionShow_Horizon_Line");
×
363
        connectCheckBox(ui->showEquatorialGridCheckBox,                  "actionShow_Equatorial_Grid");
×
364
        connectCheckBox(ui->showFixedEquatorialGridCheckBox,      "actionShow_Fixed_Equatorial_Grid");
×
365
        connectCheckBox(ui->showGalacticGridCheckBox,             "actionShow_Galactic_Grid");
×
366
        connectCheckBox(ui->showGalacticEquatorLineCheckBox,      "actionShow_Galactic_Equator_Line");
×
367
        connectCheckBox(ui->showSupergalacticGridCheckBox,        "actionShow_Supergalactic_Grid");
×
368
        connectCheckBox(ui->showSupergalacticEquatorLineCheckBox, "actionShow_Supergalactic_Equator_Line");
×
369
        connectCheckBox(ui->showAzimuthalGridCheckBox,            "actionShow_Azimuthal_Grid");
×
370
        connectCheckBox(ui->showEquatorialJ2000GridCheckBox,      "actionShow_Equatorial_J2000_Grid");
×
371
        connectCheckBox(ui->showEclipticGridJ2000CheckBox,        "actionShow_Ecliptic_J2000_Grid");
×
372
        connectCheckBox(ui->showEclipticGridOfDateCheckBox,       "actionShow_Ecliptic_Grid");
×
373
        connectCheckBox(ui->showCardinalPointsCheckBox,           "actionShow_Cardinal_Points");
×
374
        connectCheckBox(ui->showOrdinal8WRPointsCheckBox,         "actionShow_Intercardinal_Points");
×
375
        connectCheckBox(ui->showOrdinal16WRPointsCheckBox,        "actionShow_Secondary_Intercardinal_Points");
×
376
        connectCheckBox(ui->showCompassMarksCheckBox,             "actionShow_Compass_Marks");
×
377
        connectCheckBox(ui->showPrecessionCirclesCheckBox,        "actionShow_Precession_Circles");
×
378
        connectCheckBox(ui->showPrimeVerticalLineCheckBox,        "actionShow_Prime_Vertical_Line");
×
379
        connectCheckBox(ui->showCurrentVerticalLineCheckBox,      "actionShow_Current_Vertical_Line");
×
380
        connectCheckBox(ui->showColuresLineCheckBox,              "actionShow_Colure_Lines");
×
381
        connectCheckBox(ui->showCircumpolarCirclesCheckBox,       "actionShow_Circumpolar_Circles");
×
382
        connectCheckBox(ui->showUmbraCheckBox,                    "actionShow_Umbra_Circle");
×
383
        connectCheckBox(ui->showUmbraCenterCheckBox,              "actionShow_Umbra_Center_Point");
×
384
        connectCheckBox(ui->showPenumbraCheckBox,                 "actionShow_Penumbra_Circle");
×
385
        connectCheckBox(ui->showCelestialJ2000PolesCheckBox,      "actionShow_Celestial_J2000_Poles");
×
386
        connectCheckBox(ui->showCelestialPolesCheckBox,           "actionShow_Celestial_Poles");
×
387
        connectCheckBox(ui->showZenithNadirCheckBox,              "actionShow_Zenith_Nadir");
×
388
        connectCheckBox(ui->showEclipticJ2000PolesCheckBox,       "actionShow_Ecliptic_J2000_Poles");
×
389
        connectCheckBox(ui->showEclipticPolesCheckBox,            "actionShow_Ecliptic_Poles");
×
390
        connectCheckBox(ui->showGalacticPolesCheckBox,            "actionShow_Galactic_Poles");
×
391
        connectCheckBox(ui->showGalacticCenterCheckBox,           "actionShow_Galactic_Center");
×
392
        connectCheckBox(ui->showSupergalacticPolesCheckBox,       "actionShow_Supergalactic_Poles");
×
393
        connectCheckBox(ui->showEquinoxJ2000PointsCheckBox,       "actionShow_Equinox_J2000_Points");
×
394
        connectCheckBox(ui->showEquinoxPointsCheckBox,            "actionShow_Equinox_Points");
×
395
        connectCheckBox(ui->showSolsticeJ2000PointsCheckBox,      "actionShow_Solstice_J2000_Points");
×
396
        connectCheckBox(ui->showSolsticePointsCheckBox,           "actionShow_Solstice_Points");
×
397
        connectCheckBox(ui->showAntisolarPointCheckBox,           "actionShow_Antisolar_Point");
×
398
        connectCheckBox(ui->showApexPointsCheckBox,               "actionShow_Apex_Points");
×
399
        connectCheckBox(ui->showFOVCenterMarkerCheckBox,          "actionShow_FOV_Center_Marker");
×
400
        connectCheckBox(ui->showFOVCircularMarkerCheckBox,        "actionShow_FOV_Circular_Marker");
×
401
        connectCheckBox(ui->showFOVRectangularMarkerCheckBox,     "actionShow_FOV_Rectangular_Marker");
×
402
        connectDoubleProperty(ui->fovCircularMarkerSizeDoubleSpinBox,             "SpecialMarkersMgr.fovCircularMarkerSize");
×
403
        connectDoubleProperty(ui->fovRectangularMarkerWidthDoubleSpinBox,         "SpecialMarkersMgr.fovRectangularMarkerWidth");
×
404
        connectDoubleProperty(ui->fovRectangularMarkerHeightDoubleSpinBox,        "SpecialMarkersMgr.fovRectangularMarkerHeight");
×
405
        connectDoubleProperty(ui->fovRectangularMarkerRotationAngleDoubleSpinBox, "SpecialMarkersMgr.fovRectangularMarkerRotationAngle");
×
406
        // The thickness of lines
407
        connectIntProperty(ui->lineThicknessSpinBox,                "GridLinesMgr.lineThickness");
×
408
        connectIntProperty(ui->partThicknessSpinBox,                "GridLinesMgr.partThickness");
×
409
        connectBoolProperty(ui->equatorPartsCheckBox,               "GridLinesMgr.equatorPartsDisplayed");
×
410
        connectBoolProperty(ui->equatorJ2000PartsCheckBox,          "GridLinesMgr.equatorJ2000PartsDisplayed");
×
411
        connectBoolProperty(ui->fixedEquatorPartsCheckBox,          "GridLinesMgr.fixedEquatorPartsDisplayed");
×
412
        connectBoolProperty(ui->eclipticPartsCheckBox,              "GridLinesMgr.eclipticPartsDisplayed");
×
413
        connectBoolProperty(ui->eclipticJ2000PartsCheckBox,         "GridLinesMgr.eclipticJ2000PartsDisplayed");
×
414
        connectBoolProperty(ui->solarEquatorPartsCheckBox,          "GridLinesMgr.solarEquatorPartsDisplayed");
×
415
        connectBoolProperty(ui->longitudePartsCheckBox,             "GridLinesMgr.longitudePartsDisplayed");
×
416
        connectBoolProperty(ui->horizonPartsCheckBox,               "GridLinesMgr.horizonPartsDisplayed");
×
417
        connectBoolProperty(ui->meridianPartsCheckBox,              "GridLinesMgr.meridianPartsDisplayed");
×
418
        connectBoolProperty(ui->primeVerticalPartsCheckBox,         "GridLinesMgr.primeVerticalPartsDisplayed");
×
419
        connectBoolProperty(ui->currentVerticalPartsCheckBox,       "GridLinesMgr.currentVerticalPartsDisplayed");
×
420
        connectBoolProperty(ui->colurePartsCheckBox,                "GridLinesMgr.colurePartsDisplayed");
×
421
        connectBoolProperty(ui->precessionPartsCheckBox,            "GridLinesMgr.precessionPartsDisplayed");
×
422
        connectBoolProperty(ui->galacticEquatorPartsCheckBox,       "GridLinesMgr.galacticEquatorPartsDisplayed");
×
423
        connectBoolProperty(ui->supergalacticEquatorPartsCheckBox,  "GridLinesMgr.supergalacticEquatorPartsDisplayed");
×
424
        connectBoolProperty(ui->equatorLabelsCheckBox,              "GridLinesMgr.equatorPartsLabeled");
×
425
        connectBoolProperty(ui->equatorJ2000LabelsCheckBox,         "GridLinesMgr.equatorJ2000PartsLabeled");
×
426
        connectBoolProperty(ui->fixedEquatorLabelsCheckBox,         "GridLinesMgr.fixedEquatorPartsLabeled");
×
427
        connectBoolProperty(ui->eclipticLabelsCheckBox,             "GridLinesMgr.eclipticPartsLabeled");
×
428
        connectBoolProperty(ui->eclipticJ2000LabelsCheckBox,        "GridLinesMgr.eclipticJ2000PartsLabeled");
×
429
        connectBoolProperty(ui->solarEquatorLabelsCheckBox,         "GridLinesMgr.solarEquatorPartsLabeled");
×
430
        connectBoolProperty(ui->longitudeLabelsCheckBox,            "GridLinesMgr.longitudePartsLabeled");
×
431
        connectBoolProperty(ui->horizonLabelsCheckBox,              "GridLinesMgr.horizonPartsLabeled");
×
432
        connectBoolProperty(ui->meridianLabelsCheckBox,             "GridLinesMgr.meridianPartsLabeled");
×
433
        connectBoolProperty(ui->primeVerticalLabelsCheckBox,        "GridLinesMgr.primeVerticalPartsLabeled");
×
434
        connectBoolProperty(ui->currentVerticalLabelsCheckBox,      "GridLinesMgr.currentVerticalPartsLabeled");
×
435
        connectBoolProperty(ui->colureLabelsCheckBox,               "GridLinesMgr.colurePartsLabeled");
×
436
        connectBoolProperty(ui->precessionLabelsCheckBox,           "GridLinesMgr.precessionPartsLabeled");
×
437
        connectBoolProperty(ui->galacticEquatorLabelsCheckBox,      "GridLinesMgr.galacticEquatorPartsLabeled");
×
438
        connectBoolProperty(ui->supergalacticEquatorLabelsCheckBox, "GridLinesMgr.supergalacticEquatorPartsLabeled");
×
439

440
        connectColorButton(ui->colorEclipticGridJ2000,        "GridLinesMgr.eclipticJ2000GridColor",         "color/ecliptical_J2000_color");
×
441
        connectColorButton(ui->colorEclipticGridOfDate,       "GridLinesMgr.eclipticGridColor",              "color/ecliptical_color");
×
442
        connectColorButton(ui->colorEquatorialJ2000Grid,      "GridLinesMgr.equatorJ2000GridColor",          "color/equatorial_J2000_color");
×
443
        connectColorButton(ui->colorEquatorialGrid,           "GridLinesMgr.equatorGridColor",               "color/equatorial_color");
×
444
        connectColorButton(ui->colorFixedEquatorialGrid,      "GridLinesMgr.fixedEquatorGridColor",          "color/fixed_equatorial_color");
×
445
        connectColorButton(ui->colorGalacticGrid,             "GridLinesMgr.galacticGridColor",              "color/galactic_color");
×
446
        connectColorButton(ui->colorSupergalacticGrid,        "GridLinesMgr.supergalacticGridColor",         "color/supergalactic_color");
×
447
        connectColorButton(ui->colorAzimuthalGrid,            "GridLinesMgr.azimuthalGridColor",             "color/azimuthal_color");
×
448
        connectColorButton(ui->colorEclipticLineJ2000,        "GridLinesMgr.eclipticJ2000LineColor",         "color/ecliptic_J2000_color");
×
449
        connectColorButton(ui->colorEclipticLineOfDate,       "GridLinesMgr.eclipticLineColor",              "color/ecliptic_color");
×
450
        connectColorButton(ui->colorInvariablePlane,          "GridLinesMgr.invariablePlaneLineColor",       "color/invariable_plane_color");
×
451
        connectColorButton(ui->colorSolarEquatorLine,         "GridLinesMgr.solarEquatorLineColor",          "color/solar_equator_color");
×
452
        connectColorButton(ui->colorEquatorJ2000Line,         "GridLinesMgr.equatorJ2000LineColor",          "color/equator_J2000_color");
×
453
        connectColorButton(ui->colorEquatorLine,              "GridLinesMgr.equatorLineColor",               "color/equator_color");
×
454
        connectColorButton(ui->colorFixedEquatorLine,         "GridLinesMgr.fixedEquatorLineColor",          "color/fixed_equator_color");
×
455
        connectColorButton(ui->colorGalacticEquatorLine,      "GridLinesMgr.galacticEquatorLineColor",       "color/galactic_equator_color");
×
456
        connectColorButton(ui->colorSupergalacticEquatorLine, "GridLinesMgr.supergalacticEquatorLineColor",  "color/supergalactic_equator_color");
×
457
        connectColorButton(ui->colorHorizonLine,              "GridLinesMgr.horizonLineColor",               "color/horizon_color");
×
458
        connectColorButton(ui->colorLongitudeLine,            "GridLinesMgr.longitudeLineColor",             "color/oc_longitude_color");
×
459
        connectColorButton(ui->colorQuadratureLine,           "GridLinesMgr.quadratureLineColor",            "color/quadrature_color");
×
460
        connectColorButton(ui->colorColuresLine,              "GridLinesMgr.colureLinesColor",               "color/colures_color");
×
461
        connectColorButton(ui->colorCircumpolarCircles,       "GridLinesMgr.circumpolarCirclesColor",        "color/circumpolar_circles_color");
×
462
        connectColorButton(ui->colorUmbraCircle,              "GridLinesMgr.umbraCircleColor",               "color/umbra_circle_color");
×
463
        connectColorButton(ui->colorPenumbraCircle,           "GridLinesMgr.penumbraCircleColor",            "color/penumbra_circle_color");
×
464
        connectColorButton(ui->colorPrecessionCircles,        "GridLinesMgr.precessionCirclesColor",         "color/precession_circles_color");
×
465
        connectColorButton(ui->colorPrimeVerticalLine,        "GridLinesMgr.primeVerticalLineColor",         "color/prime_vertical_color");
×
466
        connectColorButton(ui->colorCurrentVerticalLine,      "GridLinesMgr.currentVerticalLineColor",       "color/current_vertical_color");
×
467
        connectColorButton(ui->colorMeridianLine,             "GridLinesMgr.meridianLineColor",              "color/meridian_color");
×
468
        connectColorButton(ui->colorCelestialJ2000Poles,      "GridLinesMgr.celestialJ2000PolesColor",       "color/celestial_J2000_poles_color");
×
469
        connectColorButton(ui->colorCelestialPoles,           "GridLinesMgr.celestialPolesColor",            "color/celestial_poles_color");
×
470
        connectColorButton(ui->colorZenithNadir,              "GridLinesMgr.zenithNadirColor",               "color/zenith_nadir_color");
×
471
        connectColorButton(ui->colorEclipticJ2000Poles,       "GridLinesMgr.eclipticJ2000PolesColor",        "color/ecliptic_J2000_poles_color");
×
472
        connectColorButton(ui->colorEclipticPoles,            "GridLinesMgr.eclipticPolesColor",             "color/ecliptic_poles_color");
×
473
        connectColorButton(ui->colorGalacticPoles,            "GridLinesMgr.galacticPolesColor",             "color/galactic_poles_color");
×
474
        connectColorButton(ui->colorGalacticCenter,           "GridLinesMgr.galacticCenterColor",            "color/galactic_center_color");
×
475
        connectColorButton(ui->colorSupergalacticPoles,       "GridLinesMgr.supergalacticPolesColor",        "color/supergalactic_poles_color");
×
476
        connectColorButton(ui->colorEquinoxJ2000Points,       "GridLinesMgr.equinoxJ2000PointsColor",        "color/equinox_J2000_points_color");
×
477
        connectColorButton(ui->colorEquinoxPoints,            "GridLinesMgr.equinoxPointsColor",             "color/equinox_points_color");
×
478
        connectColorButton(ui->colorSolsticeJ2000Points,      "GridLinesMgr.solsticeJ2000PointsColor",       "color/solstice_J2000_points_color");
×
479
        connectColorButton(ui->colorSolsticePoints,           "GridLinesMgr.solsticePointsColor",            "color/solstice_points_color");
×
480
        connectColorButton(ui->colorAntisolarPoint,           "GridLinesMgr.antisolarPointColor",            "color/antisolar_point_color");
×
481
        connectColorButton(ui->colorApexPoints,               "GridLinesMgr.apexPointsColor",                "color/apex_points_color");
×
482
        connectColorButton(ui->colorFOVCenterMarker,          "SpecialMarkersMgr.fovCenterMarkerColor",      "color/fov_center_marker_color");
×
483
        connectColorButton(ui->colorFOVCircularMarker,        "SpecialMarkersMgr.fovCircularMarkerColor",    "color/fov_circular_marker_color");
×
484
        connectColorButton(ui->colorFOVRectangularMarker,     "SpecialMarkersMgr.fovRectangularMarkerColor", "color/fov_rectangular_marker_color");
×
485
        connectColorButton(ui->colorCardinalPoints,           "LandscapeMgr.cardinalPointsColor",            "color/cardinal_color");
×
486
        connectColorButton(ui->colorCompassMarks,             "SpecialMarkersMgr.compassMarksColor",         "color/compass_marks_color");
×
487

488
        connect(ui->showCardinalPointsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setSelectedCardinalCheckBoxes()));
×
489
        connect(ui->showOrdinal8WRPointsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setSelectedCardinalCheckBoxes()));
×
490
        setSelectedCardinalCheckBoxes();
×
491

492
        // Projection
493
        connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QString&)), this, SLOT(changeProjection(const QString&)));
×
494
        connect(StelApp::getInstance().getCore(), SIGNAL(currentProjectionTypeChanged(StelCore::ProjectionType)),this,SLOT(projectionChanged()));
×
495
        connectDoubleProperty(ui->viewportOffsetSpinBox, "StelMovementMgr.viewportVerticalOffsetTarget");
×
496
        connectDoubleProperty(ui->userMaxFovSpinBox, "StelMovementMgr.userMaxFov");
×
497

498
        // Sky Culture
499
        connect(ui->useAsDefaultSkyCultureCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentCultureAsDefault()));
×
500
        connect(&StelApp::getInstance().getSkyCultureMgr(), SIGNAL(defaultSkyCultureChanged(QString)),this,SLOT(updateDefaultSkyCulture()));
×
501
        updateDefaultSkyCulture();
×
502

503
        // allow to display short names and inhibit translation.
504
        connectIntProperty(ui->skyCultureNamesStyleComboBox,            "ConstellationMgr.constellationDisplayStyle");
×
505
        connectCheckBox(ui->nativePlanetNamesCheckBox,                  "actionShow_Skyculture_NativePlanetNames");
×
506
        connectCheckBox(ui->showConstellationLinesCheckBox,             "actionShow_Constellation_Lines");
×
507
        connectIntProperty(ui->constellationLineThicknessSpinBox,       "ConstellationMgr.constellationLineThickness");
×
508
        connectCheckBox(ui->showConstellationLabelsCheckBox,                "actionShow_Constellation_Labels");
×
509
        connectCheckBox(ui->showConstellationBoundariesCheckBox,        "actionShow_Constellation_Boundaries");
×
510
        connectIntProperty(ui->constellationBoundariesThicknessSpinBox, "ConstellationMgr.constellationBoundariesThickness");
×
511
        connectCheckBox(ui->showConstellationArtCheckBox,               "actionShow_Constellation_Art");
×
512
        connectDoubleProperty(ui->constellationArtBrightnessSpinBox,    "ConstellationMgr.artIntensity");
×
513

514
        connectColorButton(ui->colorConstellationBoundaries, "ConstellationMgr.boundariesColor", "color/const_boundary_color");
×
515
        connectColorButton(ui->colorConstellationLabels,     "ConstellationMgr.namesColor",      "color/const_names_color");
×
516
        connectColorButton(ui->colorConstellationLines,      "ConstellationMgr.linesColor",      "color/const_lines_color");
×
517

518
        connectCheckBox(ui->showAsterismLinesCheckBox,       "actionShow_Asterism_Lines");
×
519
        connectIntProperty(ui->asterismLineThicknessSpinBox, "AsterismMgr.asterismLineThickness");
×
520
        connectCheckBox(ui->showAsterismLabelsCheckBox,      "actionShow_Asterism_Labels");
×
521
        connectCheckBox(ui->showRayHelpersCheckBox,          "actionShow_Ray_Helpers");
×
522
        connectIntProperty(ui->rayHelperThicknessSpinBox,    "AsterismMgr.rayHelperThickness");
×
523

524
        connectColorButton(ui->colorAsterismLabels, "AsterismMgr.namesColor",      "color/asterism_names_color");
×
525
        connectColorButton(ui->colorAsterismLines,  "AsterismMgr.linesColor",      "color/asterism_lines_color");
×
526
        connectColorButton(ui->colorRayHelpers,     "AsterismMgr.rayHelpersColor", "color/rayhelper_lines_color");
×
527

528
        // Font selection
529
        connectIntProperty(ui->constellationsFontSizeSpinBox, "ConstellationMgr.fontSize");
×
530
        connectIntProperty(ui->asterismsFontSizeSpinBox,      "AsterismMgr.fontSize");
×
531

532
        // Hips mgr.
533
        populateHipsGroups();
×
534
        StelModule *hipsmgr = StelApp::getInstance().getModule("HipsMgr");        
×
535
        connect(hipsmgr, SIGNAL(surveysChanged()), this, SLOT(updateHips()));
×
536
        connect(ui->surveyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateHips()));
×
537
        connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(updateHips()));
×
538
        connect(ui->surveysListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(updateHips()), Qt::QueuedConnection);
×
539
        connect(ui->surveysListWidget, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(hipsListItemChanged(QListWidgetItem*)));
×
540
        updateHips();
×
541

542
        updateTabBarListWidgetWidth();
×
543

544
        connect((dynamic_cast<StelGui*>(StelApp::getInstance().getGui())), &StelGui::htmlStyleChanged, this, [=](const QString &style){
×
545
                ui->surveysTextBrowser->document()->setDefaultStyleSheet(style);
×
546
                ui->projectionTextBrowser->document()->setDefaultStyleSheet(style);
×
547
                ui->landscapeTextBrowser->document()->setDefaultStyleSheet(style);
×
548
                ui->skyCultureTextBrowser->document()->setDefaultStyleSheet(style);
×
549
        });
×
550
}
×
551

552
void ViewDialog::populateOrbitsControls(bool flag)
×
553
{
554
        ui->planetIsolatedOrbitCheckBox->setEnabled(flag);
×
555
        ui->planetOrbitOnlyCheckBox->setEnabled(flag);
×
556
        ui->planetOrbitPermanentCheckBox->setEnabled(flag);
×
557
        ui->planetOrbitsThicknessSpinBox->setEnabled(flag);
×
558
        ui->pushButtonOrbitColors->setEnabled(flag);
×
559
}
×
560

561
void ViewDialog::populateTrailsControls(bool flag)
×
562
{
563
        ui->planetIsolatedTrailsCheckBox->setEnabled(flag);
×
564
        ui->planetIsolatedTrailsSpinBox->setEnabled(flag);
×
565
        ui->planetTrailsThicknessSpinBox->setEnabled(flag);
×
566
}
×
567

568
void ViewDialog::populateNomenclatureControls(bool flag)
×
569
{
570
        ui->hidePlanetNomenclatureCheckBox->setEnabled(flag);
×
571
        ui->showSpecialNomenclatureOnlyCheckBox->setEnabled(flag);
×
572
        ui->showTerminatorNomenclatureOnlyCheckBox->setEnabled(flag);
×
573
        ui->terminatorMinAltSpinbox->setEnabled(flag);
×
574
        ui->terminatorMaxAltSpinbox->setEnabled(flag);
×
575
        ui->labelTerminator->setEnabled(flag);
×
576
}
×
577

578
// Heuristic function to decide in which group to put a survey.
579
static QString getHipsType(const HipsSurveyP hips)
×
580
{
581
        QJsonObject properties = hips->property("properties").toJsonObject();
×
582
        if (!hips->isPlanetarySurvey())
×
583
                return "dss";
×
584
        if (properties["type"].toString() == "planet") // TODO: switch to use hips->isPlanetarySurvey() and multiple surveys for Solar system bodies
×
585
                return "sol";
×
586
        return "other";
×
587
}
×
588

589
void ViewDialog::updateHips()
×
590
{
591
        if (!ui->page_surveys->isVisible()) return;
×
592
        StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
×
593
        StelModule *hipsmgr = StelApp::getInstance().getModule("HipsMgr");
×
594
        QMetaObject::invokeMethod(hipsmgr, "loadSources");
×
595

596
        QComboBox* typeComboBox = ui->surveyTypeComboBox;
×
597
        QVariant selectedType = typeComboBox->itemData(typeComboBox->currentIndex());
×
598
        if (selectedType.isNull())
×
599
                selectedType = "dss";
×
600

601
        // Update survey list.
602
        QListWidget* l = ui->surveysListWidget;
×
603

604
        if (!hipsmgr->property("loaded").toBool())
×
605
        {
606
                l->clear();
×
607
                new QListWidgetItem(q_("Loading..."), l);
×
608
                return;
×
609
        }
610

611
        QJsonObject currentInfo;
×
612
        QString currentSurvey = l->currentItem() ? l->currentItem()->data(Qt::UserRole).toString() : "";
×
613
        QListWidgetItem* currentItem = nullptr;
×
614
        HipsSurveyP currentHips;
×
615

616
        l->blockSignals(true);
×
617
        l->clear();
×
618
        const QList<HipsSurveyP> hipslist = hipsmgr->property("surveys").value<QList<HipsSurveyP>>();
×
619

620
        for (auto &hips: hipslist)
×
621
        {
622
                if (getHipsType(hips) != selectedType)
×
623
                        continue;
×
624
                QString url = hips->property("url").toString();
×
625
                QJsonObject properties = hips->property("properties").toJsonObject();
×
626
                QString title = properties["obs_title"].toString();
×
627
                if (title.isEmpty())
×
628
                        continue;
×
629
                QListWidgetItem* item = new QListWidgetItem(title, l);
×
630
                item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
×
631
                item->setCheckState(hips->property("visible").toBool() ? Qt::Checked : Qt::Unchecked);
×
632
                item->setData(Qt::UserRole, url);
×
633
                if (url == currentSurvey)
×
634
                {
635
                        currentItem = item;
×
636
                        currentHips = hips;
×
637
                }
638
                disconnect(hips.data(), nullptr, this, nullptr);
×
639
                connect(hips.data(), SIGNAL(statusChanged()), this, SLOT(updateHips()));
×
640
        }
×
641
        l->sortItems(Qt::AscendingOrder);
×
642
        l->setCurrentItem(currentItem);
×
643
        l->scrollToItem(currentItem);
×
644
        l->blockSignals(false);
×
645

646
        if (!currentHips)
×
647
        {
648
                ui->surveysTextBrowser->setText("");
×
649
        }
650
        else
651
        {
652
                QJsonObject props = currentHips->property("properties").toJsonObject();
×
653
                QString html = QString("<h1>%1</h1>\n").arg(props["obs_title"].toString());
×
654
                if (props.contains("obs_copyright") && props.contains("obs_copyright_url"))
×
655
                {
656
                        html += QString("<p>Copyright <a href='%2'>%1</a></p>\n")
×
657
                                        .arg(props["obs_copyright"].toString(), props["obs_copyright_url"].toString());
×
658
                }
659
                html += QString("<p>%1</p>\n").arg(props["obs_description"].toString());
×
660
                html += "<h2>" + q_("properties") + "</h2>\n<ul>\n";
×
661
                for (auto iter = props.constBegin(); iter != props.constEnd(); iter++)
×
662
                {
663
                        html += QString("<li><b>%1</b> %2</li>\n").arg(iter.key(), iter.value().toString());
×
664
                }
665
                html += "</ul>\n";
×
666
                if (gui)
×
667
                        ui->surveysTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));
×
668
                ui->surveysTextBrowser->setHtml(html);
×
669
        }
×
670
}
×
671

672
void ViewDialog::populateHipsGroups()
×
673
{
674
        // Update the groups combobox.
675
        QComboBox* typeComboBox = ui->surveyTypeComboBox;
×
676
        int index = typeComboBox->currentIndex();
×
677
        QVariant selectedType = typeComboBox->itemData(index);
×
678
        if (selectedType.isNull())
×
679
                selectedType = "dss";
×
680
        typeComboBox->clear();
×
681
        typeComboBox->addItem(q_("Deep Sky"), "dss");
×
682
        typeComboBox->addItem(q_("Solar System"), "sol");
×
683
        index = typeComboBox->findData(selectedType, Qt::UserRole, Qt::MatchCaseSensitive);
×
684
        typeComboBox->setCurrentIndex(index);
×
685
}
×
686

687
void ViewDialog::hipsListItemChanged(QListWidgetItem* item)
×
688
{
689
        QListWidget* l = item->listWidget();
×
690
        l->blockSignals(true);
×
691
        StelModule *hipsmgr = StelApp::getInstance().getModule("HipsMgr");
×
692
        QString url = item->data(Qt::UserRole).toString();
×
693
        HipsSurveyP hips;
×
694
        QMetaObject::invokeMethod(hipsmgr, "getSurveyByUrl", Qt::DirectConnection,
×
695
                        Q_RETURN_ARG(HipsSurveyP, hips), Q_ARG(QString, url));
×
696
        Q_ASSERT(hips);
×
697
        if (item->checkState() == Qt::Checked)
×
698
        {
699
                l->setCurrentItem(item);
×
700
                hips->setProperty("visible", true);
×
701
        }
702
        else
703
        {
704
                hips->setProperty("visible", false);
×
705
        }
706
        l->blockSignals(false);
×
707
}
×
708

709
void ViewDialog::updateTabBarListWidgetWidth()
×
710
{
711
        ui->stackListWidget->setWrapping(false);
×
712
        // Update list item sizes after translation
713
        ui->stackListWidget->adjustSize();
×
714
        QAbstractItemModel* model = ui->stackListWidget->model();
×
715
        if (!model)
×
716
                return;
×
717

718
        // stackListWidget->font() does not work properly!
719
        // It has a incorrect fontSize in the first loading, which produces the bug#995107.
720
        QFont font;
×
721
        font.setPixelSize(14);
×
722
        font.setWeight(QFont::Bold);
×
723
        QFontMetrics fontMetrics(font);
×
724
        int iconSize = ui->stackListWidget->iconSize().width();
×
725
        int width = 0;
×
726
        for (int row = 0; row < model->rowCount(); row++)
×
727
        {
728
                int textWidth = fontMetrics.boundingRect(ui->stackListWidget->item(row)->text()).width();
×
729
                width += iconSize > textWidth ? iconSize : textWidth; // use the wider one
×
730
                width += 24; // margin - 12px left and 12px right
×
731
        }
732
        // Hack to force the window to be resized...
733
        ui->stackListWidget->setMinimumWidth(width);
×
734
        ui->stackListWidget->updateGeometry();
×
735
}
×
736

737
void ViewDialog::setSelectedCardinalCheckBoxes()
×
738
{
739
        StelPropertyMgr* propMgr = StelApp::getInstance().getStelPropertyManager();
×
740
        bool cardinals = propMgr->getProperty("LandscapeMgr.cardinalPointsDisplayed")->getValue().toBool();
×
741
        bool ordinals = propMgr->getProperty("LandscapeMgr.ordinalPointsDisplayed")->getValue().toBool();
×
742
        ui->showOrdinal8WRPointsCheckBox->setEnabled(cardinals);
×
743
        ui->showOrdinal16WRPointsCheckBox->setEnabled(cardinals && ordinals);
×
744
}
×
745

746
void ViewDialog::setSelectedCatalogsFromCheckBoxes()
×
747
{
748
        Nebula::CatalogGroup flags(Nebula::CatNone);
×
749
        if (ui->checkBoxNGC->isChecked())
×
750
                flags |= Nebula::CatNGC;
×
751
        if (ui->checkBoxIC->isChecked())
×
752
                flags |= Nebula::CatIC;
×
753
        if (ui->checkBoxM->isChecked())
×
754
                flags |= Nebula::CatM;
×
755
        if (ui->checkBoxC->isChecked())
×
756
                flags |= Nebula::CatC;
×
757
        if (ui->checkBoxB->isChecked())
×
758
                flags |= Nebula::CatB;
×
759
        if (ui->checkBoxSh2->isChecked())
×
760
                flags |= Nebula::CatSh2;
×
761
        if (ui->checkBoxVdB->isChecked())
×
762
                flags |= Nebula::CatVdB;
×
763
        if (ui->checkBoxRCW->isChecked())
×
764
                flags |= Nebula::CatRCW;
×
765
        if (ui->checkBoxLBN->isChecked())
×
766
                flags |= Nebula::CatLBN;
×
767
        if (ui->checkBoxLDN->isChecked())
×
768
                flags |= Nebula::CatLDN;
×
769
        if (ui->checkBoxCr->isChecked())
×
770
                flags |= Nebula::CatCr;
×
771
        if (ui->checkBoxMel->isChecked())
×
772
                flags |= Nebula::CatMel;
×
773
        if (ui->checkBoxCed->isChecked())
×
774
                flags |= Nebula::CatCed;
×
775
        if (ui->checkBoxPGC->isChecked())
×
776
                flags |= Nebula::CatPGC;
×
777
        if (ui->checkBoxUGC->isChecked())
×
778
                flags |= Nebula::CatUGC;
×
779
        if (ui->checkBoxArp->isChecked())
×
780
                flags |= Nebula::CatArp;
×
781
        if (ui->checkBoxVV->isChecked())
×
782
                flags |= Nebula::CatVV;
×
783
        if (ui->checkBoxPK->isChecked())
×
784
                flags |= Nebula::CatPK;
×
785
        if (ui->checkBoxPNG->isChecked())
×
786
                flags |= Nebula::CatPNG;
×
787
        if (ui->checkBoxSNRG->isChecked())
×
788
                flags |= Nebula::CatSNRG;
×
789
        if (ui->checkBoxACO->isChecked())
×
790
                flags |= Nebula::CatACO;
×
791
        if (ui->checkBoxHCG->isChecked())
×
792
                flags |= Nebula::CatHCG;        
×
793
        if (ui->checkBoxESO->isChecked())
×
794
                flags |= Nebula::CatESO;
×
795
        if (ui->checkBoxVdBH->isChecked())
×
796
                flags |= Nebula::CatVdBH;
×
797
        if (ui->checkBoxDWB->isChecked())
×
798
                flags |= Nebula::CatDWB;
×
799
        if (ui->checkBoxTr->isChecked())
×
800
                flags |= Nebula::CatTr;
×
801
        if (ui->checkBoxSt->isChecked())
×
802
                flags |= Nebula::CatSt;
×
803
        if (ui->checkBoxRu->isChecked())
×
804
                flags |= Nebula::CatRu;
×
805
        if (ui->checkBoxVdBHa->isChecked())
×
806
                flags |= Nebula::CatVdBHa;
×
807
        if (ui->checkBoxOther->isChecked())
×
808
                flags |= Nebula::CatOther;
×
809

810
        GETSTELMODULE(NebulaMgr)->setCatalogFilters(flags);
×
811
}
×
812

813
void ViewDialog::setSelectedTypesFromCheckBoxes()
×
814
{
815
        Nebula::TypeGroup flags(Nebula::TypeNone);
×
816
        if (ui->checkBoxGalaxiesType->isChecked())
×
817
                flags |= Nebula::TypeGalaxies;
×
818
        if (ui->checkBoxActiveGalaxiesType->isChecked())
×
819
                flags |= Nebula::TypeActiveGalaxies;
×
820
        if (ui->checkBoxInteractingGalaxiesType->isChecked())
×
821
                flags |= Nebula::TypeInteractingGalaxies;
×
822
        if (ui->checkBoxOpenStarClustersType->isChecked())
×
823
                flags |= Nebula::TypeOpenStarClusters;
×
824
        if (ui->checkBoxGlobularStarClustersType->isChecked())
×
825
                flags |= Nebula::TypeGlobularStarClusters;
×
826
        if (ui->checkBoxBrightNebulaeType->isChecked())
×
827
                flags |= Nebula::TypeBrightNebulae;
×
828
        if (ui->checkBoxDarkNebulaeType->isChecked())
×
829
                flags |= Nebula::TypeDarkNebulae;
×
830
        if (ui->checkBoxPlanetaryNebulaeType->isChecked())
×
831
                flags |= Nebula::TypePlanetaryNebulae;
×
832
        if (ui->checkBoxHydrogenRegionsType->isChecked())
×
833
                flags |= Nebula::TypeHydrogenRegions;
×
834
        if (ui->checkBoxSupernovaRemnantsType->isChecked())
×
835
                flags |= Nebula::TypeSupernovaRemnants;
×
836
        if (ui->checkBoxGalaxyClustersType->isChecked())
×
837
                flags |= Nebula::TypeGalaxyClusters;
×
838
        if (ui->checkBoxOtherType->isChecked())
×
839
                flags |= Nebula::TypeOther;
×
840

841
        GETSTELMODULE(NebulaMgr)->setTypeFilters(flags);
×
842
}
×
843

844

845
void ViewDialog::updateSelectedCatalogsCheckBoxes()
×
846
{
847
        const Nebula::CatalogGroup flags = static_cast<Nebula::CatalogGroup>(GETSTELMODULE(NebulaMgr)->getCatalogFilters());
×
848
        ui->checkBoxNGC->setChecked(flags & Nebula::CatNGC);
×
849
        ui->checkBoxIC->setChecked(flags & Nebula::CatIC);
×
850
        ui->checkBoxM->setChecked(flags & Nebula::CatM);
×
851
        ui->checkBoxC->setChecked(flags & Nebula::CatC);
×
852
        ui->checkBoxB->setChecked(flags & Nebula::CatB);
×
853
        ui->checkBoxSh2->setChecked(flags & Nebula::CatSh2);
×
854
        ui->checkBoxVdB->setChecked(flags & Nebula::CatVdB);
×
855
        ui->checkBoxRCW->setChecked(flags & Nebula::CatRCW);
×
856
        ui->checkBoxLDN->setChecked(flags & Nebula::CatLDN);
×
857
        ui->checkBoxLBN->setChecked(flags & Nebula::CatLBN);
×
858
        ui->checkBoxCr->setChecked(flags & Nebula::CatCr);
×
859
        ui->checkBoxMel->setChecked(flags & Nebula::CatMel);
×
860
        ui->checkBoxCed->setChecked(flags & Nebula::CatCed);
×
861
        ui->checkBoxPGC->setChecked(flags & Nebula::CatPGC);
×
862
        ui->checkBoxUGC->setChecked(flags & Nebula::CatUGC);
×
863
        ui->checkBoxArp->setChecked(flags & Nebula::CatArp);
×
864
        ui->checkBoxVV->setChecked(flags & Nebula::CatVV);
×
865
        ui->checkBoxPK->setChecked(flags & Nebula::CatPK);
×
866
        ui->checkBoxPNG->setChecked(flags & Nebula::CatPNG);
×
867
        ui->checkBoxSNRG->setChecked(flags & Nebula::CatSNRG);
×
868
        ui->checkBoxACO->setChecked(flags & Nebula::CatACO);
×
869
        ui->checkBoxHCG->setChecked(flags & Nebula::CatHCG);        
×
870
        ui->checkBoxESO->setChecked(flags & Nebula::CatESO);
×
871
        ui->checkBoxVdBH->setChecked(flags & Nebula::CatVdBH);
×
872
        ui->checkBoxDWB->setChecked(flags & Nebula::CatDWB);
×
873
        ui->checkBoxTr->setChecked(flags & Nebula::CatTr);
×
874
        ui->checkBoxSt->setChecked(flags & Nebula::CatSt);
×
875
        ui->checkBoxRu->setChecked(flags & Nebula::CatRu);
×
876
        ui->checkBoxVdBHa->setChecked(flags & Nebula::CatVdBHa);
×
877
        ui->checkBoxOther->setChecked(flags & Nebula::CatOther);        
×
878
}
×
879

880
void ViewDialog::updateSelectedTypesCheckBoxes()
×
881
{
882
        const Nebula::TypeGroup flags = static_cast<Nebula::TypeGroup>(GETSTELMODULE(NebulaMgr)->getTypeFilters());
×
883
        ui->checkBoxGalaxiesType->setChecked(flags & Nebula::TypeGalaxies);
×
884
        ui->checkBoxActiveGalaxiesType->setChecked(flags & Nebula::TypeActiveGalaxies);
×
885
        ui->checkBoxInteractingGalaxiesType->setChecked(flags & Nebula::TypeInteractingGalaxies);
×
886
        ui->checkBoxOpenStarClustersType->setChecked(flags & Nebula::TypeOpenStarClusters);
×
887
        ui->checkBoxGlobularStarClustersType->setChecked(flags & Nebula::TypeGlobularStarClusters);
×
888
        ui->checkBoxBrightNebulaeType->setChecked(flags & Nebula::TypeBrightNebulae);
×
889
        ui->checkBoxDarkNebulaeType->setChecked(flags & Nebula::TypeDarkNebulae);
×
890
        ui->checkBoxPlanetaryNebulaeType->setChecked(flags & Nebula::TypePlanetaryNebulae);
×
891
        ui->checkBoxHydrogenRegionsType->setChecked(flags & Nebula::TypeHydrogenRegions);
×
892
        ui->checkBoxSupernovaRemnantsType->setChecked(flags & Nebula::TypeSupernovaRemnants);
×
893
        ui->checkBoxGalaxyClustersType->setChecked(flags & Nebula::TypeGalaxyClusters);
×
894
        ui->checkBoxOtherType->setChecked(flags & Nebula::TypeOther);
×
895
}
×
896

897
void ViewDialog::populateToolTips()
×
898
{
899
        ui->planetUseObjModelsCheckBox->setToolTip(QString("<p>%1</p>").arg(q_("Uses a polygonal 3D model for some selected subplanetary objects (small moons, asteroids, comets) instead of a spherical approximation")));
×
900
        ui->planetShowObjSelfShadowsCheckBox->setToolTip(QString("<p>%1</p>").arg(q_("Use a &quot;shadow map&quot; to simulate self-shadows of non-convex solar system objects. May reduce shadow penumbra quality on some objects.")));
×
901

902
        QString degree = QChar(0x00B0);
×
903
        ui->fovCircularMarkerSizeDoubleSpinBox->setSuffix(degree);
×
904
        ui->fovRectangularMarkerHeightDoubleSpinBox->setSuffix(degree);
×
905
        ui->fovRectangularMarkerWidthDoubleSpinBox->setSuffix(degree);
×
906
        ui->fovRectangularMarkerRotationAngleDoubleSpinBox->setSuffix(degree);
×
907
}
×
908

909
void ViewDialog::populateLists()
×
910
{
911
        // Fill the culture list widget from the available list
912
        StelApp& app = StelApp::getInstance();
×
913
        QListWidget* l = ui->culturesListWidget;
×
914
        l->blockSignals(true);
×
915
        l->clear();
×
916
        QStringList starlore = app.getSkyCultureMgr().getSkyCultureListI18();
×
917
        for ( const auto& s : starlore  )
×
918
        {
919
                l->addItem(s);
×
920
                l->findItems(s, Qt::MatchExactly).at(0)->setToolTip(s);
×
921
        }
922
        l->setCurrentItem(l->findItems(app.getSkyCultureMgr().getCurrentSkyCultureNameI18(), Qt::MatchExactly).at(0));
×
923
        l->blockSignals(false);
×
924
        updateSkyCultureText();
×
925

926
        // populate language printing combo. (taken from DeltaT combo)
927
        StelModule* cmgr = app.getModule("ConstellationMgr");
×
928
        Q_ASSERT(cmgr);
×
929
        Q_ASSERT(ui->skyCultureNamesStyleComboBox);
×
930
        QComboBox* cultureNamesStyleComboBox = ui->skyCultureNamesStyleComboBox;
×
931

932
        cultureNamesStyleComboBox->blockSignals(true);
×
933
        cultureNamesStyleComboBox->clear();
×
934
        QMetaEnum enumerator = cmgr->metaObject()->property(cmgr->metaObject()->indexOfProperty("constellationDisplayStyle")).enumerator();
×
935
        cultureNamesStyleComboBox->addItem(q_("Abbreviated"), enumerator.keyToValue("constellationsAbbreviated"));
×
936
        cultureNamesStyleComboBox->addItem(q_("Native"), enumerator.keyToValue("constellationsNative"));  // Please make this always a transcript into European letters!
×
937
        cultureNamesStyleComboBox->addItem(q_("Translated"), enumerator.keyToValue("constellationsTranslated"));
×
938
        //cultureNamesStyleComboBox->addItem(q_("English"),    ConstellationMgr::constellationsEnglish); // This is not useful.
939
        //Restore the selection
940
        int index = cultureNamesStyleComboBox->findData(cmgr->property("constellationDisplayStyle").toInt(), Qt::UserRole, Qt::MatchCaseSensitive);
×
941
        if (index==-1) index=2; // Default: Translated
×
942
        cultureNamesStyleComboBox->setCurrentIndex(index);
×
943
        cultureNamesStyleComboBox->blockSignals(false);
×
944

945
        const StelCore* core = app.getCore();
×
946
        StelGui* gui = dynamic_cast<StelGui*>(app.getGui());
×
947

948
        // Fill the projection list
949
        l = ui->projectionListWidget;
×
950
        l->blockSignals(true);
×
951
        l->clear();        
×
952
        const QStringList mappings = core->getAllProjectionTypeKeys();
×
953
        for (const auto& s : mappings)
×
954
        {
955
                l->addItem(core->projectionTypeKeyToNameI18n(s));
×
956
        }
957
        l->setCurrentItem(l->findItems(core->getCurrentProjectionNameI18n(), Qt::MatchExactly).at(0));
×
958
        l->blockSignals(false);
×
959
        if (gui)
×
960
                ui->projectionTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));
×
961
        ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::FrameJ2000)->getHtmlSummary());        
×
962

963
        // Fill the landscape list
964
        l = ui->landscapesListWidget;
×
965
        l->blockSignals(true);
×
966
        l->clear();
×
967
        StelModule* lmgr = app.getModule("LandscapeMgr");
×
968
        QStringList landscapeList = lmgr->property("allLandscapeNames").toStringList();
×
969
        for (const auto& landscapeName : qAsConst(landscapeList))
×
970
        {
971
                QString label = q_(landscapeName);
×
972
                QListWidgetItem* item = new QListWidgetItem(label);
×
973
                item->setData(Qt::UserRole, landscapeName);
×
974
                l->addItem(item);
×
975
        }
×
976
        l->sortItems(); // they may have been translated!
×
977
        QString selectedLandscapeName = lmgr->property("currentLandscapeName").toString();
×
978
        for (int i = 0; i < l->count(); i++)
×
979
        {
980
                if (l->item(i)->data(Qt::UserRole).toString() == selectedLandscapeName)
×
981
                {
982
                        l->setCurrentRow(i);
×
983
                        break;
×
984
                }
985
        }
986
        l->blockSignals(false);        
×
987
        QStringList searchPaths;
×
988
        searchPaths << StelFileMgr::findFile("landscapes/" + lmgr->property("currentLandscapeID").toString());
×
989

990
        ui->landscapeTextBrowser->setSearchPaths(searchPaths);
×
991
        if (gui)
×
992
                ui->landscapeTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));        
×
993
        ui->landscapeTextBrowser->setHtml(lmgr->property("currentLandscapeHtmlDescription").toString());        
×
994
        updateDefaultLandscape();
×
995
}
×
996

997
void ViewDialog::skyCultureChanged()
×
998
{
999
        QListWidget* l = ui->culturesListWidget;
×
1000
        l->setCurrentItem(l->findItems(StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureNameI18(), Qt::MatchExactly).at(0));
×
1001
        updateSkyCultureText();
×
1002
        updateDefaultSkyCulture();
×
1003
}
×
1004

1005
// fill the description text window, not the names in the sky.
1006
void ViewDialog::updateSkyCultureText()
×
1007
{
1008
        StelApp& app = StelApp::getInstance();
×
1009
        QString skyCultureId = app.getSkyCultureMgr().getCurrentSkyCultureID();
×
1010
        QString html = app.getSkyCultureMgr().getCurrentSkyCultureHtmlDescription();
×
1011

1012
        QStringList searchPaths;
×
1013
        searchPaths << StelFileMgr::findFile("skycultures/" + skyCultureId);
×
1014

1015
        ui->skyCultureTextBrowser->setSearchPaths(searchPaths);
×
1016
        StelGui* gui = dynamic_cast<StelGui*>(app.getGui());
×
1017
        if (gui)
×
1018
                ui->skyCultureTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));
×
1019
        ui->skyCultureTextBrowser->setHtml(html);        
×
1020
}
×
1021

1022
void ViewDialog::changeProjection(const QString& projectionNameI18n)
×
1023
{
1024
        StelCore* core = StelApp::getInstance().getCore();
×
1025
        core->setCurrentProjectionTypeKey(core->projectionNameI18nToTypeKey(projectionNameI18n));
×
1026
}
×
1027

1028
void ViewDialog::projectionChanged()
×
1029
{
1030
        StelCore* core = StelApp::getInstance().getCore();
×
1031
        QListWidget* l = ui->projectionListWidget;
×
1032
        l->setCurrentItem(l->findItems(core->getCurrentProjectionNameI18n(), Qt::MatchExactly).at(0),QItemSelectionModel::SelectCurrent);
×
1033
        ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::FrameJ2000)->getHtmlSummary());
×
1034
}
×
1035

1036

1037
void ViewDialog::changeLandscape(QListWidgetItem* item)
×
1038
{
1039
        StelApp::getInstance().getModule("LandscapeMgr")->setProperty("currentLandscapeName", item->data(Qt::UserRole).toString());
×
1040
}
×
1041

1042
void ViewDialog::landscapeChanged(QString id, QString name)
×
1043
{
1044
        StelModule* lmgr = StelApp::getInstance().getModule("LandscapeMgr");
×
1045
        for (int i = 0; i < ui->landscapesListWidget->count(); i++)
×
1046
        {
1047
                if (ui->landscapesListWidget->item(i)->data(Qt::UserRole).toString() == name)
×
1048
                {
1049
                        ui->landscapesListWidget->setCurrentRow(i, QItemSelectionModel::SelectCurrent);
×
1050
                        break;
×
1051
                }
1052
        }
1053

1054
        QStringList searchPaths;
×
1055
        searchPaths << StelFileMgr::findFile("landscapes/" + id);
×
1056

1057
        ui->landscapeTextBrowser->setSearchPaths(searchPaths);
×
1058
        ui->landscapeTextBrowser->setHtml(lmgr->property("currentLandscapeHtmlDescription").toString());
×
1059
        updateDefaultLandscape();
×
1060
        // Reset values that might have changed.
1061
        ui->showFogCheckBox->setChecked(lmgr->property("fogDisplayed").toBool());
×
1062
}
×
1063

1064
void ViewDialog::showAddRemoveLandscapesDialog()
×
1065
{
1066
        if(addRemoveLandscapesDialog == nullptr)
×
1067
                addRemoveLandscapesDialog = new AddRemoveLandscapesDialog();
×
1068

1069
        addRemoveLandscapesDialog->setVisible(true);
×
1070
}
×
1071

1072
void ViewDialog::showAtmosphereDialog()
×
1073
{
1074
        if(atmosphereDialog == nullptr)
×
1075
                atmosphereDialog = new AtmosphereDialog();
×
1076

1077
        atmosphereDialog->setVisible(true);
×
1078
}
×
1079

1080
void ViewDialog::showSkylightDialog()
×
1081
{
1082
    if(skylightDialog == nullptr)
×
1083
        skylightDialog = new SkylightDialog();
×
1084

1085
    skylightDialog->setVisible(true);
×
1086
}
×
1087

1088
void ViewDialog::showTonemappingDialog()
×
1089
{
1090
    if(tonemappingDialog == nullptr)
×
1091
        tonemappingDialog = new TonemappingDialog();
×
1092

1093
    tonemappingDialog->setVisible(true);
×
1094
}
×
1095

1096
void ViewDialog::showGreatRedSpotDialog()
×
1097
{
1098
        if(greatRedSpotDialog == nullptr)
×
1099
                greatRedSpotDialog = new GreatRedSpotDialog();
×
1100

1101
        greatRedSpotDialog->setVisible(true);
×
1102
}
×
1103

1104
void ViewDialog::showConfigureDSOColorsDialog()
×
1105
{
1106
        if(configureDSOColorsDialog == nullptr)
×
1107
                configureDSOColorsDialog = new ConfigureDSOColorsDialog();
×
1108

1109
        configureDSOColorsDialog->setVisible(true);
×
1110
}
×
1111

1112
void ViewDialog::showConfigureOrbitColorsDialog()
×
1113
{
1114
        if(configureOrbitColorsDialog == nullptr)
×
1115
                configureOrbitColorsDialog = new ConfigureOrbitColorsDialog();
×
1116

1117
        configureOrbitColorsDialog->setVisible(true);
×
1118
}
×
1119

1120
void ViewDialog::updateZhrDescription(int zhr)
×
1121
{
1122
        // GZ changed to small regions instead of hard "case" to better see a manual setting.
1123
        if (zhr==0)
×
1124
                ui->zhrLabel->setText("<small><i>"+q_("No shooting stars")+"</i></small>");
×
1125
        else if (zhr<=10)
×
1126
                ui->zhrLabel->setText("<small><i>"+q_("Normal rate")+"</i></small>");
×
1127
        else if ((zhr>=20) && (zhr<=30)) // was 25
×
1128
                ui->zhrLabel->setText("<small><i>"+q_("Standard Orionids rate")+"</i></small>");
×
1129
        else if ((zhr>=90) && (zhr<=110)) // was 100
×
1130
                ui->zhrLabel->setText("<small><i>"+q_("Standard Perseids rate")+"</i></small>");
×
1131
        else if ((zhr>=111) && (zhr<=132)) // was 120
×
1132
                ui->zhrLabel->setText("<small><i>"+q_("Standard Geminids rate")+"</i></small>");
×
1133
        else if ((zhr>=180) && (zhr<=220)) // was 200
×
1134
                ui->zhrLabel->setText("<small><i>"+q_("Exceptional Perseid rate")+"</i></small>");
×
1135
        else if ((zhr>=900) && (zhr<=1100)) // was 1000
×
1136
                ui->zhrLabel->setText("<small><i>"+q_("Meteor storm rate")+"</i></small>");
×
1137
        else if ((zhr>=5400) && (zhr<=6600)) // was 6000
×
1138
                ui->zhrLabel->setText("<small><i>"+q_("Exceptional Draconid rate")+"</i></small>");
×
1139
        else if ((zhr>=9000) && (zhr<=11000)) // was 10000
×
1140
                ui->zhrLabel->setText("<small><i>"+q_("Exceptional Leonid rate")+"</i></small>");
×
1141
        else if ((zhr>=130000) && (zhr<=160000)) // was 144000
×
1142
                ui->zhrLabel->setText("<small><i>"+q_("Very high rate (1966 Leonids)")+"</i></small>");
×
1143
        else if (zhr>=230000) // was 240000
×
1144
                ui->zhrLabel->setText("<small><i>"+q_("Highest rate ever (1833 Leonids)")+"</i></small>");
×
1145
        else
1146
                ui->zhrLabel->setText("");
×
1147
}
×
1148

1149
void ViewDialog::setCurrentLandscapeAsDefault(void)
×
1150
{
1151
        StelModule* lmgr = StelApp::getInstance().getModule("LandscapeMgr");
×
1152
        Q_ASSERT(lmgr);
×
1153
        lmgr->setProperty("defaultLandscapeID", lmgr->property("currentLandscapeID"));
×
1154
}
×
1155

1156
void ViewDialog::setCurrentCultureAsDefault(void)
×
1157
{
1158
        StelApp::getInstance().getSkyCultureMgr().setDefaultSkyCultureID(StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID());
×
1159
}
×
1160

1161
void ViewDialog::updateDefaultSkyCulture()
×
1162
{
1163
        // Check that the useAsDefaultSkyCultureCheckBox needs to be updated
1164
        bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultureID();
×
1165
        ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
×
1166
        ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
×
1167
        // Check that ray helpers and asterism lines are defined
1168
        b = GETSTELMODULE(AsterismMgr)->isLinesDefined();
×
1169
        ui->showAsterismLinesCheckBox->setEnabled(b);
×
1170
        ui->showAsterismLabelsCheckBox->setEnabled(b);
×
1171
        ui->asterismLineThicknessSpinBox->setEnabled(b);
×
1172
        ui->colorAsterismLines->setEnabled(b);
×
1173
        ui->colorAsterismLabels->setEnabled(b);
×
1174
        ui->showRayHelpersCheckBox->setEnabled(b);
×
1175
        ui->rayHelperThicknessSpinBox->setEnabled(b);
×
1176
        ui->colorRayHelpers->setEnabled(b);
×
1177
        ui->asterismsFontSizeSpinBox->setEnabled(b);
×
1178
        ui->labelAsterismsFontSize->setEnabled(b);
×
1179
}
×
1180

1181
void ViewDialog::updateDefaultLandscape()
×
1182
{
1183
        StelModule* lmgr = StelApp::getInstance().getModule("LandscapeMgr");
×
1184
        Q_ASSERT(lmgr);
×
1185
        bool isDefault = lmgr->property("currentLandscapeID") == lmgr->property("defaultLandscapeID");
×
1186
        ui->useAsDefaultLandscapeCheckBox->setChecked(isDefault);
×
1187
        ui->useAsDefaultLandscapeCheckBox->setEnabled(!isDefault);
×
1188
}
×
1189

1190
void ViewDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
×
1191
{
1192
        if (!current)
×
1193
                current = previous;
×
1194
        ui->stackedWidget->setCurrentIndex(ui->stackListWidget->row(current));
×
1195
}
×
1196

1197
void ViewDialog::populatePlanetMagnitudeAlgorithmsList()
×
1198
{
1199
        Q_ASSERT(ui->planetMagnitudeAlgorithmComboBox);
×
1200
        QComboBox* algorithms = ui->planetMagnitudeAlgorithmComboBox;
×
1201
        //Save the current selection to be restored later
1202
        algorithms->blockSignals(true);
×
1203
        int index = algorithms->currentIndex();
×
1204
        QVariant selectedAlgorithmId = algorithms->itemData(index);
×
1205
        algorithms->clear();
×
1206
        //For each algorithm, display the localized name and store the key as user data.
1207
        algorithms->addItem(qc_("G. Müller (1893)",              "magnitude algorithm"), Planet::Mueller_1893);
×
1208
        algorithms->addItem(qc_("Astronomical Almanac (1984)",   "magnitude algorithm"), Planet::AstronomicalAlmanac_1984);
×
1209
        algorithms->addItem(qc_("Explanatory Supplement (1992)", "magnitude algorithm"), Planet::ExplanatorySupplement_1992);
×
1210
        algorithms->addItem(qc_("Explanatory Supplement (2013)", "magnitude algorithm"), Planet::ExplanatorySupplement_2013);
×
1211
        algorithms->addItem(qc_("Mallama & Hilton (2018)",       "magnitude algorithm"), Planet::MallamaHilton_2018);
×
1212
        algorithms->addItem(qc_("Generic",                       "magnitude algorithm"), Planet::Generic);
×
1213
        //Restore the selection
1214
        index = algorithms->findData(selectedAlgorithmId, Qt::UserRole, Qt::MatchCaseSensitive);
×
1215
        algorithms->setCurrentIndex(index);
×
1216
        //algorithms->model()->sort(0);
1217
        algorithms->blockSignals(false);
×
1218
}
×
1219

1220
void ViewDialog::setPlanetMagnitudeAlgorithm(int algorithmID)
×
1221
{
1222
        Planet::ApparentMagnitudeAlgorithm currentAlgorithm = static_cast<Planet::ApparentMagnitudeAlgorithm>(ui->planetMagnitudeAlgorithmComboBox->itemData(algorithmID).toInt());
×
1223
        Planet::setApparentMagnitudeAlgorithm(currentAlgorithm);
×
1224
        populatePlanetMagnitudeAlgorithmDescription();
×
1225
}
×
1226

1227
void ViewDialog::populatePlanetMagnitudeAlgorithmDescription()
×
1228
{
1229
        int currentAlgorithm = ui->planetMagnitudeAlgorithmComboBox->findData(Planet::getApparentMagnitudeAlgorithm(), Qt::UserRole, Qt::MatchCaseSensitive);
×
1230
        if (currentAlgorithm==-1) // Use Mallama&Hilton 2018 as default
×
1231
                currentAlgorithm = ui->planetMagnitudeAlgorithmComboBox->findData(Planet::MallamaHilton_2018, Qt::UserRole, Qt::MatchCaseSensitive);
×
1232

1233
        const QMap<int, QString>planetMagnitudeAlgorithmMap = {
1234
                { Planet::AstronomicalAlmanac_1984, q_("The algorithm was used in the <em>Astronomical Almanac</em> (1984 and later) and gives V (instrumental) magnitudes (allegedly from D.L. Harris).") },
×
1235
                { Planet::Mueller_1893, q_("The algorithm is based on visual observations 1877-1891 by G. Müller and was still republished in the <em>Explanatory Supplement to the Astronomical Ephemeris</em> (1961).") },
×
1236
                { Planet::ExplanatorySupplement_1992, q_("The algorithm was published in the 2nd edition of the <em>Explanatory Supplement to the Astronomical Almanac</em> (1992).") },
×
1237
                { Planet::ExplanatorySupplement_2013, q_("The algorithm was published in the 3rd edition of the <em>Explanatory Supplement to the Astronomical Almanac</em> (2013).") },
×
1238
                { Planet::MallamaHilton_2018, q_("The algorithm was published by A. Mallama & J. L. Hilton: <em>Computing apparent planetary magnitudes for the Astronomical Almanac.</em> Astronomy&Computing 25 (2018) 10-24.") }
×
1239
        };
×
1240

1241
        QString info = planetMagnitudeAlgorithmMap.value(currentAlgorithm, q_("Visual magnitude based on phase angle and albedo."));
×
1242
        ui->planetMagnitudeAlgorithmDescription->setText(QString("<small>%1</small>").arg(info));
×
1243
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc