Stellarium 0.12.3
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 
34 {
35  Q_OBJECT
36 
37 public:
40 
41 signals:
42  void satellitesAccepted(const TleDataList& newSatellites);
43 
44 public slots:
45  void retranslate();
46  void setVisible(bool visible = true);
47 
48 private slots:
49  void getData();
50  void receiveDownload(QNetworkReply* networkReply);
51  void abortDownloads();
52  void acceptNewSatellites();
53  void discardNewSatellites();
54  void markAll();
55  void markNone();
56 
57 private:
58  void createDialogContent();
59  Ui_satellitesImportDialog* ui;
60 
61  void reset();
62  void populateList();
63  void displayMessage(const QString& message);
64 
68  void setCheckState(Qt::CheckState state);
69 
70  TleDataHash newSatellites;
71  bool isGettingData;
72  int numberDownloadsComplete;
73  QNetworkAccessManager* downloadMgr;
74  QList<QNetworkReply*> activeDownloads;
75  QStringList sourceUrls;
76  QList<QFile*> sourceFiles;
77  QProgressBar* progressBar;
78 
79  QStandardItemModel* newSatellitesModel;
80  QSortFilterProxyModel * filterProxyModel;
81 };
82 
83 #endif // IMPORTSATELLITESWINDOW_HPP