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

Stellarium / stellarium / 17068063291

19 Aug 2025 11:22AM UTC coverage: 11.766%. Remained the same
17068063291

push

github

alex-w
Reformatting

14706 of 124990 relevant lines covered (11.77%)

18303.49 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 "StelModule.hpp"
34
#include "LandscapeMgr.hpp"
35
#include "StelSkyCultureMgr.hpp"
36
#include "ConstellationMgr.hpp"
37
#include "StelFileMgr.hpp"
38
#include "StelProjector.hpp"
39
#include "StelModuleMgr.hpp"
40
#include "SolarSystem.hpp"
41
#include "Planet.hpp"
42
#include "NebulaMgr.hpp"
43
#include "AsterismMgr.hpp"
44
#include "StelStyle.hpp"
45
#include "StelGuiBase.hpp"
46
#include "StelGui.hpp"
47
#include "HipsMgr.hpp"
48
#include "StelActionMgr.hpp"
49
#include "StelPropertyMgr.hpp"
50
#include "StelHips.hpp"
51
#include "StelMovementMgr.hpp"
52

53
#include <QDebug>
54
#include <QFrame>
55
#include <QFile>
56
#include <QFileInfo>
57
#include <QSettings>
58
#include <QTimer>
59
#include <QDialog>
60
#include <QStringList>
61
#include <QJsonArray>
62

63
struct Page
64
{
65
        enum
66
        {
67
                Sky,
68
                SSO,
69
                DSO,
70
                Markings,
71
                Landscape,
72
                SkyCulture,
73
                Surveys,
74

75
                COUNT
76
        };
77
};
78

79
ViewDialog::ViewDialog(QObject* parent) : StelDialog("View", parent)
×
80
        , addRemoveLandscapesDialog(nullptr)
×
81
        , atmosphereDialog(nullptr)
×
82
        , skylightDialog(nullptr)
×
83
        , tonemappingDialog(nullptr)
×
84
        , greatRedSpotDialog(nullptr)
×
85
        , configureDSOColorsDialog(nullptr)
×
86
        , configureOrbitColorsDialog(nullptr)
×
87
{
88
        ui = new Ui_viewDialogForm;        
×
89
        // This connection should be made here, rather than in createDialogContent, because otherwise it
90
        // won't be possible to open the dialog for the first time by right-clicking the HiPS button.
91
        const auto hipsmgr = qobject_cast<HipsMgr*>(StelApp::getInstance().getModule("HipsMgr"));
×
92
        connect(qobject_cast<HipsMgr*>(hipsmgr), &HipsMgr::toggleDialog, this, &ViewDialog::toggleHipsDialog);
×
93
}
×
94

95
ViewDialog::~ViewDialog()
×
96
{
97
        delete ui;
×
98
        ui=nullptr;
×
99
        delete addRemoveLandscapesDialog;
×
100
        addRemoveLandscapesDialog = nullptr;
×
101
        delete atmosphereDialog;
×
102
        atmosphereDialog = nullptr;
×
103
        delete skylightDialog;
×
104
        skylightDialog = nullptr;
×
105
        delete tonemappingDialog;
×
106
        tonemappingDialog = nullptr;
×
107
        delete greatRedSpotDialog;
×
108
        greatRedSpotDialog = nullptr;
×
109
        delete configureDSOColorsDialog;
×
110
        configureDSOColorsDialog = nullptr;
×
111
        delete configureOrbitColorsDialog;
×
112
        configureOrbitColorsDialog = nullptr;
×
113
}
×
114

115
void ViewDialog::retranslate()
×
116
{
117
        if (dialog)
×
118
        {
119
                ui->retranslateUi(dialog);
×
120
                updateZhrDescription(StelApp::getInstance().getModule("SporadicMeteorMgr")->property("zhr").toInt());
×
121
                populateLists();
×
122
                populateToolTips();
×
123
                populatePlanetMagnitudeAlgorithmsList();
×
124
                populatePlanetMagnitudeAlgorithmDescription();
×
125
                ui->lightPollutionWidget->retranslate();
×
126
                populateHipsGroups();
×
127
                updateHips();
×
128
                //Hack to shrink the tabs to optimal size after language change
129
                //by causing the list items to be laid out again.
130
                updateTabBarListWidgetWidth();
×
131
        }
132
}
×
133

134
void ViewDialog::styleChanged(const QString &style)
×
135
{
136
        StelDialog::styleChanged(style);
×
137
        if (dialog)
×
138
        {
139
                populateLists();
×
140
                populateToolTips();
×
141
                populatePlanetMagnitudeAlgorithmsList();
×
142
                populatePlanetMagnitudeAlgorithmDescription();
×
143
                populateHipsGroups();
×
144
        }
145
}
×
146

147
void ViewDialog::connectGroupBox(QGroupBox* groupBox, const QString& actionId)
×
148
{
149
        StelAction* action = StelApp::getInstance().getStelActionManager()->findAction(actionId);
×
150
        Q_ASSERT(action);
×
151
        groupBox->setChecked(action->isChecked());
×
152
        connect(action, SIGNAL(toggled(bool)), groupBox, SLOT(setChecked(bool)));
×
153
        connect(groupBox, SIGNAL(toggled(bool)), action, SLOT(setChecked(bool)));
×
154
}
×
155

156
void ViewDialog::createDialogContent()
×
157
{
158
        ui->setupUi(dialog);
×
159
        Q_ASSERT(ui->stackedWidget->count() == Page::COUNT);
×
160
        dialog->installEventFilter(this);
×
161

162
        StelApp *app = &StelApp::getInstance();
×
163
        connect(app, SIGNAL(languageChanged()), this, SLOT(retranslate()));
×
164
        // Set the Sky tab activated by default
165
        ui->stackedWidget->setCurrentIndex(Page::Sky);
×
166
        ui->stackListWidget->setCurrentRow(Page::Sky);
×
167
        connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
×
168
        // Kinetic scrolling
169
        kineticScrollingList << ui->projectionListWidget << ui->culturesListWidget << ui->skyCultureTextBrowser << ui->landscapesListWidget
×
170
                             << ui->landscapeTextBrowser << ui->surveysListWidget << ui->surveysTextBrowser;
×
171
        StelGui* gui= dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
×
172
        if (gui)
×
173
        {
174
                enableKineticScrolling(gui->getFlagUseKineticScrolling());
×
175
                connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));
×
176
        }
177
        connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
×
178
        connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
×
179

180
        populateLists();
×
181
        populateToolTips();
×
182

183
        ui->currentFovSpinBox->setMinimum(app->getCore()->getMovementMgr()->getMinFov(), true);
×
184
        ui->currentFovSpinBox->setMaximum(360.0, true);
×
185
        ui->currentFovSpinBox->setWrapping(false);
×
186
        setDisplayFormatForSpins(app->getFlagShowDecimalDegrees());
×
187

188
        // TODOs after properties merge:
189
        // Jupiter's GRS should become property, and recheck the other "from trunk" entries.
190
        connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QString&)),&StelApp::getInstance().getSkyCultureMgr(),SLOT(setCurrentSkyCultureNameI18(QString)));
×
191
        connect(&StelApp::getInstance().getSkyCultureMgr(), &StelSkyCultureMgr::currentSkyCultureIDChanged, this, &ViewDialog::skyCultureChanged);
×
192

193
        // Connect and initialize checkboxes and other widgets
194
        SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
×
195
        Q_ASSERT(ssmgr);
×
196
        // Stars section
197
        connectGroupBox(ui->starGroupBox, "actionShow_Stars");
×
198
        connectDoubleProperty(ui->starScaleRadiusDoubleSpinBox,"StelSkyDrawer.absoluteStarScale");
×
199
        connectDoubleProperty(ui->starRelativeScaleDoubleSpinBox, "StelSkyDrawer.relativeStarScale");
×
200
        connectBoolProperty(ui->starTwinkleCheckBox, "StelSkyDrawer.flagStarTwinkle");
×
201
        connectBoolProperty(ui->starTwinkleWithoutAtmosphereCheckBox, "StelSkyDrawer.flagForcedTwinkle");
×
202
        connectDoubleProperty(ui->starTwinkleAmountDoubleSpinBox, "StelSkyDrawer.twinkleAmount");
×
203
        connectBoolProperty(ui->starLimitMagnitudeCheckBox,"StelSkyDrawer.flagStarMagnitudeLimit");
×
204
        connectDoubleProperty(ui->starLimitMagnitudeDoubleSpinBox, "StelSkyDrawer.customStarMagLimit");
×
205
        connectBoolProperty(ui->spikyStarsCheckBox, "StelSkyDrawer.flagStarSpiky");
×
206
        connectCheckBox(ui->starLabelCheckBox, "actionShow_Stars_Labels");
×
207
        connectDoubleProperty(ui->starsLabelsHorizontalSlider,"StarMgr.labelsAmount",0.0,10.0);
×
208
        connectBoolProperty(ui->checkBoxAdditionalNamesStars, "StarMgr.flagAdditionalNamesDisplayed");
×
209
        connectBoolProperty(ui->checkBoxStarDesignationsOnlyUsage, "StarMgr.flagDesignationLabels");
×
210
        connectBoolProperty(ui->dblStarsDesignationsCheckBox, "StarMgr.flagDblStarsDesignation");
×
211
        connectBoolProperty(ui->varStarsDesignationsCheckBox, "StarMgr.flagVarStarsDesignation");
×
212
        connectBoolProperty(ui->hipDesignationsCheckBox, "StarMgr.flagHIPDesignation");
×
213

214
        // Sky section
215
        connectBoolProperty(ui->milkyWayCheckBox, "MilkyWay.flagMilkyWayDisplayed");
×
216
        connectDoubleProperty(ui->milkyWayBrightnessDoubleSpinBox, "MilkyWay.intensity");
×
217
        connectDoubleProperty(ui->milkyWaySaturationDoubleSpinBox, "MilkyWay.saturation");
×
218
        connectBoolProperty(ui->zodiacalLightCheckBox, "ZodiacalLight.flagZodiacalLightDisplayed");
×
219
        connectDoubleProperty(ui->zodiacalLightBrightnessDoubleSpinBox, "ZodiacalLight.intensity");
×
220
        connectBoolProperty(ui->adaptationCheckbox, "StelSkyDrawer.flagLuminanceAdaptation");
×
221
        connectDoubleProperty(ui->twilightAltitudeDoubleSpinBox, "SpecificTimeMgr.twilightAltitude");
×
222

223
        StelModule* lmgr = StelApp::getInstance().getModule("LandscapeMgr");
×
224
        Q_ASSERT(lmgr);
×
225
        // Light pollution
226
        ui->lightPollutionWidget->setup();
×
227

228
        // atmosphere details
229
        connect(ui->pushButtonAtmosphereDetails, SIGNAL(clicked()), this, SLOT(showAtmosphereDialog()));
×
230
        // This has to be manually enabled by the user
231
        StelPropertyMgr* propMgr = StelApp::getInstance().getStelPropertyManager();
×
232
        if (propMgr->getProperty("Skylight.flagGuiPublic")->getValue().toBool())
×
233
                connect(ui->pushButtonSkylightDetails, SIGNAL(clicked()), this, SLOT(showSkylightDialog()));
×
234
        else
235
                ui->pushButtonSkylightDetails->hide();
×
236
        // tonemapping details
237
        connect(ui->tonemappingPushButton, SIGNAL(clicked()), this, SLOT(showTonemappingDialog()));
×
238

239
        // Planets section
240
        connectGroupBox(ui->planetsGroupBox, "actionShow_Planets");
×
241
        connectCheckBox(ui->planetMarkerCheckBox, "actionShow_Planets_Hints");
×
242
        connectCheckBox(ui->planetOrbitCheckBox, "actionShow_Planets_Orbits");
×
243
        connectBoolProperty(ui->planetIsolatedOrbitCheckBox, "SolarSystem.flagIsolatedOrbits");
×
244
        connectBoolProperty(ui->planetOrbitMajorPlanetsCheckBox, "SolarSystem.flagPlanetsOrbits");
×
245
        connectBoolProperty(ui->planetOrbitOnlyCheckBox, "SolarSystem.flagPlanetsOrbitsOnly");
×
246
        connectBoolProperty(ui->planetOrbitsMoonCheckBox, "SolarSystem.flagOrbitsWithMoons");
×
247
        connectBoolProperty(ui->planetOrbitPermanentCheckBox, "SolarSystem.flagPermanentOrbits");
×
248
        connectIntProperty(ui->planetOrbitsThicknessSpinBox, "SolarSystem.orbitsThickness");
×
249
        connect(ui->pushButtonOrbitColors, SIGNAL(clicked(bool)), this, SLOT(showConfigureOrbitColorsDialog()));
×
250
        populateOrbitsControls(ssmgr->getFlagOrbits());
×
251
        connect(ssmgr,SIGNAL(flagOrbitsChanged(bool)), this, SLOT(populateOrbitsControls(bool)));
×
252
        connectBoolProperty(ui->planetLightSpeedCheckBox, "SolarSystem.flagLightTravelTime");
×
253
        connectBoolProperty(ui->planetUseObjModelsCheckBox, "SolarSystem.flagUseObjModels");
×
254
        connectBoolProperty(ui->planetShowObjSelfShadowsCheckBox, "SolarSystem.flagShowObjSelfShadows");
×
255
        ui->planetShowObjSelfShadowsCheckBox->setEnabled(ssmgr->getFlagUseObjModels());
