1 /*
2  * Stellarium
3  * Copyright (C) 2008 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
18 */
19 
20 #ifndef VIEWDIALOG_HPP
21 #define VIEWDIALOG_HPP
22 
23 #include "StelDialog.hpp"
24 
25 #include <QObject>
26 
27 class Ui_viewDialogForm;
28 class QListWidgetItem;
29 class QToolButton;
30 
31 class AddRemoveLandscapesDialog;
32 class AtmosphereDialog;
33 class GreatRedSpotDialog;
34 class ConfigureDSOColorsDialog;
35 class ConfigureOrbitColorsDialog;
36 
37 class ViewDialog : public StelDialog
38 {
39 Q_OBJECT
40 public:
41 	ViewDialog(QObject* parent);
42 	virtual ~ViewDialog() Q_DECL_OVERRIDE;
43 	//! Notify that the application style changed
44 	virtual void styleChanged() Q_DECL_OVERRIDE;
45 
46 public slots:
47 	virtual void retranslate() Q_DECL_OVERRIDE;
48 
49 protected:
50 	Ui_viewDialogForm* ui;
51 	//! Initialize the dialog widgets and connect the signals/slots
52 	virtual void createDialogContent() Q_DECL_OVERRIDE;
53 private slots:
54 	void populateLists();
55 	void populateToolTips();
56 	void skyCultureChanged();
57 	void changeProjection(const QString& projectionNameI18n);
58 	void projectionChanged();
59 	void changeLandscape(QListWidgetItem* item);
60 	void landscapeChanged(QString id,QString name);
61 	void updateZhrDescription(int zhr);
62 	void setBortleScaleToolTip(int Bindex);
63 	void setCurrentLandscapeAsDefault(void);
64 	void setCurrentCultureAsDefault(void);
65 	void updateDefaultSkyCulture();
66 	void updateDefaultLandscape();
67 
68 	void showAddRemoveLandscapesDialog();
69         void showAtmosphereDialog();
70 	void showGreatRedSpotDialog();
71 	void showConfigureDSOColorsDialog();
72 	void showConfigureOrbitColorsDialog();
73 
74 	void populateLightPollution();
75 	void populatePlanetMagnitudeAlgorithmsList();
76 	void populatePlanetMagnitudeAlgorithmDescription();
77 	void setPlanetMagnitudeAlgorithm(int algorithmID);
78 
79 	void setSelectedCardinalCheckBoxes();
80 
81 	void setSelectedCatalogsFromCheckBoxes();
82 	void setSelectedTypesFromCheckBoxes();
83 
84 	void changePage(QListWidgetItem *current, QListWidgetItem *previous);
85 
86 	void updateSelectedCatalogsCheckBoxes();
87 	void updateSelectedTypesCheckBoxes();
88 
89 	void updateHips();
90 	void hipsListItemChanged(QListWidgetItem* item);
91 	void populateHipsGroups();
92 
93 	void populateOrbitsControls(bool flag);
94 	void populateTrailsControls(bool flag);
95 
96 private:
97 	void connectGroupBox(class QGroupBox* groupBox, const QString& actionId);
98 	void updateSkyCultureText();
99 	//! Make sure that no tabs icons are outside of the viewport.
100 	//! @todo Limit the width to the width of the screen *available to the window*.
101 	void updateTabBarListWidgetWidth();
102 
103 	AddRemoveLandscapesDialog * addRemoveLandscapesDialog;
104 	AtmosphereDialog * atmosphereDialog;
105 	GreatRedSpotDialog * greatRedSpotDialog;
106 	ConfigureDSOColorsDialog * configureDSOColorsDialog;
107 	ConfigureOrbitColorsDialog * configureOrbitColorsDialog;
108 };
109 
110 #endif // _VIEWDIALOG_HPP
111