Stellarium  0.16.1
TelescopeConfigurationDialog.hpp
1 /*
2  * Stellarium TelescopeControl Plug-in
3  *
4  * Copyright (C) 2009-2010 Bogdan Marinov (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 _TELESCOPECONFIGURATIONDIALOG_HPP_
22 #define _TELESCOPECONFIGURATIONDIALOG_HPP_
23 
24 #include <QObject>
25 #include <QHash>
26 #include <QIntValidator>
27 #include <QStringList>
28 #include "StelDialog.hpp"
29 #include "TelescopeControlGlobals.hpp"
30 
31 using namespace TelescopeControlGlobals;
32 
33 class Ui_telescopeConfigurationDialog;
34 class TelescopeControl;
35 class StelStyle;
36 
38 {
39  Q_OBJECT
40 public:
43 
44  void initExistingTelescopeConfiguration(int slot);
45  void initNewTelescopeConfiguration(int slot);
46 
47 public slots:
48  void retranslate();
49 
50 protected:
52  virtual void createDialogContent();
53  Ui_telescopeConfigurationDialog* ui;
54 
55 private:
56  QStringList* listSerialPorts();
57  void initConfigurationDialog();
58  void populateToolTips();
59 
60 private slots:
61  void buttonSavePressed();
62  void buttonDiscardPressed();
63 
64  void toggleTypeLocal(bool);
65  void toggleTypeConnection(bool);
66  void toggleTypeVirtual(bool);
67  void toggleTypeRTS2(bool);
68 
69  void deviceModelSelected(const QString&);
70  bool validateHost(QString hostName);
71 
72 signals:
73  void changesSaved(QString name, ConnectionType type);
74  void changesDiscarded();
75 
76 private:
77  QStringList deviceModelNames;
78 
79  QRegExpValidator * telescopeNameValidator;
80  QRegExpValidator * hostNameValidator;
81  QRegExpValidator * circleListValidator;
82  QRegExpValidator * serialPortValidator;
83 
84  int configuredSlot;
85 
86  TelescopeControl * telescopeManager;
87 };
88 
89 #endif // _TELESCOPECONFIGURATIONDIALOG_
Base class for all the GUI windows in Stellarium.
Definition: StelDialog.hpp:72
This class manages the controlling of one or more telescopes by one instance of the stellarium progra...
Holds the information related to a color style for GUI and modules of Stellarium. ...
Definition: StelStyle.hpp:28