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) {
checkAndInitModel(row);
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;
}
Mix::Mix()
{
complete = false;
name = "";
vehicle = NOVEHICLE;
}
QString Mix::toString()
{
QString str;
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++){
if (!channel[i].isEmpty()){
str += QString(tr("Channel %1: ").arg(i+1));

View file

@ -43,10 +43,12 @@ class Mix:QObject
{
Q_OBJECT
public:
bool complete;
QString name;
Vehicle vehicleType;
Vehicle vehicle;
Channel channel[MAX_CHANNELS];
Mix();
QString toString();
};

View file

@ -213,11 +213,11 @@ bool ModelSelectionPage::validatePage()
{
wizDlg->mix.name = nameLineEdit->text();
if (multirotorRB->isChecked())
wizDlg->mix.vehicleType = MULTICOPTER;
wizDlg->mix.vehicle = MULTICOPTER;
else if (helicopterRB->isChecked())
wizDlg->mix.vehicleType = HELICOPTER;
wizDlg->mix.vehicle = HELICOPTER;
else
wizDlg->mix.vehicleType = PLANE;
wizDlg->mix.vehicle = PLANE;
return true;
}
@ -723,4 +723,9 @@ void ConclusionPage::initializePage(){
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:
ConclusionPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1);
void initializePage();
bool validatePage();
private:
QCheckBox *proceedCB;
QLabel *textLabel;