Stellarium  0.90.0
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 };
47 Q_DECLARE_METATYPE(storedPoint)
48 
50 {
51  Q_OBJECT
52 
53 public:
56 
57  void populatePointsList(QVariantList list);
58 
59 public slots:
60  void retranslate();
61 
62 private slots:
63  void buttonAddPressed();
64  void buttonRemovePressed();
65  void buttonClearPressed();
66 
67  void getCurrentObjectInfo();
68  void getCenterInfo();
69 
70 signals:
71  void addStoredPoint(int number, QString name, double radiansRA, double radiansDec);
72  void removeStoredPoint(int number);
73  void clearStoredPoints();
74 
75 protected:
77  virtual void createDialogContent();
78  Ui_StoredPoints *ui;
79 private:
81 
82  enum ModelColumns
83  {
84  ColumnSlot = 0,
85  ColumnName,
86  ColumnRA,
87  ColumnDec,
88  ColumnCount,
89  };
90  QStandardItemModel * storedPointsListModel;
91 
92  void setHeaderNames();
93  void addModelRow(int number, QString name, QString RA, QString Dec);
94 };
95 
96 #endif // STOREDPOINTS_HPP
Base class for all the GUI windows in Stellarium.
Definition: StelDialog.hpp:72
Define some translation macros.