×
256
        connect(ssmgr,SIGNAL(flagUseObjModelsChanged(bool)),ui->planetShowObjSelfShadowsCheckBox, SLOT(setEnabled(bool)));
×
257
        connectBoolProperty(ui->planetLimitMagnitudeCheckBox,"StelSkyDrawer.flagPlanetMagnitudeLimit");
×
258
        connectDoubleProperty(ui->planetLimitMagnitudeDoubleSpinBox,"StelSkyDrawer.customPlanetMagLimit");
×
259
        connectBoolProperty(ui->planetScaleMoonCheckBox, "SolarSystem.flagMoonScale");
×
260
        connectDoubleProperty(ui->moonScaleFactor,"SolarSystem.moonScale");
×
261
        connectBoolProperty(ui->planetScaleMinorBodyCheckBox, "SolarSystem.flagMinorBodyScale");
×
262
        connectDoubleProperty(ui->minorBodyScaleFactor,"SolarSystem.minorBodyScale");
×
263
        connectBoolProperty(ui->planetScalePlanetsCheckBox, "SolarSystem.flagPlanetScale");
×
264
        connectDoubleProperty(ui->planetScaleFactor,"SolarSystem.planetScale");
×
265
        connectBoolProperty(ui->planetScaleSunCheckBox, "SolarSystem.flagSunScale");
×
266
        connectDoubleProperty(ui->sunScaleFactor,"SolarSystem.sunScale");
×
267
        connectCheckBox(ui->planetLabelCheckBox, "actionShow_Planets_Labels");
×
268
        connectCheckBox(ui->planetNomenclatureCheckBox, "actionShow_Planets_Nomenclature");
×
269
        connectDoubleProperty(ui->planetsLabelsHorizontalSlider, "SolarSystem.labelsAmount",0.0,10.0);        
×
270
        connectCheckBox(ui->planetNomenclatureCheckBox, "actionShow_Planets_Nomenclature");
×
271
        ui->planetNomenclatureColor->setup("NomenclatureMgr.nomenclatureColor", "color/planet_nomenclature_color");
×
272
        connectBoolProperty(ui->outlineCratersCheckBox, "NomenclatureMgr.flagOutlineCraters");
×
273
        ui->planetLabelColor->setup("SolarSystem.labelsColor", "color/planet_names_color");
×
274
        ui->planetTrailsColor->setup("SolarSystem.trailsColor", "color/object_trails_color");
×
275
        connectBoolProperty(ui->planetTrailsCheckBox, "SolarSystem.trailsDisplayed");
×
276
        connectIntProperty(ui->planetTrailsThicknessSpinBox, "SolarSystem.trailsThickness");        
×
277
        connectBoolProperty(ui->planetIsolatedTrailsCheckBox, "SolarSystem.flagIsolatedTrails");
×
278
        connectIntProperty(ui->planetIsolatedTrailsSpinBox, "SolarSystem.numberIsolatedTrails");
×
279
        connectBoolProperty(ui->drawMoonHaloCheckBox, "SolarSystem.flagDrawMoonHalo");
×
280
        connectBoolProperty(ui->minorPlanetMarkersCheckBox, "SolarSystem.flagMarkers");
×
281
        connectDoubleProperty(ui->minorPlanetMarkerMagThresholdSpinBox, "SolarSystem.markerMagThreshold");
×
282
        connectBoolProperty(ui->drawSunGlareCheckBox, "SolarSystem.flagDrawSunHalo");
×
283
        connectBoolProperty(ui->drawSunCoronaCheckBox, "SolarSystem.flagPermanentSolarCorona");
×
284
        connectBoolProperty(ui->shadowEnlargementDanjonCheckBox, "SolarSystem.earthShadowEnlargementDanjon");
×
285
        populateTrailsControls(ssmgr->getFlagTrails());
×
286
        connect(ssmgr,SIGNAL(trailsDisplayedChanged(bool)), this, SLOT(populateTrailsControls(bool)));
×
287

288
        connectBoolProperty(ui->hidePlanetNomenclatureCheckBox, "NomenclatureMgr.flagHideLocalNomenclature");
×
289
        connectBoolProperty(ui->showTerminatorNomenclatureOnlyCheckBox, "NomenclatureMgr.flagShowTerminatorZoneOnly");
×
290
        connectIntProperty(ui->terminatorMinAltSpinbox, "NomenclatureMgr.terminatorMinAltitude");
×
291
        connectIntProperty(ui->terminatorMaxAltSpinbox, "NomenclatureMgr.terminatorMaxAltitude");
×
292
        connectBoolProperty(ui->showSpecialNomenclatureOnlyCheckBox, "NomenclatureMgr.specialNomenclatureOnlyDisplayed");
×
293
        StelModule* mnmgr = StelApp::getInstance().getModule("NomenclatureMgr");
×
294
        populateNomenclatureControls(mnmgr->property("flagShowNomenclature").toBool());
×
295
        connect(mnmgr, SIGNAL(flagShowNomenclatureChanged(bool)), this, SLOT(populateNomenclatureControls(bool)));
×
296

297
        populatePlanetMagnitudeAlgorithmsList();
×
298
        int idx = ui->planetMagnitudeAlgorithmComboBox->findData(Planet::getApparentMagnitudeAlgorithm(), Qt::UserRole, Qt::MatchCaseSensitive);
×
299
        if (idx==-1)
×
300
        {
301
                // Use Mallama&Hilton_2018 as default
302
                idx = ui->planetMagnitudeAlgorithmComboBox->findData(Planet::MallamaHilton_2018, Qt::UserRole, Qt::MatchCaseSensitive);
×
303
        }
304
        ui->planetMagnitudeAlgorithmComboBox->setCurrentIndex(idx);
×
305
        connect(ui->planetMagnitudeAlgorithmComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setPlanetMagnitudeAlgorithm(int)));
×
306
        populatePlanetMagnitudeAlgorithmDescription();
×
307

308
        // GreatRedSpot (Jupiter)
309
        connect(ui->pushButtonGrsDetails, SIGNAL(clicked()), this, SLOT(showGreatRedSpotDialog()));
×
310

311
        // Link Solar System Editor button if available...
312
        StelModule *sse=StelApp::getInstance().getModuleMgr().getModule("SolarSystemEditor", true);
×
313
        if (sse)
×
314
                connect(ui->pushButtonSSE, &QPushButton::clicked, sse, [=]{sse->configureGui(true);});
×
315
        else
316
                ui->pushButtonSSE->hide();
×
317

318
        // Shooting stars section
319
        StelModule* mmgr = StelApp::getInstance().getModule("SporadicMeteorMgr");
×
320
        Q_ASSERT(mmgr);
×
321
        connectIntProperty(ui->zhrSpinBox, "SporadicMeteorMgr.zhr");
×
322
        connectIntProperty(ui->zhrSlider, "SporadicMeteorMgr.zhr", ui->zhrSlider->minimum(), ui->zhrSlider->maximum());
×
323
        updateZhrDescription(mmgr->property("zhr").toInt());
×
324
        connect(mmgr, SIGNAL(zhrChanged(int)), this, SLOT(updateZhrDescription(int)));
×
325

326
        // DSO tab contents
327
        NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
×
328
        updateSelectedCatalogsCheckBoxes();
×
329
        connect(nmgr, SIGNAL(catalogFiltersChanged(int)), this, SLOT(updateSelectedCatalogsCheckBoxes()));
×
330
        connect(ui->selectAllCatalogs, SIGNAL(clicked()), nmgr, SLOT(selectAllCatalogs()));
×
331
        connect(ui->selectStandardCatalogs, SIGNAL(clicked()), nmgr, SLOT(selectStandardCatalogs()));
×
332
        connect(ui->selectPreferredCatalogs, SIGNAL(clicked()), nmgr, SLOT(loadCatalogFilters()));
×
333
        connect(ui->storePreferredCatalogs, SIGNAL(clicked()), nmgr, SLOT(storeCatalogFilters()));
×
334
        connect(ui->selectNoneCatalogs, SIGNAL(clicked()), nmgr, SLOT(selectNoneCatalogs()));
×
335
        connect(ui->buttonGroupDisplayedDSOCatalogs, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(setSelectedCatalogsFromCheckBoxes()));
×
336
        updateSelectedTypesCheckBoxes();
×
337
        connect(nmgr, SIGNAL(typeFiltersChanged(int)), this, SLOT(updateSelectedTypesCheckBoxes()));
×
338
        connect(ui->buttonGroupDisplayedDSOTypes, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(setSelectedTypesFromCheckBoxes()));
×
339
        connectGroupBox(ui->groupBoxDSOTypeFilters,"actionSet_Nebula_TypeFilterUsage");
×
340
        // DSO Labels section
341
        connectGroupBox(ui->groupBoxDSOLabelsAndMarkers, "actionShow_Nebulas");
×
342
        connectDoubleProperty(ui->nebulasLabelsHorizontalSlider, "NebulaMgr.labelsAmount",0.0,10.0);
×
343
        connectDoubleProperty(ui->nebulasHintsHorizontalSlider, "NebulaMgr.hintsAmount",0.0,10.0);
×
344
        connectDoubleProperty(ui->hintsBrightnessDoubleSpinBox, "NebulaMgr.hintsBrightness");
×
345
        connectDoubleProperty(ui->labelsBrightnessDoubleSpinBox, "NebulaMgr.labelsBrightness");
×
346
        connectBoolProperty(ui->checkBoxDesignationsOnlyUsage, "NebulaMgr.flagDesignationLabels");
×
347
        connectBoolProperty(ui->checkBoxProportionalHints, "NebulaMgr.hintsProportional");
×
348
        connectBoolProperty(ui->checkBoxOutlines, "NebulaMgr.flagOutlinesDisplayed");
×
349
        connectBoolProperty(ui->checkBoxSurfaceBrightnessUsage, "NebulaMgr.flagSurfaceBrightnessUsage");
×
350
        connectBoolProperty(ui->nebulaLimitMagnitudeCheckBox,"StelSkyDrawer.flagNebulaMagnitudeLimit");
×
351
        connectBoolProperty(ui->checkBoxAdditionalNamesDSO, "NebulaMgr.flagAdditionalNamesDisplayed");
×
352
        connectBoolProperty(ui->checkBoxShowOnlyNamedDSO, "NebulaMgr.flagShowOnlyNamedDSO");
×
353
        connectDoubleProperty(ui->nebulaLimitMagnitudeDoubleSpinBox,"StelSkyDrawer.customNebulaMagLimit");
×
354
        connectBoolProperty(ui->nebulaLimitSizeCheckBox, "NebulaMgr.flagUseSizeLimits");
×
355
        connectDoubleProperty(ui->nebulaLimitSizeMinDoubleSpinBox, "NebulaMgr.minSizeLimit");
×
356
        connectDoubleProperty(ui->nebulaLimitSizeMaxDoubleSpinBox, "NebulaMgr.maxSizeLimit");
×
357
        connect(ui->pushButtonConfigureDSOColors, SIGNAL(clicked()), this, SLOT(showConfigureDSOColorsDialog()));
×
358

359
        // Landscape section
360
        connectCheckBox(ui->showGroundCheckBox, "actionShow_Ground");
×
361
        connectCheckBox(ui->showFogCheckBox, "actionShow_Fog");
×
362
        connectCheckBox(ui->atmosphereCheckBox, "actionShow_Atmosphere");
×
363
        connectCheckBox(ui->landscapeIlluminationCheckBox, "actionShow_LandscapeIllumination");
×
364
        connectCheckBox(ui->landscapeLabelsCheckBox, "actionShow_LandscapeLabels");
×
365

366
        connectBoolProperty(ui->landscapeLocationCheckBox, "LandscapeMgr.flagLandscapeSetsLocation");
×
367
        ui->labelsColorButton->setup("LandscapeMgr.labelColor", "landscape/label_color");
×
368
        ui->polygonColorButton->setup("LandscapeMgr.polyLineColor", "landscape/polyline_color");
×
369
        connectIntProperty(ui->landscapeLabelsFontSizeSpinBox, "LandscapeMgr.labelFontSize");
×
370
        connectIntProperty(ui->landscapeLabelsAngleSpinBox, "LandscapeMgr.labelAngle");
×
371

372
        connectBoolProperty(ui->landscapeBrightnessCheckBox,"LandscapeMgr.flagLandscapeUseMinimalBrightness");
×
373
        connect(lmgr,SIGNAL(flagLandscapeUseMinimalBrightnessChanged(bool)),ui->localLandscapeBrightnessCheckBox,SLOT(setEnabled(bool)));
×
374
        connect(lmgr,SIGNAL(flagLandscapeUseMinimalBrightnessChanged(bool)),ui->landscapeBrightnessSpinBox,SLOT(setEnabled(bool)));
×
375
        ui->localLandscapeBrightnessCheckBox->setEnabled(lmgr->property("flagLandscapeUseMinimalBrightness").toBool());
×
376
        ui->landscapeBrightnessSpinBox->setEnabled(lmgr->property("flagLandscapeUseMinimalBrightness").toBool());
×
377
        connectDoubleProperty(ui->landscapeBrightnessSpinBox,"LandscapeMgr.defaultMinimalBrightness");
×
378
        connectBoolProperty(ui->landscapeTransparencyCheckBox,"LandscapeMgr.flagLandscapeUseTransparency");
×
379
        connectDoubleProperty(ui->landscapeTransparencySpinBox,"LandscapeMgr.landscapeTransparency");
×
380
        connectBoolProperty(ui->localLandscapeBrightnessCheckBox,"LandscapeMgr.flagLandscapeSetsMinimalBrightness");
