Stellarium 0.14.3
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  //
69  bool validateHost(QString hostName);
70 
71 signals:
72  void changesSaved(QString name, ConnectionType type);
73  void changesDiscarded();
74 
75 private:
76  QStringList deviceModelNames;
77 
78  QRegExpValidator * telescopeNameValidator;
79  QRegExpValidator * hostNameValidator;
80  QRegExpValidator * circleListValidator;
81  QRegExpValidator * serialPortValidator;
82 
83  int configuredSlot;
84 
85  TelescopeControl * telescopeManager;
86 };
87 
88 #endif // _TELESCOPECONFIGURATIONDIALOG_
A local copy of StelDialog, the base class for all the GUI windows in Stellarium, included to allow t...
This class manages the controlling of one or more telescopes by one instance of the stellarium progra...