Stellarium 0.12.3
SatellitesDialog.hpp
1 /*
2  * Stellarium Satellites Plug-in GUI
3  *
4  * Copyright (C) 2010 Matthew Gates
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 #ifndef _SATELLITESDIALOG_HPP_
22 #define _SATELLITESDIALOG_HPP_
23 
24 #include <QObject>
25 #include <QModelIndex>
26 #include "StelDialog.hpp"
27 #include "Satellites.hpp"
28 
29 class Ui_satellitesDialog;
30 class QCheckBox;
31 class QListWidgetItem;
32 class QSortFilterProxyModel;
33 class QStandardItemModel;
34 class QTimer;
35 
38 
42 {
43  Q_OBJECT
44 
45 public:
48 
49 protected:
51  void createDialogContent();
52 
53 public slots:
54  void retranslate();
55 
56 private slots:
57  void jumpToSourcesTab();
59  void updateCountdown();
62  void filterListByGroup(int index);
68  void updateSatelliteData();
69  void saveSatellites(void);
70  void showUpdateState(Satellites::UpdateState state);
71  void showUpdateCompleted(int updated, int total, int added, int missing);
72 
74 
75  void saveEditedSource();
76  void saveSourceList(void);
77  void deleteSourceRow(void);
78  void addSourceRow(void);
81  void toggleCheckableSources();
83 
84  void restoreDefaults(void);
85  void saveSettings(void);
86  void addSatellites(const TleDataList& newSatellites);
87  void removeSatellites();
89  void setFlags();
91  void handleGroupChanges(QListWidgetItem* item);
93  void trackSatellite(const QModelIndex & index);
94  void setOrbitParams(void);
95  void updateTLEs(void);
96 
97 private:
99  void enableSatelliteDataForm(bool enabled);
100  void populateAboutPage();
103  void updateSettingsPage();
106  void populateFilterMenu();
108  void populateSourcesList();
114  void addSpecialGroupItem();
116  void setGroups();
117 
118  Ui_satellitesDialog* ui;
119  bool satelliteModified;
120 
121  QTimer* updateTimer;
122 
123  SatellitesImportDialog* importWindow;
124 
125  SatellitesListFilterModel* filterModel;
126 
128  Qt::ItemDataRole checkStateRole;
129 };
130 
131 #endif // _SATELLITESDIALOG_HPP_