×
381
        connectBoolProperty(ui->landscapePolylineCheckBox, "LandscapeMgr.flagPolyLineDisplayedOnly");
×
382
        connectIntProperty(ui->landscapePolylineThicknessSpinBox, "LandscapeMgr.polyLineThickness");
×
383
        connect(ui->landscapesListWidget, &QListWidget::currentItemChanged, this, [=](QListWidgetItem *newItem, QListWidgetItem *oldItem){
×
384
                Q_UNUSED(oldItem)
385
                GETSTELMODULE(LandscapeMgr)->setCurrentLandscapeName(newItem->data(Qt::UserRole).toString());
×
386
        });
×
387
        connect(lmgr, SIGNAL(currentLandscapeChanged(QString,QString)), this, SLOT(landscapeChanged(QString,QString)));
×
388
        connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentLandscapeAsDefault()));
×
389
        connect(lmgr,SIGNAL(defaultLandscapeChanged(QString)),this,SLOT(updateDefaultLandscape()));
×
390
        updateDefaultLandscape();
×
391
        connect(lmgr, SIGNAL(landscapesChanged()), this, SLOT(populateLists()));
×
392
        connect(ui->pushButtonAddRemoveLandscapes, SIGNAL(clicked()), this, SLOT(showAddRemoveLandscapesDialog()));
×
393

394
        // Grid and lines
395
        connectGroupBox(ui->celestialSphereGroupBox,              "actionShow_Gridlines");
×
396
        connectCheckBox(ui->showEquatorLineCheckBox,              "actionShow_Equator_Line");
×
397
        connectCheckBox(ui->showEquatorJ2000LineCheckBox,         "actionShow_Equator_J2000_Line");
×
398
        connectCheckBox(ui->showFixedEquatorLineCheckBox,         "actionShow_Fixed_Equator_Line");
×
399
        connectCheckBox(ui->showEclipticLineJ2000CheckBox,        "actionShow_Ecliptic_J2000_Line");
×
400
        connectCheckBox(ui->showEclipticLineOfDateCheckBox,       "actionShow_Ecliptic_Line");
×
401
        connectCheckBox(ui->showInvariablePlaneCheckBox,          "actionShow_Invariable_Plane_Line");
×
402
        connectCheckBox(ui->showSolarEquatorCheckBox,             "actionShow_Solar_Equator_Line");
×
403
        connectCheckBox(ui->showMeridianLineCheckBox,             "actionShow_Meridian_Line");
×
404
        connectCheckBox(ui->showLongitudeLineCheckBox,            "actionShow_Longitude_Line");
×
405
        connectCheckBox(ui->showQuadratureLineCheckBox,           "actionShow_Quadrature_Line");
×
406
        connectCheckBox(ui->showHorizonLineCheckBox,              "actionShow_Horizon_Line");
×
407
        connectCheckBox(ui->showEquatorialGridCheckBox,                  "actionShow_Equatorial_Grid");
×
408
        connectCheckBox(ui->showFixedEquatorialGridCheckBox,      "actionShow_Fixed_Equatorial_Grid");
×
409
        connectCheckBox(ui->showGalacticGridCheckBox,             "actionShow_Galactic_Grid");
×
410
        connectCheckBox(ui->showGalacticEquatorLineCheckBox,      "actionShow_Galactic_Equator_Line");
×
411
        connectCheckBox(ui->showSupergalacticGridCheckBox,        "actionShow_Supergalactic_Grid");
×
412
        connectCheckBox(ui->showSupergalacticEquatorLineCheckBox, "actionShow_Supergalactic_Equator_Line");
×
413
        connectCheckBox(ui->showAzimuthalGridCheckBox,            "actionShow_Azimuthal_Grid");
×
414
        connectCheckBox(ui->showEquatorialJ2000GridCheckBox,      "actionShow_Equatorial_J2000_Grid");
×
415
        connectCheckBox(ui->showEclipticGridJ2000CheckBox,        "actionShow_Ecliptic_J2000_Grid");
×
416
        connectCheckBox(ui->showEclipticGridOfDateCheckBox,       "actionShow_Ecliptic_Grid");
×
417
        connectCheckBox(ui->showCardinalPointsCheckBox,           "actionShow_Cardinal_Points");
×
418
        connectCheckBox(ui->showOrdinal8WRPointsCheckBox,         "actionShow_Intercardinal_Points");
×
419
        connectCheckBox(ui->showOrdinal16WRPointsCheckBox,        "actionShow_Secondary_Intercardinal_Points");
×
420
        connectCheckBox(ui->showOrdinal32WRPointsCheckBox,        "actionShow_Tertiary_Intercardinal_Points");
×
421
        connectCheckBox(ui->showCompassMarksCheckBox,             "actionShow_Compass_Marks");
×
422
        connectCheckBox(ui->showPrecessionCirclesCheckBox,        "actionShow_Precession_Circles");
×
423
        connectCheckBox(ui->showPrimeVerticalLineCheckBox,        "actionShow_Prime_Vertical_Line");
×
424
        connectCheckBox(ui->showCurrentVerticalLineCheckBox,      "actionShow_Current_Vertical_Line");
×
425
        connectCheckBox(ui->showColuresLineCheckBox,              "actionShow_Colure_Lines");
×
426
        connectCheckBox(ui->showCircumpolarCirclesCheckBox,       "actionShow_Circumpolar_Circles");
×
427
        connectCheckBox(ui->showUmbraCheckBox,                    "actionShow_Umbra_Circle");
×
428
        connectCheckBox(ui->showUmbraCenterCheckBox,              "actionShow_Umbra_Center_Point");
×
429
        connectCheckBox(ui->showPenumbraCheckBox,                 "actionShow_Penumbra_Circle");
×
430
        connectCheckBox(ui->showCelestialJ2000PolesCheckBox,      "actionShow_Celestial_J2000_Poles");
×
431
        connectCheckBox(ui->showCelestialPolesCheckBox,           "actionShow_Celestial_Poles");
×
432
        connectCheckBox(ui->showZenithNadirCheckBox,              "actionShow_Zenith_Nadir");
×
433
        connectCheckBox(ui->showEclipticJ2000PolesCheckBox,       "actionShow_Ecliptic_J2000_Poles");
×
434
        connectCheckBox(ui->showEclipticPolesCheckBox,            "actionShow_Ecliptic_Poles");
×
435
        connectCheckBox(ui->showGalacticPolesCheckBox,            "actionShow_Galactic_Poles");
×
436
        connectCheckBox(ui->showGalacticCenterCheckBox,           "actionShow_Galactic_Center");
×
437
        connectCheckBox(ui->showSupergalacticPolesCheckBox,       "actionShow_Supergalactic_Poles");
×
438
        connectCheckBox(ui->showEquinoxJ2000PointsCheckBox,       "actionShow_Equinox_J2000_Points");
×
439
        connectCheckBox(ui->showEquinoxPointsCheckBox,            "actionShow_Equinox_Points");
×
440
        connectCheckBox(ui->showSolsticeJ2000PointsCheckBox,      "actionShow_Solstice_J2000_Points");
×
441
        connectCheckBox(ui->showSolsticePointsCheckBox,           "actionShow_Solstice_Points");
×
442
        connectCheckBox(ui->showAntisolarPointCheckBox,           "actionShow_Antisolar_Point");
×
443
        connectCheckBox(ui->showApexPointsCheckBox,               "actionShow_Apex_Points");
×
444
        connectCheckBox(ui->showFOVCenterMarkerCheckBox,          "actionShow_FOV_Center_Marker");
×
445
        connectCheckBox(ui->showFOVCircularMarkerCheckBox,        "actionShow_FOV_Circular_Marker");
×
446
        connectCheckBox(ui->showFOVRectangularMarkerCheckBox,     "actionShow_FOV_Rectangular_Marker");
×
447
        connectDoubleProperty(ui->fovCircularMarkerSizeDoubleSpinBox,             "SpecialMarkersMgr.fovCircularMarkerSize");
×
448
        connectDoubleProperty(ui->fovRectangularMarkerWidthDoubleSpinBox,         "SpecialMarkersMgr.fovRectangularMarkerWidth");
×
449
        connectDoubleProperty(ui->fovRectangularMarkerHeightDoubleSpinBox,        "SpecialMarkersMgr.fovRectangularMarkerHeight");
×
450
        connectDoubleProperty(ui->fovRectangularMarkerRotationAngleDoubleSpinBox, "SpecialMarkersMgr.fovRectangularMarkerRotationAngle");
×
451
        // The thickness of lines
452
        connectIntProperty(ui->lineThicknessSpinBox,                "GridLinesMgr.lineThickness");
×
453
        connectIntProperty(ui->partThicknessSpinBox,                "GridLinesMgr.partThickness");
×
454
        connectBoolProperty(ui->equatorPartsCheckBox,               "GridLinesMgr.equatorPartsDisplayed");
×
455
        connectBoolProperty(ui->equatorJ2000PartsCheckBox,          "GridLinesMgr.equatorJ2000PartsDisplayed");
×
456
        connectBoolProperty(ui->fixedEquatorPartsCheckBox,          "GridLinesMgr.fixedEquatorPartsDisplayed");
×
457
        connectBoolProperty(ui->eclipticPartsCheckBox,              "GridLinesMgr.eclipticPartsDisplayed");
×
458
        connectBoolProperty(ui->eclipticJ2000PartsCheckBox,         "GridLinesMgr.eclipticJ2000PartsDisplayed");
×
459
        connectBoolProperty(ui->solarEquatorPartsCheckBox,          "GridLinesMgr.solarEquatorPartsDisplayed");
×
460
        connectBoolProperty(ui->longitudePartsCheckBox,             "GridLinesMgr.longitudePartsDisplayed");
×
461
        connectBoolProperty(ui->horizonPartsCheckBox,               "GridLinesMgr.horizonPartsDisplayed");
×
462
        connectBoolProperty(ui->meridianPartsCheckBox,              "GridLinesMgr.meridianPartsDisplayed");
×
463
        connectBoolProperty(ui->primeVerticalPartsCheckBox,         "GridLinesMgr.primeVerticalPartsDisplayed");
×
464
        connectBoolProperty(ui->currentVerticalPartsCheckBox,       "GridLinesMgr.currentVerticalPartsDisplayed");
×
465
        connectBoolProperty(ui->colurePartsCheckBox,                "GridLinesMgr.colurePartsDisplayed");
×
466
        connectBoolProperty(ui->precessionPartsCheckBox,            "GridLinesMgr.precessionPartsDisplayed");
×
467
        connectBoolProperty(ui->galacticEquatorPartsCheckBox,       "GridLinesMgr.galacticEquatorPartsDisplayed");
×
468
        connectBoolProperty(ui->supergalacticEquatorPartsCheckBox,  "GridLinesMgr.supergalacticEquatorPartsDisplayed");
×
469
        connectBoolProperty(ui->equatorLabelsCheckBox,              "GridLinesMgr.equatorPartsLabeled");
×
470
        connectBoolProperty(ui->equatorJ2000LabelsCheckBox,         "GridLinesMgr.equatorJ2000PartsLabeled");
×
471
        connectBoolProperty(ui->fixedEquatorLabelsCheckBox,         "GridLinesMgr.fixedEquatorPartsLabeled");
×
472
        connectBoolProperty(ui->eclipticLabelsCheckBox,             "GridLinesMgr.eclipticPartsLabeled");
×
473
        connectBoolProperty(ui->withSolarTicksCheckbox,             "GridLinesMgr.eclipticDatesLabeled");
×
474
        connectBoolProperty(ui->eclipticJ2000LabelsCheckBox,        "GridLinesMgr.eclipticJ2000PartsLabeled");
×
475
        connectBoolProperty(ui->solarEquatorLabelsCheckBox,         "GridLinesMgr.solarEquatorPartsLabeled");
×
476
        connectBoolProperty(ui->longitudeLabelsCheckBox,            "GridLinesMgr.longitudePartsLabeled");
×
477
        connectBoolProperty(ui->horizonLabelsCheckBox,              "GridLinesMgr.horizonPartsLabeled");
×
478
        connectBoolProperty(ui->meridianLabelsCheckBox,             "GridLinesMgr.meridianPartsLabeled");
×
479
        connectBoolProperty(ui->primeVerticalLabelsCheckBox,        "GridLinesMgr.primeVerticalPartsLabeled");
×
480
        connectBoolProperty(ui->currentVerticalLabelsCheckBox,      "GridLinesMgr.currentVerticalPartsLabeled");
×
481
        connectBoolProperty(ui->colureLabelsCheckBox,               "GridLinesMgr.colurePartsLabeled");
×
482
        connectBoolProperty(ui->precessionLabelsCheckBox,           "GridLinesMgr.precessionPartsLabeled");
×
483
        connectBoolProperty(ui->galacticEquatorLabelsCheckBox,      "GridLinesMgr.galacticEquatorPartsLabeled");
×
484
        connectBoolProperty(ui->supergalacticEquatorLabelsCheckBox, "GridLinesMgr.supergalacticEquatorPartsLabeled");
×
485

486
        ui->colorEclipticGridJ2000       ->setup("GridLinesMgr.eclipticJ2000GridColor",         "color/ecliptical_J2000_color");
×
487
        ui->colorEclipticGridOfDate      ->setup("GridLinesMgr.eclipticGridColor",              "color/ecliptical_color");
×
488
        ui->colorEquatorialJ2000Grid     ->setup("GridLinesMgr.equatorJ2000GridColor",          "color/equatorial_J2000_color");
