Stellarium 0.15.2
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 
59 private slots:
60  void buttonSavePressed();
61  void buttonDiscardPressed();
62 
63  void toggleTypeLocal(bool);
64  void toggleTypeConnection(bool);
65  void toggleTypeVirtual(bool);
66 
67  void deviceModelSelected(const QString&);
68  bool validateHost(QString hostName);
69 
70 signals:
71  void changesSaved(QString name, ConnectionType type);
72  void changesDiscarded();
73 
74 private:
75  QStringList deviceModelNames;
76 
77  QRegExpValidator * telescopeNameValidator;
78  QRegExpValidator * hostNameValidator;
79  QRegExpValidator * circleListValidator;
80  QRegExpValidator * serialPortValidator;
81 
82  int configuredSlot;
83 
84  TelescopeControl * telescopeManager;
85 };
86 
87 #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