Stellarium 0.15.2
SatellitesImportDialog.hpp
1 /*
2  * Stellarium Satellites Plug-in: satellites import feature
3  * Copyright (C) 2012 Bogdan Marinov
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, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef IMPORTSATELLITESWINDOW_HPP
21 #define IMPORTSATELLITESWINDOW_HPP
22 
23 #include "StelDialog.hpp"
24 #include "Satellites.hpp"
25 
26 class Ui_satellitesImportDialog;
27 class QSortFilterProxyModel;
28 class QStandardItemModel;
29 class QFile;
30 class QTemporaryFile;
31 class QNetworkReply;
32 
35 {
36  Q_OBJECT
37 
38 public:
41 
42 signals:
43  void satellitesAccepted(const TleDataList& newSatellites);
44 
45 public slots:
46  void retranslate();
47  void setVisible(bool visible = true);
48 
49 private slots:
50  void getData();
51  void receiveDownload(QNetworkReply* networkReply);
52  void abortDownloads();
53  void acceptNewSatellites();
54  void discardNewSatellites();
55  void markAll();
56  void markNone();
57 
58 private:
59  void createDialogContent();
60  Ui_satellitesImportDialog* ui;
61 
62  void reset();
63  void populateList();
64  void displayMessage(const QString& message);
65 
69  void setCheckState(Qt::CheckState state);
70 
71  TleDataHash newSatellites;
72  bool isGettingData;
73  int numberDownloadsComplete;
74  QNetworkAccessManager* downloadMgr;
75  QList<QNetworkReply*> activeDownloads;
76  QStringList sourceUrls;
77  QList<QFile*> sourceFiles;
78  class StelProgressController* progressBar;
79 
80  QStandardItemModel* newSatellitesModel;
81  QSortFilterProxyModel * filterProxyModel;
82 };
83 
84 #endif // IMPORTSATELLITESWINDOW_HPP
Base class for all the GUI windows in Stellarium.
Definition: StelDialog.hpp:72
Maintain the state of a progress bar.
bool visible() const
Returns true if the dialog contents have been constructed and are currently shown.