×
489
        ui->colorEquatorialGrid          ->setup("GridLinesMgr.equatorGridColor",               "color/equatorial_color");
×
490
        ui->colorFixedEquatorialGrid     ->setup("GridLinesMgr.fixedEquatorGridColor",          "color/fixed_equatorial_color");
×
491
        ui->colorGalacticGrid            ->setup("GridLinesMgr.galacticGridColor",              "color/galactic_color");
×
492
        ui->colorSupergalacticGrid       ->setup("GridLinesMgr.supergalacticGridColor",         "color/supergalactic_color");
×
493
        ui->colorAzimuthalGrid           ->setup("GridLinesMgr.azimuthalGridColor",             "color/azimuthal_color");
×
494
        ui->colorEclipticLineJ2000       ->setup("GridLinesMgr.eclipticJ2000LineColor",         "color/ecliptic_J2000_color");
×
495
        ui->colorEclipticLineOfDate      ->setup("GridLinesMgr.eclipticLineColor",              "color/ecliptic_color");
×
496
        ui->colorInvariablePlane         ->setup("GridLinesMgr.invariablePlaneLineColor",       "color/invariable_plane_color");
×
497
        ui->colorSolarEquatorLine        ->setup("GridLinesMgr.solarEquatorLineColor",          "color/solar_equator_color");
×
498
        ui->colorEquatorJ2000Line        ->setup("GridLinesMgr.equatorJ2000LineColor",          "color/equator_J2000_color");
×
499
        ui->colorEquatorLine             ->setup("GridLinesMgr.equatorLineColor",               "color/equator_color");
×
500
        ui->colorFixedEquatorLine        ->setup("GridLinesMgr.fixedEquatorLineColor",          "color/fixed_equator_color");
×
501
        ui->colorGalacticEquatorLine     ->setup("GridLinesMgr.galacticEquatorLineColor",       "color/galactic_equator_color");
×
502
        ui->colorSupergalacticEquatorLine->setup("GridLinesMgr.supergalacticEquatorLineColor",  "color/supergalactic_equator_color");
×
503
        ui->colorHorizonLine             ->setup("GridLinesMgr.horizonLineColor",               "color/horizon_color");
×
504
        ui->colorLongitudeLine           ->setup("GridLinesMgr.longitudeLineColor",             "color/oc_longitude_color");
×
505
        ui->colorQuadratureLine          ->setup("GridLinesMgr.quadratureLineColor",            "color/quadrature_color");
×
506
        ui->colorColuresLine             ->setup("GridLinesMgr.colureLinesColor",               "color/colures_color");
×
507
        ui->colorCircumpolarCircles      ->setup("GridLinesMgr.circumpolarCirclesColor",        "color/circumpolar_circles_color");
×
508
        ui->colorUmbraCircle             ->setup("GridLinesMgr.umbraCircleColor",               "color/umbra_circle_color");
×
509
        ui->colorPenumbraCircle          ->setup("GridLinesMgr.penumbraCircleColor",            "color/penumbra_circle_color");
×
510
        ui->colorPrecessionCircles       ->setup("GridLinesMgr.precessionCirclesColor",         "color/precession_circles_color");
×
511
        ui->colorPrimeVerticalLine       ->setup("GridLinesMgr.primeVerticalLineColor",         "color/prime_vertical_color");
×
512
        ui->colorCurrentVerticalLine     ->setup("GridLinesMgr.currentVerticalLineColor",       "color/current_vertical_color");
×
513
        ui->colorMeridianLine            ->setup("GridLinesMgr.meridianLineColor",              "color/meridian_color");
×
514
        ui->colorCelestialJ2000Poles     ->setup("GridLinesMgr.celestialJ2000PolesColor",       "color/celestial_J2000_poles_color");
×
515
        ui->colorCelestialPoles          ->setup("GridLinesMgr.celestialPolesColor",            "color/celestial_poles_color");
×
516
        ui->colorZenithNadir             ->setup("GridLinesMgr.zenithNadirColor",               "color/zenith_nadir_color");
×
517
        ui->colorEclipticJ2000Poles      ->setup("GridLinesMgr.eclipticJ2000PolesColor",        "color/ecliptic_J2000_poles_color");
×
518
        ui->colorEclipticPoles           ->setup("GridLinesMgr.eclipticPolesColor",             "color/ecliptic_poles_color");
×
519
        ui->colorGalacticPoles           ->setup("GridLinesMgr.galacticPolesColor",             "color/galactic_poles_color");
×
520
        ui->colorGalacticCenter          ->setup("GridLinesMgr.galacticCenterColor",            "color/galactic_center_color");
×
521
        ui->colorSupergalacticPoles      ->setup("GridLinesMgr.supergalacticPolesColor",        "color/supergalactic_poles_color");
×
522
        ui->colorEquinoxJ2000Points      ->setup("GridLinesMgr.equinoxJ2000PointsColor",        "color/equinox_J2000_points_color");
×
523
        ui->colorEquinoxPoints           ->setup("GridLinesMgr.equinoxPointsColor",             "color/equinox_points_color");
×
524
        ui->colorSolsticeJ2000Points     ->setup("GridLinesMgr.solsticeJ2000PointsColor",       "color/solstice_J2000_points_color");
×
525
        ui->colorSolsticePoints          ->setup("GridLinesMgr.solsticePointsColor",            "color/solstice_points_color");
×
526
        ui->colorAntisolarPoint          ->setup("GridLinesMgr.antisolarPointColor",            "color/antisolar_point_color");
×
527
        ui->colorApexPoints              ->setup("GridLinesMgr.apexPointsColor",                "color/apex_points_color");
×
528
        ui->colorFOVCenterMarker         ->setup("SpecialMarkersMgr.fovCenterMarkerColor",      "color/fov_center_marker_color");
×
529
        ui->colorFOVCircularMarker       ->setup("SpecialMarkersMgr.fovCircularMarkerColor",    "color/fov_circular_marker_color");
×
530
        ui->colorFOVRectangularMarker    ->setup("SpecialMarkersMgr.fovRectangularMarkerColor", "color/fov_rectangular_marker_color");
×
531
        ui->colorCardinalPoints          ->setup("LandscapeMgr.cardinalPointsColor",            "color/cardinal_color");
×
532
        ui->colorCompassMarks            ->setup("SpecialMarkersMgr.compassMarksColor",         "color/compass_marks_color");
×
533

534
#if (QT_VERSION<QT_VERSION_CHECK(6,7,0))
535
        connect(ui->showCardinalPointsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setSelectedCardinalCheckBoxes()));
×
536
        connect(ui->showOrdinal8WRPointsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setSelectedCardinalCheckBoxes()));
×
537
        connect(ui->showOrdinal16WRPointsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setSelectedCardinalCheckBoxes()));
×
538
#else
539
        connect(ui->showCardinalPointsCheckBox, SIGNAL(checkStateChanged(Qt::CheckState)), this, SLOT(setSelectedCardinalCheckBoxes()));
540
        connect(ui->showOrdinal8WRPointsCheckBox, SIGNAL(checkStateChanged(Qt::CheckState)), this, SLOT(setSelectedCardinalCheckBoxes()));
541
        connect(ui->showOrdinal16WRPointsCheckBox, SIGNAL(checkStateChanged(Qt::CheckState)), this, SLOT(setSelectedCardinalCheckBoxes()));
542
#endif
543
        setSelectedCardinalCheckBoxes();
×
544

545
        // Projection
546
        connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QString&)), this, SLOT(changeProjection(const QString&)));
×
547
        connect(StelApp::getInstance().getCore(), SIGNAL(currentProjectionTypeChanged(StelCore::ProjectionType)),this,SLOT(projectionChanged()));
×
548
        connect(app, SIGNAL(flagShowDecimalDegreesChanged(bool)), this, SLOT(setDisplayFormatForSpins(bool)));
×
549
        connectDoubleProperty(ui->viewportOffsetSpinBox, "StelMovementMgr.viewportVerticalOffsetTarget");
×
550
        connectDoubleProperty(ui->userMaxFovSpinBox, "StelMovementMgr.userMaxFov");
×
551
        connectDoubleProperty(ui->currentFovSpinBox, "StelMovementMgr.currentFov");
×
552

553
        // Sky Culture
554
        connect(ui->useAsDefaultSkyCultureCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentCultureAsDefault()));
×
555
        connect(&StelApp::getInstance().getSkyCultureMgr(), &StelSkyCultureMgr::defaultSkyCultureIDChanged,
×
556
                this, &ViewDialog::updateDefaultSkyCulture);
557
        updateDefaultSkyCulture();
×
558

559
        configureSkyCultureCheckboxes();
×
560
        StelSkyCultureMgr *scMgr=GETSTELMODULE(StelSkyCultureMgr);
×
561
        connect(scMgr, &StelSkyCultureMgr::screenLabelStyleChanged, this, &ViewDialog::configureSkyCultureCheckboxes);
×
562
        connect(scMgr, &StelSkyCultureMgr::infoLabelStyleChanged, this, &ViewDialog::configureSkyCultureCheckboxes);
×
563

564
        connect(ui->infoLabelNativeCheckBox           , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureInfoStyleFromCheckboxes);
×
565
        connect(ui->infoLabelPronounceCheckBox        , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureInfoStyleFromCheckboxes);
×
566
        connect(ui->infoLabelTransliterationCheckBox  , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureInfoStyleFromCheckboxes);
×
567
        connect(ui->infoLabelTranslationCheckBox      , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureInfoStyleFromCheckboxes);
×
568
        connect(ui->infoLabelIPACheckBox              , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureInfoStyleFromCheckboxes);
×
569
        connect(ui->infoLabelBynameCheckBox           , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureInfoStyleFromCheckboxes);
×
570
        connect(ui->infoLabelModernCheckBox           , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureInfoStyleFromCheckboxes);
×
571

572
        connect(ui->screenLabelNativeCheckBox         , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureScreenStyleFromCheckboxes);
×
573
        connect(ui->screenLabelPronounceCheckBox      , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureScreenStyleFromCheckboxes);
×
574
        connect(ui->screenLabelTransliterationCheckBox, &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureScreenStyleFromCheckboxes);
×
575
        connect(ui->screenLabelTranslationCheckBox    , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureScreenStyleFromCheckboxes);
×
576
        connect(ui->screenLabelIPACheckBox            , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureScreenStyleFromCheckboxes);
×
577
        connect(ui->screenLabelBynameCheckBox         , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureScreenStyleFromCheckboxes);
×
578
        connect(ui->screenLabelModernCheckBox         , &QCheckBox::clicked, this, &ViewDialog::updateSkyCultureScreenStyleFromCheckboxes);
×
579

580
        connectBoolProperty(ui->abbreviatedNamesCheckBox,               "StelSkyCultureMgr.flagUseAbbreviatedNames");
×
581
        connectCheckBox(ui->showConstellationLinesCheckBox,             "actionShow_Constellation_Lines");
×
582
        connectIntProperty(ui->constellationLineThicknessSpinBox,       "ConstellationMgr.constellationLineThickness");
×
583
        connectCheckBox(ui->showConstellationLabelsCheckBox,            "actionShow_Constellation_Labels");
×
584
        connectCheckBox(ui->showConstellationBoundariesCheckBox,        "actionShow_Constellation_Boundaries");
×
585
        connectIntProperty(ui->constellationBoundariesThicknessSpinBox,        "ConstellationMgr.boundariesThickness");
×
586
        connectCheckBox(ui->showConstellationArtCheckBox,               "actionShow_Constellation_Art");
×
587
        connectDoubleProperty(ui->constellationArtBrightnessSpinBox,    "ConstellationMgr.artIntensity");
×
588

589
        // fade duration
590
        connectDoubleProperty(ui->artFadeDurationDoubleSpinBox,           "ConstellationMgr.artFadeDuration");
×
591
        connectDoubleProperty(ui->boundariesFadeDurationDoubleSpinBox,    "ConstellationMgr.boundariesFadeDuration");
×
592
        connectDoubleProperty(ui->linesFadeDurationDoubleSpinBox,         "ConstellationMgr.linesFadeDuration");
×
593
        connectDoubleProperty(ui->namesFadeDurationDoubleSpinBox,         "ConstellationMgr.namesFadeDuration");
×
594
        connectDoubleProperty(ui->asterismNamesFadeDurationDoubleSpinBox, "AsterismMgr.namesFadeDuration");
×
595
        connectDoubleProperty(ui->asterismLinesFadeDurationDoubleSpinBox, "AsterismMgr.linesFadeDuration");
×
596
        connectDoubleProperty(ui->rayHelpersFadeDurationDoubleSpinBox,    "AsterismMgr.rayHelpersFadeDuration");
×
597

598
        ui->colorConstellationBoundaries->setup("ConstellationMgr.boundariesColor", "color/const_boundary_color");
×
599
        ui->colorConstellationLabels    ->setup("ConstellationMgr.namesColor",      "color/const_names_color");
×
600
        ui->colorConstellationLines     ->setup("ConstellationMgr.linesColor",      "color/const_lines_color");
×
601

602
        connectCheckBox(ui->showAsterismLinesCheckBox,          "actionShow_Asterism_Lines");
×
603
        connectIntProperty(ui->asterismLineThicknessSpinBox,    "AsterismMgr.asterismLineThickness");
×
604
        connectCheckBox(ui->showAsterismLabelsCheckBox,         "actionShow_Asterism_Labels");
×
605
        connectCheckBox(ui->showRayHelpersCheckBox,             "actionShow_Ray_Helpers");
