5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _WIZARDDIALOG_H_
22 #define _WIZARDDIALOG_H_
25 #include "wizarddata.h"
27 class WizardDialog
: public QWizard
33 WizardDialog(const GeneralSettings
& settings
, const unsigned int modelId
, const ModelData
& modelData
, QWidget
*parent
= 0);
34 const GeneralSettings
& settings
;
40 class StandardPage
: public QWizardPage
45 StandardPage(WizardPage curPage
, WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
49 void releaseBookings();
50 void releasePreBookings();
51 void initializePage();
53 int getDefaultChannel(const Input input
);
54 int nextFreeChannel(int channel
= 0);
55 void populateCB(QComboBox
* cb
, int preferred
=-1);
56 bool bookChannel(QComboBox
* cb
, Input input1
, int weight1
, Input input2
=NO_INPUT
, int weight2
=0);
57 int totalChannelsAvailable();
61 WizardPage pageCurrent
;
66 class ModelSelectionPage
: public StandardPage
70 ModelSelectionPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
);
72 QLineEdit
*nameLineEdit
;
73 QRadioButton
*planeRB
;
74 QRadioButton
*multirotorRB
;
75 QRadioButton
*helicopterRB
;
76 void initializePage();
81 class WingtypeSelectionPage
: public StandardPage
85 WingtypeSelectionPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
);
87 QRadioButton
*deltaWingRB
;
88 QRadioButton
*standardWingRB
;
92 class TailSelectionPage
: public StandardPage
96 TailSelectionPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
);
98 QRadioButton
*vTailRB
;
99 QRadioButton
*standardTailRB
;
100 QRadioButton
*simpleTailRB
;
104 class FlybarSelectionPage
: public StandardPage
108 FlybarSelectionPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
);
110 QRadioButton
*flybarRB
;
111 QRadioButton
*noFlybarRB
;
115 class ThrottlePage
: public StandardPage
120 ThrottlePage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
121 void initializePage();
125 void onMotorStateChanged(bool toggled
);
128 QRadioButton
*motorRB
;
129 QRadioButton
*noMotorRB
;
130 QComboBox
*throttleCB
;
133 class AileronsPage
: public StandardPage
137 AileronsPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
138 void initializePage();
142 void noAileronChannel();
143 void oneAileronChannel();
144 void twoAileronChannels();
147 QRadioButton
*oneAileronRB
;
148 QRadioButton
*twoAileronsRB
;
149 QRadioButton
*noAileronsRB
;
150 QComboBox
*aileron1CB
;
151 QComboBox
*aileron2CB
;
154 class FlapsPage
: public StandardPage
158 FlapsPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
159 void initializePage();
163 void noFlapChannel();
164 void oneFlapChannel();
165 void twoFlapChannels();
168 QRadioButton
*oneFlapRB
;
169 QRadioButton
*twoFlapsRB
;
170 QRadioButton
*noFlapsRB
;
175 class AirbrakesPage
: public StandardPage
179 AirbrakesPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
180 void initializePage();
184 void noAirbrakeChannel();
185 void oneAirbrakeChannel();
186 void twoAirbrakeChannels();
189 QRadioButton
*oneAirbrakeRB
;
190 QRadioButton
*twoAirbrakesRB
;
191 QRadioButton
*noAirbrakesRB
;
192 QComboBox
*airbrake1CB
;
193 QComboBox
*airbrake2CB
;
196 class ElevonsPage
: public StandardPage
201 ElevonsPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
202 void initializePage();
206 QComboBox
*elevon1CB
;
207 QComboBox
*elevon2CB
;
210 class RudderPage
: public StandardPage
215 RudderPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
216 void initializePage();
224 QRadioButton
*noRudderRB
;
225 QRadioButton
*hasRudderRB
;
229 class TailPage
: public StandardPage
233 TailPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
234 void initializePage();
238 QComboBox
*elevatorCB
;
241 QLabel
*errorMessage
;
244 class VTailPage
: public StandardPage
248 VTailPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
249 void initializePage();
256 class SimpleTailPage
: public StandardPage
260 SimpleTailPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
261 void initializePage();
264 QComboBox
*elevatorCB
;
267 class CyclicPage
: public StandardPage
271 CyclicPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
272 void initializePage();
275 QRadioButton
*cyclic90RB
;
276 QRadioButton
*cyclic120RB
;
277 QRadioButton
*cyclic120XRB
;
278 QRadioButton
*cyclic140RB
;
281 class GyroPage
: public StandardPage
285 GyroPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
286 void initializePage();
289 QRadioButton
*noGyroRB
;
290 QRadioButton
*switchGyroRB
;
291 QRadioButton
*potGyroRB
;
294 class FblPage
: public StandardPage
298 FblPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
299 void initializePage();
302 QComboBox
*throttleCB
;
308 class HeliPage
: public StandardPage
312 HeliPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
313 void initializePage();
316 QComboBox
*throttleCB
;
322 class MultirotorPage
: public StandardPage
326 MultirotorPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
327 void initializePage();
330 QComboBox
*throttleCB
;
336 class OptionsPage
: public StandardPage
340 OptionsPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
341 void initializePage();
344 QCheckBox
*throttleCutRB
;
345 QCheckBox
*flightTimerRB
;
346 QCheckBox
*throttleTimerRB
;
349 class ConclusionPage
: public StandardPage
353 ConclusionPage(WizardDialog
*dlg
, QString image
, QString title
, QString text
, int nextPage
=-1);
354 void initializePage();
357 QCheckBox
*proceedCB
;
361 class WizardPrinter
:QObject
365 WizardPrinter( WizMix
* );
369 QString
inputName( Input
);
370 QString
vehicleName( Vehicle
);
371 QString
printChannel( Input
, int, Input
, int );
373 #endif // _WIZARDDIALOG_H_