1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 08:15:17 +03:00

Added status information for wixard mix data.

This commit is contained in:
Kjell Kernen 2014-03-03 23:12:57 +01:00
parent 0a867bcc22
commit 898496a85d
5 changed files with 26 additions and 8 deletions

View file

@ -186,7 +186,10 @@ void MdiChild::wizardEdit()
if (row > 0) { if (row > 0) {
checkAndInitModel(row); checkAndInitModel(row);
WizardDialog *wizard = new WizardDialog(this); WizardDialog *wizard = new WizardDialog(this);
wizard->show(); wizard->exec();
if (wizard->mix.complete){
//TODO Save data accessible in wizard->mix.
}
} }
} }

View file

@ -65,11 +65,18 @@ QString Channel::toString()
return str; return str;
} }
Mix::Mix()
{
complete = false;
name = "";
vehicle = NOVEHICLE;
}
QString Mix::toString() QString Mix::toString()
{ {
QString str; QString str;
str = QString(tr("Model Name: ")) + name + "\n"; str = QString(tr("Model Name: ")) + name + "\n";
str += QString(tr("Model Type: ")) + vehicleName(vehicleType) + "\n"; str += QString(tr("Model Type: ")) + vehicleName(vehicle) + "\n";
for (int i=0; i<MAX_CHANNELS; i++){ for (int i=0; i<MAX_CHANNELS; i++){
if (!channel[i].isEmpty()){ if (!channel[i].isEmpty()){
str += QString(tr("Channel %1: ").arg(i+1)); str += QString(tr("Channel %1: ").arg(i+1));
@ -78,4 +85,4 @@ QString Mix::toString()
} }
} }
return str; return str;
} }

View file

@ -43,11 +43,13 @@ class Mix:QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
bool complete;
QString name; QString name;
Vehicle vehicleType; Vehicle vehicle;
Channel channel[MAX_CHANNELS]; Channel channel[MAX_CHANNELS];
Mix();
QString toString(); QString toString();
}; };
#endif // WIZARDDATA_H #endif // WIZARDDATA_H

View file

@ -213,11 +213,11 @@ bool ModelSelectionPage::validatePage()
{ {
wizDlg->mix.name = nameLineEdit->text(); wizDlg->mix.name = nameLineEdit->text();
if (multirotorRB->isChecked()) if (multirotorRB->isChecked())
wizDlg->mix.vehicleType = MULTICOPTER; wizDlg->mix.vehicle = MULTICOPTER;
else if (helicopterRB->isChecked()) else if (helicopterRB->isChecked())
wizDlg->mix.vehicleType = HELICOPTER; wizDlg->mix.vehicle = HELICOPTER;
else else
wizDlg->mix.vehicleType = PLANE; wizDlg->mix.vehicle = PLANE;
return true; return true;
} }
@ -723,4 +723,9 @@ void ConclusionPage::initializePage(){
textLabel->setText(wizDlg->mix.toString()); textLabel->setText(wizDlg->mix.toString());
} }
bool ConclusionPage::validatePage() {
wizDlg->mix.complete = true;
return true;
}

View file

@ -302,6 +302,7 @@ class ConclusionPage: public StandardPage
public: public:
ConclusionPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); ConclusionPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
void initializePage(); void initializePage();
bool validatePage();
private: private:
QCheckBox *proceedCB; QCheckBox *proceedCB;
QLabel *textLabel; QLabel *textLabel;