×
606
        connectIntProperty(ui->rayHelperThicknessSpinBox,       "AsterismMgr.rayHelperThickness");
×
607

608
        connectBoolProperty(ui->selectSingleConstellationCheckBox, "ConstellationMgr.isolateSelected");
×
609
        connectBoolProperty(ui->constellationPickCheckBox,         "ConstellationMgr.flagConstellationPick");
×
610

611
        ui->colorAsterismLabels->setup("AsterismMgr.namesColor",      "color/asterism_names_color");
×
612
        ui->colorAsterismLines ->setup("AsterismMgr.linesColor",      "color/asterism_lines_color");
×
613
        ui->colorRayHelpers    ->setup("AsterismMgr.rayHelpersColor", "color/rayhelper_lines_color");
×
614

615
        QSettings *conf=StelApp::getInstance().getSettings();
×
616
        if (conf->value("gui/skyculture_enable_hulls", "false").toBool())
×
617
        {
618
                connectCheckBox(ui->constellationHullsCheckBox,                          "actionShow_Constellation_Hulls");
×
619
                ui->constellationHullsColorButton                               ->setup("ConstellationMgr.hullsColor",  "color/const_hulls_color");
×
620
                connectIntProperty(ui->constellationHullsThicknessSpinBox,              "ConstellationMgr.hullsThickness");
×
621
                connectDoubleProperty(ui->constellationHullsFadeDurationDoubleSpinBox,  "ConstellationMgr.hullsFadeDuration");
×
622
        }
623
        else
624
        {
625
                ui->constellationHullsCheckBox->hide();
×
626
                ui->constellationHullsColorButton->hide();
×
627
                ui->constellationHullsThicknessSpinBox->hide();
×
628
                ui->constellationHullsFadeDurationDoubleSpinBox->hide();
×
629
        }
630

631
        connectBoolProperty(ui->zodiacCheckBox, "ConstellationMgr.zodiacDisplayed");
×
632
        connectBoolProperty(ui->lunarSystemCheckBox, "ConstellationMgr.lunarSystemDisplayed");
×
633
        ui->zodiacColorButton->setup("ConstellationMgr.zodiacColor", "color/sc_zodiac_color");
×
634
        ui->lunarSystemColorButton->setup("ConstellationMgr.lunarSystemColor", "color/sc_lunarsystem_color");
×
635

636
        connectIntProperty(ui->zodiacThicknessSpinBox,                        "ConstellationMgr.zodiacThickness");
×
637
        connectIntProperty(ui->lunarSystemThicknessSpinBox,                "ConstellationMgr.lunarSystemThickness");
×
638
        connectDoubleProperty(ui->zodiacFadeDurationDoubleSpinBox,      "ConstellationMgr.zodiacFadeDuration");
×
639
        connectDoubleProperty(ui->lunarSystemFadeDurationDoubleSpinBox, "ConstellationMgr.lunarSystemFadeDuration");
×
640

641

642
        // Font selection
643
        connectIntProperty(ui->constellationsFontSizeSpinBox, "ConstellationMgr.fontSize");
×
644
        connectIntProperty(ui->asterismsFontSizeSpinBox,      "AsterismMgr.fontSize");
×
645

646
        // Hips mgr.
647
        populateHipsGroups();
×
648
        StelModule *hipsmgr = StelApp::getInstance().getModule("HipsMgr");        
×
649
        // HiPS updates may be very frequent when we are getting a list of
650
        // surveys, we don't want to update the widget on each of them, so the
651
        // timer is used to delay the update a bit.
652
        hipsUpdateTimer.setInterval(50);
×
653
        hipsUpdateTimer.setSingleShot(true);
×
654
        connect(&hipsUpdateTimer, &QTimer::timeout, this, &ViewDialog::updateHips);
×
655
        connect(qobject_cast<HipsMgr*>(hipsmgr), &HipsMgr::surveysChanged, this,
×
656
                [this]{ if(!hipsUpdateTimer.isActive()) hipsUpdateTimer.start(); });
×
657

658
        connect(ui->surveyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateHips()));
×
659
        connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(updateHips()));
×
660
        connect(ui->surveysListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(updateHips()), Qt::QueuedConnection);
×
661
        connect(ui->surveysListWidget, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(hipsListItemChanged(QListWidgetItem*)));
×
662
        connect(ui->surveysFilter, &QLineEdit::textChanged, this, &ViewDialog::filterSurveys);
×
663
        updateHips();
×
664

665
        updateTabBarListWidgetWidth();
×
666

667
        connect((dynamic_cast<StelGui*>(StelApp::getInstance().getGui())), &StelGui::htmlStyleChanged, this, [=](const QString &style){
×
668
                ui->surveysTextBrowser->document()->setDefaultStyleSheet(style);
×
669
                ui->projectionTextBrowser->document()->setDefaultStyleSheet(style);
×
670
                ui->landscapeTextBrowser->document()->setDefaultStyleSheet(style);
×
671
                ui->skyCultureTextBrowser->document()->setDefaultStyleSheet(style);
×
672
        });
×
673
}
×
674

675
bool ViewDialog::eventFilter(QObject* object, QEvent* event)
×
676
{
677
        if (object != dialog || event->type() != QEvent::KeyPress)
×
678
                return false;
×
679
        const auto keyEvent = static_cast<QKeyEvent*>(event);
×
680
        if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return)
×
681
                return true; // Prevent these keys pressing buttons when focus is not on the buttons
×
682
        return false;
×
683
}
684

685
void ViewDialog::setDisplayFormatForSpins(bool flagDecimalDegrees)
×
686
{
687
        int places = 0;
×
688
        AngleSpinBox::DisplayFormat format = AngleSpinBox::DMSSymbols;
×
689
        if (flagDecimalDegrees)
×
690
        {
691
                places = 5;
×
692
                format = AngleSpinBox::DecimalDeg;
×
693
        }
694
        ui->currentFovSpinBox->setDecimals(places);
×
695
        ui->currentFovSpinBox->setDisplayFormat(format);
×
696
}
×
697

698
void ViewDialog::populateOrbitsControls(bool flag)
×
699
{
700
        ui->planetIsolatedOrbitCheckBox->setEnabled(flag);
×
701
        ui->planetOrbitMajorPlanetsCheckBox->setEnabled(flag);
×
702
        ui->planetOrbitOnlyCheckBox->setEnabled(flag);
×
703
        ui->planetOrbitsMoonCheckBox->setEnabled(flag);
×
704
        ui->planetOrbitPermanentCheckBox->setEnabled(flag);
×
705
        ui->planetOrbitsThicknessSpinBox->setEnabled(flag);
×
706
        ui->pushButtonOrbitColors->setEnabled(flag);
×
707
}
×
708

709
void ViewDialog::populateTrailsControls(bool flag)
×
710
{
711
        ui->planetIsolatedTrailsCheckBox->setEnabled(flag);
×
712
        ui->planetIsolatedTrailsSpinBox->setEnabled(flag);
×
713
        ui->planetTrailsThicknessSpinBox->setEnabled(flag);
×
714
}
×
715

716
void ViewDialog::populateNomenclatureControls(bool flag)
×
717
{
718
        ui->hidePlanetNomenclatureCheckBox->setEnabled(flag);
×
719
        ui->showSpecialNomenclatureOnlyCheckBox->setEnabled(flag);
×
720
        ui->outlineCratersCheckBox->setEnabled(flag);
×
721
        ui->showTerminatorNomenclatureOnlyCheckBox->setEnabled(flag);
×
722
        ui->terminatorMinAltSpinbox->setEnabled(flag);
×
723
        ui->terminatorMaxAltSpinbox->setEnabled(flag);
×
724
        ui->labelTerminator->setEnabled(flag);
×
725
}
×
726

727
// Heuristic function to decide in which group to put a survey.
728
static QString getHipsType(const HipsSurveyP hips)
×
729
{
730
        QJsonObject properties = hips->property("properties").toJsonObject();
×
731
        if (!hips->isPlanetarySurvey())
×
732
                return "dss";
×
733
        if (properties["type"].toString() == "planet") // TODO: switch to use hips->isPlanetarySurvey() and multiple surveys for Solar system bodies
×
734
                return "sol";
×
735
        return "other";
×
736
}
×
737

738
void ViewDialog::updateHips()
×
739
{
740
        if (!ui->page_surveys->isVisible()) return;
×
741
        StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
×
742
        StelModule *hipsmgr = StelApp::getInstance().getModule("HipsMgr");
×
743
        QMetaObject::invokeMethod(hipsmgr, "loadSources");
×
744

745
        QComboBox* typeComboBox = ui->surveyTypeComboBox;
×
746
        QVariant selectedType = typeComboBox->itemData(typeComboBox->currentIndex());
×
747
        if (selectedType.isNull())
×
748
                selectedType = "dss";
×
749

750
        // Update survey list.
751
        QListWidget* l = ui->surveysListWidget;
×
752

753
        if (!hipsmgr->property("loaded").toBool())
×
754
        {
755
                l->clear();
×
756
                new QListWidgetItem(q_("Loading..."), l);
×
757
                return;
×
758
        }
759

760
        QString currentSurvey = l->currentItem() ? l->currentItem()->data(Qt::UserRole).toString() : "";
×
761
        QListWidgetItem* currentItem = nullptr;
×
762
        HipsSurveyP currentHips;
×
763

764
        l->blockSignals(true);
×
765
        l->clear();
×
766
        const QList<HipsSurveyP> hipslist = hipsmgr->property("surveys").value<QList<HipsSurveyP>>();
×
767

768
        for (auto &hips: hipslist)
×
769
        {
770
                if (getHipsType(hips) != selectedType)
×
771
                        continue;
×
772
                QString url = hips->property("url").toString();
×
773
                QJsonObject properties = hips->property("properties").toJsonObject();
×
774
                QString title = properties["obs_title"].toString();
×
775
                if (title.isEmpty())
×
776
                        continue;
×
777
                QListWidgetItem* item = new QListWidgetItem(title, l);
×
778
                item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
×
779
                item->setCheckState(hips->property("visible").toBool() ? Qt::Checked : Qt::Unchecked);
×
780
                item->setData(Qt::UserRole, url);
×
781
                if (url == currentSurvey)
×
782
                {
783
                        currentItem = item;
×
784
                        currentHips = hips;
×
785
                }
786
                disconnect(hips.data(), nullptr, this, nullptr);
×
787
                connect(hips.data(), SIGNAL(statusChanged()), this, SLOT(updateHips()));
×
788
        }
×
789
        l->sortItems(Qt::AscendingOrder);
×
790
        l->setCurrentItem(currentItem);
×
791
        l->scrollToItem(currentItem);
×
792
        l->blockSignals(false);
×
793

794
        if (!currentHips)
×
795
        {
796
                ui->surveysTextBrowser->setText("");
×
797
        }
798
        else
799
        {
800
                QJsonObject props = currentHips->property("properties").toJsonObject();
×
801
                QString html = QString("<h1>%1</h1>\n").arg(props["obs_title"].toString());
×
802
                if (props.contains("obs_copyright") && props.contains("obs_copyright_url"))
×
803
                {
804
                        html += QString("<p>Copyright <a href='%2'>%1</a></p>\n")
×
805
                                        .arg(props["obs_copyright"].toString(), props["obs_copyright_url"].toString());
×
806
                }
807
                html += QString("<p>%1</p>\n").arg(props["obs_description"].toString());
×
808
                html += "<h2>" + q_("properties") + "</h2>\n<ul>\n";
×
809
                for (auto iter = props.constBegin(); iter != props.constEnd(); iter++)
×
810
                {
811
                        html += QString("<li><b>%1</b> %2</li>\n").arg(iter.key(), iter.value().toString());
×
812
                }
813
                html += "</ul>\n";
×
814
                if (gui)
×
815
                        ui->surveysTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));
×
816
                ui->surveysTextBrowser->setHtml(html);
×
817
        }
×
818
        filterSurveys();
×
819
}
×
820

821
void ViewDialog::populateHipsGroups()
×
822
{
823
        // Update the groups combobox.
824
        QComboBox* typeComboBox = ui->surveyTypeComboBox;
×
825
        int index = typeComboBox->currentIndex();
×
826
        QVariant selectedType = typeComboBox->itemData(index);
×
827
        if (selectedType.isNull())
×
828
                selectedType = "dss";
×
829
        typeComboBox->clear();
×
830
        typeComboBox->addItem(q_("Deep Sky"), "dss");
×
831
        typeComboBox->addItem(q_("Solar System"), "sol");
×
832
        index = typeComboBox->findData(selectedType, Qt::UserRole, Qt::MatchCaseSensitive);
×
833
        typeComboBox->setCurrentIndex(index);
×
834
}
×
835

836
void ViewDialog::toggleHipsDialog()
×
837
{
838
        if (visible())
×
839
        {
840
                if (ui->stackListWidget->currentRow() == Page::Surveys)
×
841
                {
842
                        setVisible(false);
×
843
                }
844
                else
845
                {
846
                        ui->stackListWidget->setCurrentRow(Page::Surveys);
×
847
                        // Force it to become active and bring it to the top
848
                        setVisible(false);
×
849
                        setVisible(true);
×
850
                }
851
        }
852
        else
853
        {
854
                setVisible(true);
×
855
                ui->stackListWidget->setCurrentRow(Page::Surveys);
×
856
        }
857
}
×
858

