Stellarium 0.14.3
StoredPointsDialog.hpp
1 /*
2  * Stellarium Telescope Control Plug-in
3  *
4  * Copyright (C) 2015 Pavel Klimenko aka rich <dzy4@mail.ru> (this file)
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 STOREDPOINTS_HPP
22 #define STOREDPOINTS_HPP
23 
24 #include <QDialog>
25 #include <QStandardItemModel>
26 
27 #include "StelApp.hpp"
28 #include "StelStyle.hpp"
29 #include "StelTranslator.hpp"
30 #include "StelDialog.hpp"
31 #include "StelCore.hpp"
32 #include "StelObjectMgr.hpp"
33 #include "StelModuleMgr.hpp"
34 #include "StelUtils.hpp"
35 
36 #include <AngleSpinBox.hpp>
37 
38 class Ui_StoredPoints;
39 
41 {
42  int number;
43  QString name;
44  double radiansRA;
45  double radiansDec;
46 };
48 
49 class StoredPointsDialog : public StelDialog
50 {
51  Q_OBJECT
52 
53 public:
54  StoredPointsDialog();
55  ~StoredPointsDialog();
56 
57  void populatePointsList(QVariantList list);
58 
59 public slots:
60  void retranslate();
61 
62 private slots:
63  void buttonAddPressed();
64  void buttonRemovePressed();
65 
66  void getCurrentObjectInfo();
67  void getCenterInfo();
68 
69 signals:
70  void addStoredPoint(int number, QString name, double radiansRA, double radiansDec);
71  void removeStoredPoint(int number);
72 protected:
74  virtual void createDialogContent();
75  Ui_StoredPoints *ui;
76 private:
78 
79  enum ModelColumns
80  {
81  ColumnSlot = 0,
82  ColumnName,
83  ColumnRA,
84  ColumnDec,
85  ColumnCount,
86  };
87  QStandardItemModel * storedPointsListModel;
88 
89  void setHeaderNames();
90  void addModelRow(int number, QString name, QString RA, QString Dec);
91 };
92 
93 #endif // STOREDPOINTS_HPP
A local copy of StelDialog, the base class for all the GUI windows in Stellarium, included to allow t...
Q_DECLARE_METATYPE(SphericalRegionP) QDataStream &operator<<(QDataStream &out