Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

gui/ConfigurationDialog.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2008 Fabien Chereau
00004  * 
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 */
00019  
00020 #ifndef _CONFIGURATIONDIALOG_HPP_
00021 #define _CONFIGURATIONDIALOG_HPP_
00022 
00023 #include <QObject>
00024 #include <QProgressBar>
00025 #include <QNetworkReply>
00026 #include <QFile>
00027 #include "StelDialog.hpp"
00028 #include "StelApp.hpp"
00029 #include "StelMainGraphicsView.hpp"
00030 
00031 class Ui_configurationDialogForm;
00032 class QSettings;
00033 class QDataStream;
00034 class QNetworkAccessManager;
00035 class StelDownloadMgr;
00036 
00037 class ConfigurationDialog : public StelDialog
00038 {
00039     Q_OBJECT
00040 public:
00041     ConfigurationDialog();
00042     virtual ~ConfigurationDialog();
00043     void languageChanged();
00045     void styleChanged();
00046 protected:
00047     enum UpdatesState { ShowAvailable, Checking, NoUpdates, Downloading,
00048                 Finished, Verifying, UpdatesError, MoveError,
00049                 DownloadError, ChecksumError };
00050     
00052     virtual void createDialogContent();
00053     
00055     void setUpdatesState(ConfigurationDialog::UpdatesState);
00056     void checkUpdates(void);
00057     
00058     Ui_configurationDialogForm* ui;
00059     QSettings* starSettings;
00060     QSettings* updatesData;
00061     StelDownloadMgr* downloadMgr;
00062     QString downloadName;
00063     QString updatesFileName;
00064     QStringList newCatalogs;
00065     QString starsDir;
00066     int downloaded;
00067 
00068 private slots:
00069     void setNoSelectedInfo(void);
00070     void setAllSelectedInfo(void);
00071     void setBriefSelectedInfo(void);
00072     void languageChanged(const QString& languageCode);
00073     void setStartupTimeMode(void);
00074     void setDiskViewport(bool);
00075     void setSphericMirror(bool);
00076     void cursorTimeOutChanged();
00077     void cursorTimeOutChanged(double d) {cursorTimeOutChanged();}
00078     
00079     void downloadStars(void);
00080     void cancelDownload(void);
00081     void retryDownload(void);
00082     void badChecksum(void);
00083     void downloadFinished(void);
00084     void downloadVerifying(void);
00085     void downloadError(QNetworkReply::NetworkError, QString);
00086     void updatesDownloadFinished(void);
00087     void updatesDownloadError(QNetworkReply::NetworkError, QString);
00088     
00090     void updateConfigLabels();
00091 
00095     void browseForScreenshotDir();
00096     void selectScreenshotDir(const QString& dir);
00097 
00101     void saveCurrentViewOptions();
00102     
00105     void setDefaultViewOptions();
00106 
00109     void scriptSelectionChanged(const QString& s);
00110 
00112     void runScriptClicked(void);
00114     void stopScriptClicked(void);
00115 
00116     void aScriptIsRunning(void);
00117     void aScriptHasStopped(void);
00118     void populateScriptsList(void);
00119     void setFixedDateTimeToCurrent(void);
00120 
00121 };
00122 
00123 #endif // _CONFIGURATIONDIALOG_HPP_

Generated on Mon Mar 9 16:16:16 2009 for Stellarium by  doxygen 1.5.5