859
void ViewDialog::filterSurveys()
×
860
{
861
        const QString pattern = ui->surveysFilter->text().simplified();
×
862
        const auto& list = *ui->surveysListWidget;
×
863
        for (int row = 0; row < list.count(); ++row)
×
864
        {
865
                auto& item = *list.item(row);
×
866
                const QString text = item.text().simplified();
×
867
                const bool show = pattern.isEmpty() || text.contains(pattern, Qt::CaseInsensitive);
×
868
                item.setHidden(!show);
×
869
        }
×
870
}
×
871

872
void ViewDialog::hipsListItemChanged(QListWidgetItem* item)
×
873
{
874
        QListWidget* l = item->listWidget();
×
875
        l->blockSignals(true);
×
876
        StelModule *hipsmgr = StelApp::getInstance().getModule("HipsMgr");
×
877
        QString url = item->data(Qt::UserRole).toString();
×
878
        HipsSurveyP hips;
×
879
        QMetaObject::invokeMethod(hipsmgr, "getSurveyByUrl", Qt::DirectConnection,
×
880
                        Q_RETURN_ARG(HipsSurveyP, hips), Q_ARG(QString, url));
×
881
        Q_ASSERT(hips);
×
882
        if (item->checkState() == Qt::Checked)
×
883
        {
884
                l->setCurrentItem(item);
×
885
                hips->setProperty("visible", true);
×
886
        }
887
        else
888
        {
889
                hips->setProperty("visible", false);
×
890
        }
891
        l->blockSignals(false);
×
892
}
×
893

894
void ViewDialog::updateTabBarListWidgetWidth()
×
895
{
896
        ui->stackListWidget->setWrapping(false);
×
897
        // Update list item sizes after translation
898
        ui->stackListWidget->adjustSize();
×
899
        QAbstractItemModel* model = ui->stackListWidget->model();
×
900
        if (!model)
×
901
                return;
×
902

903
        // stackListWidget->font() does not work properly!
904
        // It has a incorrect fontSize in the first loading, which produces the bug#995107.
905
        QFont font;
×
906
        font.setPixelSize(14);
×
907
        font.setWeight(QFont::Bold);
×
908
        QFontMetrics fontMetrics(font);
×
909
        int iconSize = ui->stackListWidget->iconSize().width();
×
910
        int width = 0;
×
911
        for (int row = 0; row < model->rowCount(); row++)
×
912
        {
913
                int textWidth = fontMetrics.boundingRect(ui->stackListWidget->item(row)->text()).width();
×
914
                width += iconSize > textWidth ? iconSize : textWidth; // use the wider one
×
915
                width += 24; // margin - 12px left and 12px right
×
916
        }
917
        // Hack to force the window to be resized...
918
        ui->stackListWidget->setMinimumWidth(width);
×
919
        ui->stackListWidget->updateGeometry();
×
920
}
×
921

922
void ViewDialog::setSelectedCardinalCheckBoxes()
×
923
{
924
        StelPropertyMgr* propMgr = StelApp::getInstance().getStelPropertyManager();
×
925
        bool cardinals = propMgr->getProperty("LandscapeMgr.cardinalPointsDisplayed")->getValue().toBool();
×
926
        bool ordinals = propMgr->getProperty("LandscapeMgr.ordinalPointsDisplayed")->getValue().toBool();
×
927
        bool secondary = propMgr->getProperty("LandscapeMgr.ordinal16WRPointsDisplayed")->getValue().toBool();
×
928
        ui->showOrdinal8WRPointsCheckBox->setEnabled(cardinals);
×
929
        ui->showOrdinal16WRPointsCheckBox->setEnabled(cardinals && ordinals);
×
930
        ui->showOrdinal32WRPointsCheckBox->setEnabled(cardinals && ordinals && secondary);
×
931
}
×
932

933
void ViewDialog::setSelectedCatalogsFromCheckBoxes()
×
934
{
935
        Nebula::CatalogGroup flags(Nebula::CatNone);
×
936
        if (ui->checkBoxNGC->isChecked())
×
937
                flags |= Nebula::CatNGC;
×
938
        if (ui->checkBoxIC->isChecked())
×
939
                flags |= Nebula::CatIC;
×
940
        if (ui->checkBoxM->isChecked())
×
941
                flags |= Nebula::CatM;
×
942
        if (ui->checkBoxC->isChecked())
×
943
                flags |= Nebula::CatC;
×
944
        if (ui->checkBoxB->isChecked())
×
945
                flags |= Nebula::CatB;
×
946
        if (ui->checkBoxSh2->isChecked())
×
947
                flags |= Nebula::CatSh2;
×
948
        if (ui->checkBoxVdB->isChecked())
×
949
                flags |= Nebula::CatVdB;
×
950
        if (ui->checkBoxRCW->isChecked())
×
951
                flags |= Nebula::CatRCW;
×
952
        if (ui->checkBoxLBN->isChecked())
×
953
                flags |= Nebula::CatLBN;
×
954
        if (ui->checkBoxLDN->isChecked())
×
955
                flags |= Nebula::CatLDN;
×
956
        if (ui->checkBoxCr->isChecked())
×
957
                flags |= Nebula::CatCr;
×
958
        if (ui->checkBoxMel->isChecked())
×
959
                flags |= Nebula::CatMel;
×
960
        if (ui->checkBoxCed->isChecked())
×
961
                flags |= Nebula::CatCed;
×
962
        if (ui->checkBoxPGC->isChecked())
×
963
                flags |= Nebula::CatPGC;
×
964
        if (ui->checkBoxUGC->isChecked())
×
965
                flags |= Nebula::CatUGC;
×
966
        if (ui->checkBoxArp->isChecked())
×
967
                flags |= Nebula::CatArp;
×
968
        if (ui->checkBoxVV->isChecked())
×
969
                flags |= Nebula::CatVV;
×
970
        if (ui->checkBoxPK->isChecked())
×
971
                flags |= Nebula::CatPK;
×
972
        if (ui->checkBoxPNG->isChecked())
×
973
                flags |= Nebula::CatPNG;
×
974
        if (ui->checkBoxSNRG->isChecked())
×
975
                flags |= Nebula::CatSNRG;
×
976
        if (ui->checkBoxACO->isChecked())
×
977
                flags |= Nebula::CatACO;
×
978
        if (ui->checkBoxHCG->isChecked())
×
979
                flags |= Nebula::CatHCG;        
×
980
        if (ui->checkBoxESO->isChecked())
×
981
                flags |= Nebula::CatESO;
×
982
        if (ui->checkBoxVdBH->isChecked())
×
983
                flags |= Nebula::CatVdBH;
×
984
        if (ui->checkBoxDWB->isChecked())
×
985
                flags |= Nebula::CatDWB;
×
986
        if (ui->checkBoxTr->isChecked())
×
987
                flags |= Nebula::CatTr;
×
988
        if (ui->checkBoxSt->isChecked())
×
989
                flags |= Nebula::CatSt;
×
990
        if (ui->checkBoxRu->isChecked())
×
991
                flags |= Nebula::CatRu;
×
992
        if (ui->checkBoxVdBHa->isChecked())
×
993
                flags |= Nebula::CatVdBHa;
×
994
        if (ui->checkBoxOther->isChecked())
×
995
                flags |= Nebula::CatOther;
×
996

997
        GETSTELMODULE(NebulaMgr)->setCatalogFilters(flags);
×
998
}
×
999

1000
void ViewDialog::setSelectedTypesFromCheckBoxes()
×
1001
{
1002
        Nebula::TypeGroup flags(Nebula::TypeNone);
×
1003
        if (ui->checkBoxGalaxiesType->isChecked())
×
1004
                flags |= Nebula::TypeGalaxies;
×
1005
        if (ui->checkBoxActiveGalaxiesType->isChecked())
×
1006
                flags |= Nebula::TypeActiveGalaxies;
×
1007
        if (ui->checkBoxInteractingGalaxiesType->isChecked())
×
1008
                flags |= Nebula::TypeInteractingGalaxies;
×
1009
        if (ui->checkBoxOpenStarClustersType->isChecked())
×
1010
                flags |= Nebula::TypeOpenStarClusters;
×
1011
        if (ui->checkBoxGlobularStarClustersType->isChecked())
×
1012
                flags |= Nebula::TypeGlobularStarClusters;
×
1013
        if (ui->checkBoxBrightNebulaeType->isChecked())
×
1014
                flags |= Nebula::TypeBrightNebulae;
×
1015
        if (ui->checkBoxDarkNebulaeType->isChecked())
×
1016
                flags |= Nebula::TypeDarkNebulae;
×
1017
        if (ui->checkBoxPlanetaryNebulaeType->isChecked())
×
1018
                flags |= Nebula::TypePlanetaryNebulae;
×
1019
        if (ui->checkBoxHydrogenRegionsType->isChecked())
×
1020
                flags |= Nebula::TypeHydrogenRegions;
×
1021
        if (ui->checkBoxSupernovaRemnantsType->isChecked())
×
1022
                flags |= Nebula::TypeSupernovaRemnants;
×
1023
        if (ui->checkBoxGalaxyClustersType->isChecked())
×
1024
                flags |= Nebula::TypeGalaxyClusters;
×
1025
        if (ui->checkBoxOtherType->isChecked())
×
1026
                flags |= Nebula::TypeOther;
×
1027

1028
        GETSTELMODULE(NebulaMgr)->setTypeFilters(flags);
×
1029

1030
        StelApp::immediateSave("dso_type_filters/flag_show_galaxies",             flags.testFlag(Nebula::TypeGalaxies));
×
1031
        StelApp::immediateSave("dso_type_filters/flag_show_active_galaxies",      flags.testFlag(Nebula::TypeActiveGalaxies));
×
1032
        StelApp::immediateSave("dso_type_filters/flag_show_interacting_galaxies", flags.testFlag(Nebula::TypeInteractingGalaxies));
×
1033
        StelApp::immediateSave("dso_type_filters/flag_show_open_clusters",        flags.testFlag(Nebula::TypeOpenStarClusters));
×
1034
        StelApp::immediateSave("dso_type_filters/flag_show_globular_clusters",    flags.testFlag(Nebula::TypeGlobularStarClusters));
×
1035
        StelApp::immediateSave("dso_type_filters/flag_show_bright_nebulae",       flags.testFlag(Nebula::TypeBrightNebulae));
×
1036
        StelApp::immediateSave("dso_type_filters/flag_show_dark_nebulae",         flags.testFlag(Nebula::TypeDarkNebulae));
×
1037
        StelApp::immediateSave("dso_type_filters/flag_show_planetary_nebulae",    flags.testFlag(Nebula::TypePlanetaryNebulae));
×
1038
        StelApp::immediateSave("dso_type_filters/flag_show_hydrogen_regions",     flags.testFlag(Nebula::TypeHydrogenRegions));
×
1039
        StelApp::immediateSave("dso_type_filters/flag_show_supernova_remnants",   flags.testFlag(Nebula::TypeSupernovaRemnants));
×
1040
        StelApp::immediateSave("dso_type_filters/flag_show_galaxy_clusters",      flags.testFlag(Nebula::TypeGalaxyClusters));
×
1041
        StelApp::immediateSave("dso_type_filters/flag_show_other",                flags.testFlag(Nebula::TypeOther));
×
1042
}
×
1043

1044
void ViewDialog::updateSelectedCatalogsCheckBoxes()
×
1045
{
1046
        const Nebula::CatalogGroup flags = static_cast<Nebula::CatalogGroup>(GETSTELMODULE(NebulaMgr)->getCatalogFilters());
×
1047
        ui->checkBoxNGC->setChecked(flags & Nebula::CatNGC);
×
1048
        ui->checkBoxIC->setChecked(flags & Nebula::CatIC);
×
1049
        ui->checkBoxM->setChecked(flags & Nebula::CatM);
×
1050
        ui->checkBoxC->setChecked(flags & Nebula::CatC);
×
1051
        ui->checkBoxB->setChecked(flags & Nebula::CatB);
×
1052
        ui->checkBoxSh2->setChecked(flags & Nebula::CatSh2);
×
1053
        ui->checkBoxVdB->setChecked(flags & Nebula::CatVdB);
×
1054
        ui->checkBoxRCW->setChecked(flags & Nebula::CatRCW);
×
1055
        ui->checkBoxLDN->setChecked(flags & Nebula::CatLDN);
×
1056
        ui->checkBoxLBN->setChecked(flags & Nebula::CatLBN);
×
1057
        ui->checkBoxCr->setChecked(flags & Nebula::CatCr);
×
1058
        ui->checkBoxMel->setChecked(flags & Nebula::CatMel);
×
1059
        ui->checkBoxCed->setChecked(flags & Nebula::CatCed);
×
1060
        ui->checkBoxPGC->setChecked(flags & Nebula::CatPGC);
×
1061
        ui->checkBoxUGC->setChecked(flags & Nebula::CatUGC);
×
1062
        ui->checkBoxArp->setChecked(flags & Nebula::CatArp);
×
1063
        ui->checkBoxVV->setChecked(flags & Nebula::CatVV);
×
1064
        ui->checkBoxPK->setChecked(flags & Nebula::CatPK);
×
1065
        ui->checkBoxPNG->setChecked(flags & Nebula::CatPNG);
×
1066
        ui->checkBoxSNRG->setChecked(flags & Nebula::CatSNRG);
×
1067
        ui->checkBoxACO->setChecked(flags & Nebula::CatACO);
×
1068
        ui->checkBoxHCG->setChecked(flags & Nebula::CatHCG);        
×
1069
        ui->checkBoxESO->setChecked(flags & Nebula::CatESO);
×
1070
        ui->checkBoxVdBH->setChecked(flags & Nebula::CatVdBH);
×
1071
        ui->checkBoxDWB->setChecked(flags & Nebula::CatDWB);
×
1072
        ui->checkBoxTr->setChecked(flags & Nebula::CatTr);
×
1073
        ui->checkBoxSt->setChecked(flags & Nebula::CatSt);
×
1074
        ui->checkBoxRu->setChecked(flags & Nebula::CatRu);
×
1075
        ui->checkBoxVdBHa->setChecked(flags & Nebula::CatVdBHa);
×
1076
        ui->checkBoxOther->setChecked(flags & Nebula::CatOther);        
×
1077
}
×
1078

