dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
gcscontrolgadgetoptionspage.h
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #ifndef GCSCONTROLGADGETOPTIONSPAGE_H
28 #define GCSCONTROLGADGETOPTIONSPAGE_H
29 
31 
32 #if defined(USE_SDL)
33 #include "sdlgamepad/sdlgamepad.h"
34 #include <SDL/SDL.h>
35 #endif
36 
37 #include <QDebug>
38 #include <QCheckBox>
39 #include <QComboBox>
40 #include <QDoubleSpinBox>
41 #include <QLabel>
42 
43 namespace Core {
45 }
46 
48 
49 namespace Ui {
51 }
52 
53 using namespace Core;
54 
56 {
57  Q_OBJECT
58 public:
60  QObject *parent = nullptr);
62 
63  QWidget *createPage(QWidget *parent);
64  void apply();
65  void finish();
66 
67 private:
68  Ui::GCSControlGadgetOptionsPage *options_page;
70 #if defined(USE_SDL)
71  SDLGamepad *sdlGamepad;
72 #endif
73 
74  QList<QComboBox *> chList;
75  QList<QCheckBox *> chRevList;
76  QList<QComboBox *> buttonFunctionList;
77  QList<QComboBox *> buttonActionList;
78  QList<QDoubleSpinBox *> buttonValueList;
79  QList<QLabel *> buttonLabelList;
80 
81 protected slots:
82  // signals from joystick
83  void gamepads(quint8 count);
84 #if defined(USE_SDL)
85  void buttonState(ButtonNumber number, bool pressed);
86  void axesValues(QListInt16 values);
87 #endif
88  void updateButtonFunction();
89  void updateButtonAction(int controlID);
90  void updateButtonAction_0(void) { updateButtonAction(0); };
91  void updateButtonAction_1(void) { updateButtonAction(1); };
92  void updateButtonAction_2(void) { updateButtonAction(2); };
93  void updateButtonAction_3(void) { updateButtonAction(3); };
94  void updateButtonAction_4(void) { updateButtonAction(4); };
95  void updateButtonAction_5(void) { updateButtonAction(5); };
96  void updateButtonAction_6(void) { updateButtonAction(6); };
97  void updateButtonAction_7(void) { updateButtonAction(7); };
98 };
99 
100 #endif // GCSCONTROLGADGETOPTIONSPAGE_H
The IOptionsPage is an interface for providing options pages.
Definition: ioptionspage.h:42