removed PrefixPath debug line
[opentx.git] / companion / src / wizarddialog.h
blob8e1f2146f0dbfb0eefbba312edbcbb84e3d66a79
1 /*
2 * Author - Kjell Kernen
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
15 #ifndef WIZARDDIALOG_H
16 #define WIZARDDIALOG_H
17 #include <QWizard>
18 #include "wizarddata.h"
20 QT_BEGIN_NAMESPACE
21 class QCheckBox;
22 class QLabel;
23 class QLineEdit;
24 class QRadioButton;
25 class QComboBox;
26 QT_END_NAMESPACE
28 class WizardDialog : public QWizard
30 Q_OBJECT
32 public:
33 WizMix mix;
34 WizardDialog(const GeneralSettings & settings, const unsigned int modelId, QWidget *parent = 0);
35 const GeneralSettings & settings;
37 private slots:
38 void showHelp();
41 class StandardPage: public QWizardPage
43 Q_OBJECT
45 public:
46 StandardPage(WizardPage curPage, WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
47 WizardDialog *wizDlg;
49 protected:
50 void releaseBookings();
51 void releasePreBookings();
52 void initializePage();
53 void cleanupPage();
54 int getDefaultChannel(const Input input);
55 int nextFreeChannel(int channel = 0);
56 void populateCB(QComboBox * cb, int preferred=-1);
57 bool bookChannel(QComboBox * cb, Input input1, int weight1, Input input2=NO_INPUT, int weight2=0);
59 private:
60 QLabel *topLabel;
61 WizardPage pageCurrent;
62 int pageFollower;
63 int nextId() const;
66 class ModelSelectionPage: public StandardPage
68 Q_OBJECT
69 public:
70 ModelSelectionPage(WizardDialog *dlg, QString image, QString title, QString text);
71 private:
72 QLineEdit *nameLineEdit;
73 QRadioButton *planeRB;
74 QRadioButton *multirotorRB;
75 QRadioButton *helicopterRB;
76 bool validatePage();
77 int nextId() const;
80 class WingtypeSelectionPage: public StandardPage
82 Q_OBJECT
83 public:
84 WingtypeSelectionPage(WizardDialog *dlg, QString image, QString title, QString text);
85 private:
86 QRadioButton *deltaWingRB;
87 QRadioButton *standardWingRB;
88 int nextId() const;
91 class TailSelectionPage: public StandardPage
93 Q_OBJECT
94 public:
95 TailSelectionPage(WizardDialog *dlg, QString image, QString title, QString text);
96 private:
97 QRadioButton *vTailRB;
98 QRadioButton *standardTailRB;
99 QRadioButton *simpleTailRB;
100 int nextId() const;
103 class FlybarSelectionPage: public StandardPage
105 Q_OBJECT
106 public:
107 FlybarSelectionPage(WizardDialog *dlg, QString image, QString title, QString text);
108 private:
109 QRadioButton *flybarRB;
110 QRadioButton *noFlybarRB;
111 int nextId() const;
114 class ThrottlePage: public StandardPage
116 Q_OBJECT
118 public:
119 ThrottlePage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
120 void initializePage();
121 bool validatePage();
123 protected slots:
124 void onMotorStateChanged(bool toggled);
126 private:
127 QRadioButton *motorRB;
128 QRadioButton *noMotorRB;
129 QComboBox *throttleCB;
132 class AileronsPage: public StandardPage
134 Q_OBJECT
135 public:
136 AileronsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
137 void initializePage();
138 bool validatePage();
140 protected slots:
141 void noAileronChannel();
142 void oneAileronChannel();
143 void twoAileronChannels();
145 private:
146 QRadioButton *oneAileronRB;
147 QRadioButton *twoAileronsRB;
148 QRadioButton *noAileronsRB;
149 QComboBox *aileron1CB;
150 QComboBox *aileron2CB;
153 class FlapsPage: public StandardPage
155 Q_OBJECT
156 public:
157 FlapsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
158 void initializePage();
159 bool validatePage();
161 protected slots:
162 void noFlapChannel();
163 void oneFlapChannel();
164 void twoFlapChannels();
166 private:
167 QRadioButton *oneFlapRB;
168 QRadioButton *twoFlapsRB;
169 QRadioButton *noFlapsRB;
170 QComboBox *flap1CB;
171 QComboBox *flap2CB;
174 class AirbrakesPage: public StandardPage
176 Q_OBJECT
177 public:
178 AirbrakesPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
179 void initializePage();
180 bool validatePage();
182 protected slots:
183 void noAirbrakeChannel();
184 void oneAirbrakeChannel();
185 void twoAirbrakeChannels();
187 private:
188 QRadioButton *oneAirbrakeRB;
189 QRadioButton *twoAirbrakesRB;
190 QRadioButton *noAirbrakesRB;
191 QComboBox *airbrake1CB;
192 QComboBox *airbrake2CB;
195 class ElevonsPage: public StandardPage
197 Q_OBJECT
199 public:
200 ElevonsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
201 void initializePage();
202 bool validatePage();
204 private:
205 QComboBox *elevon1CB;
206 QComboBox *elevon2CB;
209 class RudderPage: public StandardPage
211 Q_OBJECT
213 public:
214 RudderPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
215 void initializePage();
216 bool validatePage();
218 protected slots:
219 void noRudder();
220 void hasRudder();
222 private:
223 QRadioButton *noRudderRB;
224 QRadioButton *hasRudderRB;
225 QComboBox *rudderCB;
228 class TailPage: public StandardPage
230 Q_OBJECT
231 public:
232 TailPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
233 void initializePage();
234 bool validatePage();
235 private:
236 QComboBox *elevatorCB;
237 QComboBox *rudderCB;
240 class VTailPage: public StandardPage
242 Q_OBJECT
243 public:
244 VTailPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
245 void initializePage();
246 bool validatePage();
247 private:
248 QComboBox *tail1CB;
249 QComboBox *tail2CB;
252 class SimpleTailPage: public StandardPage
254 Q_OBJECT
255 public:
256 SimpleTailPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
257 void initializePage();
258 bool validatePage();
259 private:
260 QComboBox *elevatorCB;
263 class CyclicPage: public StandardPage
265 Q_OBJECT
266 public:
267 CyclicPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
268 void initializePage();
269 bool validatePage();
270 private:
271 QRadioButton *cyclic90RB;
272 QRadioButton *cyclic120RB;
273 QRadioButton *cyclic120XRB;
274 QRadioButton *cyclic140RB;
277 class GyroPage: public StandardPage
279 Q_OBJECT
280 public:
281 GyroPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
282 void initializePage();
283 bool validatePage();
284 private:
285 QRadioButton *noGyroRB;
286 QRadioButton *switchGyroRB;
287 QRadioButton *potGyroRB;
290 class FblPage: public StandardPage
292 Q_OBJECT
293 public:
294 FblPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
295 void initializePage();
296 bool validatePage();
297 private:
298 QComboBox *throttleCB;
299 QComboBox *yawCB;
300 QComboBox *pitchCB;
301 QComboBox *rollCB;
304 class HeliPage: public StandardPage
306 Q_OBJECT
307 public:
308 HeliPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
309 void initializePage();
310 bool validatePage();
311 private:
312 QComboBox *throttleCB;
313 QComboBox *yawCB;
314 QComboBox *pitchCB;
315 QComboBox *rollCB;
318 class MultirotorPage: public StandardPage
320 Q_OBJECT
321 public:
322 MultirotorPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
323 void initializePage();
324 bool validatePage();
325 private:
326 QComboBox *throttleCB;
327 QComboBox *yawCB;
328 QComboBox *pitchCB;
329 QComboBox *rollCB;
332 class OptionsPage: public StandardPage
334 Q_OBJECT
335 public:
336 OptionsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
337 void initializePage();
338 bool validatePage();
339 private:
340 QCheckBox *throttleCutRB;
341 QCheckBox *flightTimerRB;
342 QCheckBox *throttleTimerRB;
345 class ConclusionPage: public StandardPage
347 Q_OBJECT
348 public:
349 ConclusionPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
350 void initializePage();
351 bool validatePage();
352 private:
353 QCheckBox *proceedCB;
354 QLabel *textLabel;
357 class WizardPrinter:QObject
359 Q_OBJECT
360 public:
361 WizardPrinter( WizMix * );
362 QString print();
363 private:
364 WizMix *mix;
365 QString inputName( Input );
366 QString vehicleName( Vehicle );
367 QString printChannel( Input, int, Input, int );
369 #endif // WIZARDDIALOG_H