1079
void ViewDialog::updateSelectedTypesCheckBoxes()
×
1080
{
1081
        const Nebula::TypeGroup flags = static_cast<Nebula::TypeGroup>(GETSTELMODULE(NebulaMgr)->getTypeFilters());
×
1082
        ui->checkBoxGalaxiesType->setChecked(flags & Nebula::TypeGalaxies);
×
1083
        ui->checkBoxActiveGalaxiesType->setChecked(flags & Nebula::TypeActiveGalaxies);
×
1084
        ui->checkBoxInteractingGalaxiesType->setChecked(flags & Nebula::TypeInteractingGalaxies);
×
1085
        ui->checkBoxOpenStarClustersType->setChecked(flags & Nebula::TypeOpenStarClusters);
×
1086
        ui->checkBoxGlobularStarClustersType->setChecked(flags & Nebula::TypeGlobularStarClusters);
×
1087
        ui->checkBoxBrightNebulaeType->setChecked(flags & Nebula::TypeBrightNebulae);
×
1088
        ui->checkBoxDarkNebulaeType->setChecked(flags & Nebula::TypeDarkNebulae);
×
1089
        ui->checkBoxPlanetaryNebulaeType->setChecked(flags & Nebula::TypePlanetaryNebulae);
×
1090
        ui->checkBoxHydrogenRegionsType->setChecked(flags & Nebula::TypeHydrogenRegions);
×
1091
        ui->checkBoxSupernovaRemnantsType->setChecked(flags & Nebula::TypeSupernovaRemnants);
×
1092
        ui->checkBoxGalaxyClustersType->setChecked(flags & Nebula::TypeGalaxyClusters);
×
1093
        ui->checkBoxOtherType->setChecked(flags & Nebula::TypeOther);
×
1094
}
×
1095

1096
void ViewDialog::populateToolTips()
×
1097
{
1098
        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")));
×
1099
        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.")));
×
1100

1101
        QString degree = QChar(0x00B0);
×
1102
        ui->fovCircularMarkerSizeDoubleSpinBox->setSuffix(degree);
×
1103
        ui->fovRectangularMarkerHeightDoubleSpinBox->setSuffix(degree);
×
1104
        ui->fovRectangularMarkerWidthDoubleSpinBox->setSuffix(degree);
×
1105
        ui->fovRectangularMarkerRotationAngleDoubleSpinBox->setSuffix(degree);
×
1106

1107
        // TRANSLATORS: duration in seconds
1108
        QString seconds = qc_("s", "duration, suffix");
×
1109
        ui->artFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1110
        ui->linesFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1111
        ui->namesFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1112
        ui->boundariesFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1113
        ui->constellationHullsFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1114
        ui->asterismLinesFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1115
        ui->asterismNamesFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1116
        ui->rayHelpersFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1117
        ui->zodiacFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1118
        ui->lunarSystemFadeDurationDoubleSpinBox->setSuffix(seconds);
×
1119
}
×
1120

1121
void ViewDialog::populateLists()
×
1122
{
1123
        // Fill the culture list widget from the available list
1124
        StelApp& app = StelApp::getInstance();
×
1125
        QListWidget* l = ui->culturesListWidget;
×
1126
        l->blockSignals(true);
×
1127
        l->clear();
×
1128
        const QStringList &skycultures = app.getSkyCultureMgr().getSkyCultureListI18();
×
1129
        for ( const auto& s : skycultures  )
×
1130
        {
1131
                l->addItem(s);
×
1132
                l->findItems(s, Qt::MatchExactly).at(0)->setToolTip(s);
×
1133
        }
1134
        l->setCurrentItem(l->findItems(app.getSkyCultureMgr().getCurrentSkyCultureNameI18(), Qt::MatchExactly).at(0));
×
1135
        l->blockSignals(false);
×
1136
        updateSkyCultureText();
×
1137

1138
        const StelCore* core = app.getCore();
×
1139
        StelGui* gui = dynamic_cast<StelGui*>(app.getGui());
×
1140

1141
        // Fill the projection list
1142
        l = ui->projectionListWidget;
×
1143
        l->blockSignals(true);
×
1144
        l->clear();        
×
1145
        const QStringList mappings = core->getAllProjectionTypeKeys();
×
1146
        for (const auto& s : mappings)
×
1147
        {
1148
                l->addItem(core->projectionTypeKeyToNameI18n(s));
×
1149
        }
1150
        l->setCurrentItem(l->findItems(core->getCurrentProjectionNameI18n(), Qt::MatchExactly).at(0));
×
1151
        l->blockSignals(false);
×
1152
        if (gui)
×
1153
                ui->projectionTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));
×
1154
        ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::FrameJ2000)->getHtmlSummary());        
×
1155

1156
        // Fill the landscape list
1157
        l = ui->landscapesListWidget;
×
1158
        l->blockSignals(true);
×
1159
        l->clear();
×
1160
        StelModule* lmgr = app.getModule("LandscapeMgr");
×
1161
        QStringList landscapeList = lmgr->property("allLandscapeNames").toStringList();
×
1162
        for (const auto& landscapeName : std::as_const(landscapeList))
×
1163
        {
1164
                QString label = q_(landscapeName);
×
1165
                QListWidgetItem* item = new QListWidgetItem(label);
×
1166
                item->setData(Qt::UserRole, landscapeName);
×
1167
                l->addItem(item);
×
1168
        }
×
1169
        l->sortItems(); // they may have been translated!
×
1170
        QString selectedLandscapeName = lmgr->property("currentLandscapeName").toString();
×
1171
        for (int i = 0; i < l->count(); i++)
×
1172
        {
1173
                if (l->item(i)->data(Qt::UserRole).toString() == selectedLandscapeName)
×
1174
                {
1175
                        l->setCurrentRow(i);
×
1176
                        break;
×
1177
                }
1178
        }
1179
        l->blockSignals(false);        
×
1180
        QStringList searchPaths;
×
1181
        searchPaths << StelFileMgr::findFile("landscapes/" + lmgr->property("currentLandscapeID").toString());
×
1182

1183
        ui->landscapeTextBrowser->setSearchPaths(searchPaths);
×
1184
        if (gui)
×
1185
                ui->landscapeTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));        
×
1186
        ui->landscapeTextBrowser->setHtml(lmgr->property("currentLandscapeHtmlDescription").toString());        
×
1187
        updateDefaultLandscape();
×
1188
}
×
1189

1190
void ViewDialog::configureSkyCultureCheckboxes()
×
1191
{
1192
        static StelSkyCultureMgr *scMgr     = GETSTELMODULE(StelSkyCultureMgr);
×
1193
        StelObject::CulturalDisplayStyle infoStyle   = scMgr->getInfoLabelStyle();
×
1194
        StelObject::CulturalDisplayStyle screenStyle = scMgr->getScreenLabelStyle();
×
1195
        static ConstellationMgr *cMgr       = GETSTELMODULE(ConstellationMgr);
×
1196
        const bool hasZodiac=cMgr->hasZodiac();
×
1197
        const bool hasLunarSystem=cMgr->hasLunarSystem();
×
1198

1199
        ui->infoLabelNativeCheckBox           ->setChecked(int(infoStyle)   & int(StelObject::CulturalDisplayStyle::Native));
×
1200
        ui->infoLabelPronounceCheckBox        ->setChecked(int(infoStyle)   & int(StelObject::CulturalDisplayStyle::Pronounce));
×
1201
        ui->infoLabelTransliterationCheckBox  ->setChecked(int(infoStyle)   & int(StelObject::CulturalDisplayStyle::Translit));
×
1202
        ui->infoLabelTranslationCheckBox      ->setChecked(int(infoStyle)   & int(StelObject::CulturalDisplayStyle::Translated));
×
1203
        ui->infoLabelIPACheckBox              ->setChecked(int(infoStyle)   & int(StelObject::CulturalDisplayStyle::IPA));
×
1204
        ui->infoLabelBynameCheckBox           ->setChecked(int(infoStyle)   & int(StelObject::CulturalDisplayStyle::Byname));
×
1205
        ui->infoLabelModernCheckBox           ->setChecked(int(infoStyle)   & int(StelObject::CulturalDisplayStyle::Modern));
×
1206
        ui->screenLabelNativeCheckBox         ->setChecked(int(screenStyle) & int(StelObject::CulturalDisplayStyle::Native));
×
1207
        ui->screenLabelPronounceCheckBox      ->setChecked(int(screenStyle) & int(StelObject::CulturalDisplayStyle::Pronounce));
×
1208
        ui->screenLabelTransliterationCheckBox->setChecked(int(screenStyle) & int(StelObject::CulturalDisplayStyle::Translit));
×
1209
        ui->screenLabelTranslationCheckBox    ->setChecked(int(screenStyle) & int(StelObject::CulturalDisplayStyle::Translated));
×
1210
        ui->screenLabelIPACheckBox            ->setChecked(int(screenStyle) & int(StelObject::CulturalDisplayStyle::IPA));
×
1211
        ui->screenLabelBynameCheckBox         ->setChecked(int(screenStyle) & int(StelObject::CulturalDisplayStyle::Byname));
×
1212
        ui->screenLabelModernCheckBox         ->setChecked(int(screenStyle) & int(StelObject::CulturalDisplayStyle::Modern));
×
1213

1214
        ui->zodiacCheckBox->setEnabled(hasZodiac);
×
1215
        ui->zodiacColorButton->setEnabled(hasZodiac);
×
1216
        ui->zodiacFadeDurationDoubleSpinBox->setEnabled(hasZodiac);
×
1217
        ui->zodiacThicknessSpinBox->setEnabled(hasZodiac);
×
1218
        ui->lunarSystemCheckBox->setEnabled(hasLunarSystem);
×
1219
        ui->lunarSystemColorButton->setEnabled(hasLunarSystem);
×
1220
        ui->lunarSystemFadeDurationDoubleSpinBox->setEnabled(hasLunarSystem);
×
1221
        ui->lunarSystemThicknessSpinBox->setEnabled(hasLunarSystem);
×
1222
}
×
1223

1224
void ViewDialog::updateSkyCultureInfoStyleFromCheckboxes()
×
1225
{
1226
        static StelSkyCultureMgr *scMgr       = GETSTELMODULE(StelSkyCultureMgr);
×
1227

1228
        scMgr->setInfoLabelStyle(static_cast<StelObject::CulturalDisplayStyle>(
×
1229
                                int(ui->infoLabelBynameCheckBox         ->isChecked()) << 6 |
×
1230
                                int(ui->infoLabelNativeCheckBox         ->isChecked()) << 5 |
×
1231
                                int(ui->infoLabelPronounceCheckBox      ->isChecked()) << 4 |
×
1232
                                int(ui->infoLabelTransliterationCheckBox->isChecked()) << 3 |
×
1233
                                int(ui->infoLabelTranslationCheckBox    ->isChecked()) << 2 |
×
1234
                                int(ui->infoLabelIPACheckBox            ->isChecked()) << 1 |
×
1235
                                int(ui->infoLabelModernCheckBox         ->isChecked())
×
1236
                                ));
1237
}
×
1238

1239
void ViewDialog::updateSkyCultureScreenStyleFromCheckboxes()
×
1240
{
1241
        static StelSkyCultureMgr *scMgr       = GETSTELMODULE(StelSkyCultureMgr);
×
1242

1243
        scMgr->setScreenLabelStyle(static_cast<StelObject::CulturalDisplayStyle>(
×
1244
                                int(ui->screenLabelBynameCheckBox         ->isChecked()) << 6 |
×
1245
                                int(ui->screenLabelNativeCheckBox         ->isChecked()) << 5 |
×
1246
                                int(ui->screenLabelPronounceCheckBox      ->isChecked()) << 4 |
×
1247
                                int(ui->screenLabelTransliterationCheckBox->isChecked()) << 3 |
×
1248
                                int(ui->screenLabelTranslationCheckBox    ->isChecked()) << 2 |
×
1249
                                int(ui->screenLabelIPACheckBox            ->isChecked()) << 1 |
×
1250
                                int(ui->screenLabelModernCheckBox         ->isChecked())
×
1251
                                ));
1252
}
×
1253

1254
void ViewDialog::skyCultureChanged()
×
1255
{
1256
        QListWidget* l = ui->culturesListWidget;
×
1257
        l->setCurrentItem(l->findItems(StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureNameI18(), Qt::MatchExactly).at(0));
×
1258
        updateSkyCultureText();
×
1259
        updateDefaultSkyCulture();
×
1260
        configureSkyCultureCheckboxes();
×
1261
}
×
1262

