Stellarium 0.12.4
ConfigurationDialog.hpp
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 _CONFIGURATIONDIALOG_HPP_
21 #define _CONFIGURATIONDIALOG_HPP_
22 
23 #include <QObject>
24 #include <QProgressBar>
25 #include <QNetworkReply>
26 #include <QFile>
27 #include "StelDialog.hpp"
28 
29 class Ui_configurationDialogForm;
30 class QSettings;
31 class QDataStream;
32 class QNetworkAccessManager;
33 class QListWidgetItem;
34 class StelGui;
36 
38 {
39  Q_OBJECT
40 public:
42  virtual ~ConfigurationDialog();
44  void styleChanged();
45 
46 public slots:
47  void retranslate();
48  void updateIconsColor();
49 
50 protected:
52  virtual void createDialogContent();
53  Ui_configurationDialogForm* ui;
54 
55 private:
57  QVariantMap nextStarCatalogToDownload;
61  void resetStarCatalogControls();
64  void updateStarCatalogControlsText();
66  bool isDownloadingStarCatalog;
68  int nextStarCatalogToDownloadIndex;
70  int starCatalogsCount;
72  bool hasDownloadedStarCatalog;
73  QNetworkReply* starCatalogDownloadReply;
74  QFile* currentDownloadFile;
75  QProgressBar* progressBar;
76 
77 private slots:
78  void setNoSelectedInfo();
79  void setAllSelectedInfo();
80  void setBriefSelectedInfo();
84  void setSelectedInfoFromCheckBoxes();
85 
86  void selectLanguage(const QString& languageCode);
87  void setStartupTimeMode();
89  void showShortcutsWindow();
90  void setDiskViewport(bool);
91  void setSphericMirror(bool);
92  void cursorTimeOutChanged();
93  void cursorTimeOutChanged(double) {cursorTimeOutChanged();}
94 
95  void newStarCatalogData();
96  void downloadStars();
97  void cancelDownload();
98  void downloadFinished();
99  void downloadError(QNetworkReply::NetworkError);
100 
102  void updateConfigLabels();
103 
107  void browseForScreenshotDir();
108  void selectScreenshotDir(const QString& dir);
109 
113  void saveCurrentViewOptions();
114 
117  void setDefaultViewOptions();
118 
119  void populatePluginsList();
120  void pluginsSelectionChanged(const QString&);
121  void pluginConfigureCurrentSelection();
122  void loadAtStartupChanged(int);
123 
124  void populateDeltaTAlgorithmsList();
125  void setDeltaTAlgorithm(int algorithmID);
126  void setDeltaTAlgorithmDescription();
127  void showCustomDeltaTEquationDialog();
128 
129  #ifndef DISABLE_SCRIPTING
130 
131 
132  void scriptSelectionChanged(const QString& s);
133 
135  void runScriptClicked();
137  void stopScriptClicked();
138 
139  void aScriptIsRunning();
140  void aScriptHasStopped();
141 
142  void populateScriptsList();
143  #endif
144  void setFixedDateTimeToCurrent();
145 
146 private:
147  StelGui* gui;
148 
149  CustomDeltaTEquationDialog* customDeltaTEquationDialog;
150 
151  int savedProjectionType;
152 
154  void updateSelectedInfoCheckBoxes();
157  void updateTabBarListWidgetWidth();
158 };
159 
160 #endif // _CONFIGURATIONDIALOG_HPP_