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