1263
// fill the description text window, not the names in the sky.
1264
void ViewDialog::updateSkyCultureText()
×
1265
{
1266
        StelApp& app = StelApp::getInstance();
×
1267
        QString skyCultureId = app.getSkyCultureMgr().getCurrentSkyCultureID();
×
1268
        QString html = app.getSkyCultureMgr().getCurrentSkyCultureHtmlDescription();
×
1269

1270
        QStringList searchPaths;
×
1271
        searchPaths << StelFileMgr::findFile("skycultures/" + skyCultureId);
×
1272

1273
        ui->skyCultureTextBrowser->setSearchPaths(searchPaths);
×
1274
        StelGui* gui = dynamic_cast<StelGui*>(app.getGui());
×
1275
        if (gui)
×
1276
                ui->skyCultureTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));
×
1277
        ui->skyCultureTextBrowser->setHtml(html);        
×
1278
}
×
1279

1280
void ViewDialog::changeProjection(const QString& projectionNameI18n)
×
1281
{
1282
        StelCore* core = StelApp::getInstance().getCore();
×
1283
        core->setCurrentProjectionTypeKey(core->projectionNameI18nToTypeKey(projectionNameI18n));
×
1284
}
×
1285

1286
void ViewDialog::projectionChanged()
×
1287
{
1288
        StelCore* core = StelApp::getInstance().getCore();
×
1289
        QListWidget* l = ui->projectionListWidget;
×
1290
        l->setCurrentItem(l->findItems(core->getCurrentProjectionNameI18n(), Qt::MatchExactly).at(0),QItemSelectionModel::SelectCurrent);
×
1291
        ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::FrameJ2000)->getHtmlSummary());
×
1292
        ui->currentFovSpinBox->setMaximum(core->getProjection(StelCore::FrameJ2000)->getMaxFov(), true);
×
1293
}
×
1294

1295
void ViewDialog::landscapeChanged(QString id, QString name)
×
1296
{
1297
        StelModule* lmgr = StelApp::getInstance().getModule("LandscapeMgr");
×
1298
        for (int i = 0; i < ui->landscapesListWidget->count(); i++)
×
1299
        {
1300
                if (ui->landscapesListWidget->item(i)->data(Qt::UserRole).toString() == name)
×
1301
                {
1302
                        ui->landscapesListWidget->setCurrentRow(i, QItemSelectionModel::SelectCurrent);
×
1303
                        break;
×
1304
                }
1305
        }
1306

1307
        QStringList searchPaths;
×
1308
        searchPaths << StelFileMgr::findFile("landscapes/" + id);
×
1309

1310
        ui->landscapeTextBrowser->setSearchPaths(searchPaths);
×
1311
        ui->landscapeTextBrowser->setHtml(lmgr->property("currentLandscapeHtmlDescription").toString());
×
1312
        updateDefaultLandscape();
×
1313
        // Reset values that might have changed.
1314
        ui->showFogCheckBox->setChecked(lmgr->property("fogDisplayed").toBool());
×
1315
}
×
1316

1317
void ViewDialog::showAddRemoveLandscapesDialog()
×
1318
{
1319
        if(addRemoveLandscapesDialog == nullptr)
×
1320
                addRemoveLandscapesDialog = new AddRemoveLandscapesDialog();
×
1321

1322
        addRemoveLandscapesDialog->setVisible(true);
×
1323
}
×
1324

1325
void ViewDialog::showAtmosphereDialog()
×
1326
{
1327
        if(atmosphereDialog == nullptr)
×
1328
                atmosphereDialog = new AtmosphereDialog();
×
1329

1330
        atmosphereDialog->setVisible(true);
×
1331
}
×
1332

1333
void ViewDialog::showSkylightDialog()
×
1334
{
1335
    if(skylightDialog == nullptr)
×
1336
        skylightDialog = new SkylightDialog();
×
1337

1338
    skylightDialog->setVisible(true);
×
1339
}
×
1340

1341
void ViewDialog::showTonemappingDialog()
×
1342
{
1343
    if(tonemappingDialog == nullptr)
×
1344
        tonemappingDialog = new TonemappingDialog();
×
1345

1346
    tonemappingDialog->setVisible(true);
×
1347
}
×
1348

1349
void ViewDialog::showGreatRedSpotDialog()
×
1350
{
1351
        if(greatRedSpotDialog == nullptr)
×
1352
                greatRedSpotDialog = new GreatRedSpotDialog();
×
1353

1354
        greatRedSpotDialog->setVisible(true);
×
1355
}
×
1356

1357
void ViewDialog::showConfigureDSOColorsDialog()
×
1358
{
1359
        if(configureDSOColorsDialog == nullptr)
×
1360
                configureDSOColorsDialog = new ConfigureDSOColorsDialog();
×
1361

1362
        configureDSOColorsDialog->setVisible(true);
×
1363
}
×
1364

1365
void ViewDialog::showConfigureOrbitColorsDialog()
×
1366
{
1367
        if(configureOrbitColorsDialog == nullptr)
×
1368
                configureOrbitColorsDialog = new ConfigureOrbitColorsDialog();
×
1369

1370
        configureOrbitColorsDialog->setVisible(true);
×
1371
}
×
1372

1373
void ViewDialog::updateZhrDescription(int zhr)
×
1374
{
1375
        // GZ changed to small regions instead of hard "case" to better see a manual setting.
1376
        if (zhr==0)
×
1377
                ui->zhrLabel->setText("<small><i>"+q_("No shooting stars")+"</i></small>");
×
1378
        else if (zhr<=10)
×
1379
                ui->zhrLabel->setText("<small><i>"+q_("Normal rate")+"</i></small>");
×
1380
        else if ((zhr>=20) && (zhr<=30)) // was 25
×
1381
                ui->zhrLabel->setText("<small><i>"+q_("Standard Orionids rate")+"</i></small>");
×
1382
        else if ((zhr>=90) && (zhr<=110)) // was 100
×
1383
                ui->zhrLabel->setText("<small><i>"+q_("Standard Perseids rate")+"</i></small>");
×
1384
        else if ((zhr>=111) && (zhr<=132)) // was 120
×
1385
                ui->zhrLabel->setText("<small><i>"+q_("Standard Geminids rate")+"</i></small>");
×
1386
        else if ((zhr>=180) && (zhr<=220)) // was 200
×
1387
                ui->zhrLabel->setText("<small><i>"+q_("Exceptional Perseid rate")+"</i></small>");
×
1388
        else if ((zhr>=900) && (zhr<=1100)) // was 1000
×
1389
                ui->zhrLabel->setText("<small><i>"+q_("Meteor storm rate")+"</i></small>");
×
1390
        else if ((zhr>=5400) && (zhr<=6600)) // was 6000
×
1391
                ui->zhrLabel->setText("<small><i>"+q_("Exceptional Draconid rate")+"</i></small>");
×
1392
        else if ((zhr>=9000) && (zhr<=11000)) // was 10000
×
1393
                ui->zhrLabel->setText("<small><i>"+q_("Exceptional Leonid rate")+"</i></small>");
×
1394
        else if ((zhr>=130000) && (zhr<=160000)) // was 144000
×
1395
                ui->zhrLabel->setText("<small><i>"+q_("Very high rate (1966 Leonids)")+"</i></small>");
×
1396
        else if (zhr>=230000) // was 240000
×
1397
                ui->zhrLabel->setText("<small><i>"+q_("Highest rate ever (1833 Leonids)")+"</i></small>");
×
1398
        else
1399
                ui->zhrLabel->setText("");
×
1400
}
×
1401

1402
void ViewDialog::setCurrentLandscapeAsDefault(void)
×
1403
{
1404
        StelModule* lmgr = StelApp::getInstance().getModule("LandscapeMgr");
×
1405
        Q_ASSERT(lmgr);
×
1406
        lmgr->setProperty("defaultLandscapeID", lmgr->property("currentLandscapeID"));
×
1407
}
×
1408

1409
void ViewDialog::setCurrentCultureAsDefault(void)
×
1410
{
1411
        StelApp::getInstance().getSkyCultureMgr().setDefaultSkyCultureID(StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID());
×
1412
}
×
1413

1414
void ViewDialog::updateDefaultSkyCulture()
×
1415
{
1416
        // Check that the useAsDefaultSkyCultureCheckBox needs to be updated
1417
        bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultureID();
×
1418
        ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
×
1419
        ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
×
1420
        // Check that ray helpers and asterism lines are defined
1421
        b = GETSTELMODULE(AsterismMgr)->isLinesDefined();
×
1422
        ui->showAsterismLinesCheckBox->setEnabled(b);
×
1423
        ui->showAsterismLabelsCheckBox->setEnabled(b);
×
1424
        ui->asterismLineThicknessSpinBox->setEnabled(b);
×
1425
        ui->colorAsterismLines->setEnabled(b);
×
1426
        ui->colorAsterismLabels->setEnabled(b);
×
1427
        ui->showRayHelpersCheckBox->setEnabled(b);
×
1428
        ui->rayHelperThicknessSpinBox->setEnabled(b);
×
1429
        ui->colorRayHelpers->setEnabled(b);
×
1430
        ui->asterismsFontSizeSpinBox->setEnabled(b);
×
1431
}
×
1432

1433
void ViewDialog::updateDefaultLandscape()
×
1434
{
1435
        StelModule* lmgr = StelApp::getInstance().getModule("LandscapeMgr");
×
1436
        Q_ASSERT(lmgr);
×
1437
        bool isDefault = lmgr->property("currentLandscapeID") == lmgr->property("defaultLandscapeID");
×
1438
        ui->useAsDefaultLandscapeCheckBox->setChecked(isDefault);
×
1439
        ui->useAsDefaultLandscapeCheckBox->setEnabled(!isDefault);
×
1440
}
×
1441

1442
void ViewDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
×
1443
{
1444
        if (!current)
×
1445
                current = previous;
×
1446
        ui->stackedWidget->setCurrentIndex(ui->stackListWidget->row(current));
×
1447
}
×
1448

1449
void ViewDialog::populatePlanetMagnitudeAlgorithmsList()
×
1450
{
1451
        Q_ASSERT(ui->planetMagnitudeAlgorithmComboBox);
×
1452
        QComboBox* algorithms = ui->planetMagnitudeAlgorithmComboBox;
×
1453
        //Save the current selection to be restored later
1454
        algorithms->blockSignals(true);
×
1455
        int index = algorithms->currentIndex();
×
1456
        QVariant selectedAlgorithmId = algorithms->itemData(index);
×
1457
        algorithms->clear();
×
1458
        //For each algorithm, display the localized name and store the key as user data.
1459
        algorithms->addItem(qc_("G. Müller (1893)",              "magnitude algorithm"), Planet::Mueller_1893);
×
1460
        algorithms->addItem(qc_("Astronomical Almanac (1984)",   "magnitude algorithm"), Planet::AstronomicalAlmanac_1984);
×
1461
        algorithms->addItem(qc_("Explanatory Supplement (1992)", "magnitude algorithm"), Planet::ExplanatorySupplement_1992);
×
1462
        algorithms->addItem(qc_("Explanatory Supplement (2013)", "magnitude algorithm"), Planet::ExplanatorySupplement_2013);
×
1463
        algorithms->addItem(qc_("Mallama & Hilton (2018)",       "magnitude algorithm"), Planet::MallamaHilton_2018);
×
1464
        algorithms->addItem(qc_("Generic",                       "magnitude algorithm"), Planet::Generic);
×
1465
        //Restore the selection
1466
        index = algorithms->findData(selectedAlgorithmId, Qt::UserRole, Qt::MatchCaseSensitive);
×
1467
        algorithms->setCurrentIndex(index);
×
1468
        //algorithms->model()->sort(0);
1469
        algorithms->blockSignals(false);
×
1470
}
×
1471

1472
void ViewDialog::setPlanetMagnitudeAlgorithm(int algorithmID)
×
1473
{
1474
        Planet::ApparentMagnitudeAlgorithm newAlgorithm = static_cast<Planet::ApparentMagnitudeAlgorithm>(ui->planetMagnitudeAlgorithmComboBox->itemData(algorithmID).toInt());
×
1475

1476
        GETSTELMODULE(SolarSystem)->setApparentMagnitudeAlgorithmOnEarth(newAlgorithm);
×
1477
        populatePlanetMagnitudeAlgorithmDescription();
×
1478
}
×
1479

1480
void ViewDialog::populatePlanetMagnitudeAlgorithmDescription()
×
1481
{
1482
        int currentAlgorithm = ui->planetMagnitudeAlgorithmComboBox->findData(Planet::getApparentMagnitudeAlgorithm(), Qt::UserRole, Qt::MatchCaseSensitive);
×
1483
        if (currentAlgorithm==-1) // Use Mallama&Hilton 2018 as default
×
1484
                currentAlgorithm = ui->planetMagnitudeAlgorithmComboBox->findData(Planet::MallamaHilton_2018, Qt::UserRole, Qt::MatchCaseSensitive);
×
1485

1486
        const QMap<int, QString>planetMagnitudeAlgorithmMap = {
1487
                { 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).") },
×
1488
                { 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).") },
×
1489
                { Planet::ExplanatorySupplement_1992, q_("The algorithm was published in the 2nd edition of the <em>Explanatory Supplement to the Astronomical Almanac</em> (1992).") },
×
1490
                { Planet::ExplanatorySupplement_2013, q_("The algorithm was published in the 3rd edition of the <em>Explanatory Supplement to the Astronomical Almanac</em> (2013).") },
×
1491
                { 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.") }
×
1492
        };
×
1493

1494
        QString info = planetMagnitudeAlgorithmMap.value(currentAlgorithm, q_("Visual magnitude based on phase angle and albedo."));
×
1495
        ui->planetMagnitudeAlgorithmDescription->setText(QString("<small>%1</small>").arg(info));
×
1496
}
×
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