From 8a38c6a13b508bc47ccc224e0136d2610c7322c6 Mon Sep 17 00:00:00 2001 From: bsongis Date: Thu, 13 Mar 2014 16:09:21 +0100 Subject: [PATCH] Little improvement, it remains some like this one ;) --- companion/src/modeledit/expodialog.cpp | 3 ++- companion/src/wizarddialog.cpp | 13 +++++++++++-- companion/src/wizarddialog.h | 21 +++++++++++++-------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index 49e86fc8a..71be86c88 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -178,7 +178,8 @@ void ExpoDialog::valuesChanged() phtemp >>=1; } } - } else { + } + else { ed->phases=0; } } diff --git a/companion/src/wizarddialog.cpp b/companion/src/wizarddialog.cpp index eca7136e4..aa460e102 100644 --- a/companion/src/wizarddialog.cpp +++ b/companion/src/wizarddialog.cpp @@ -317,17 +317,26 @@ ThrottlePage::ThrottlePage(WizardDialog *dlg, QString image, QString title, QStr l->addWidget(noMotorRB); l->addWidget(new QLabel(tr("
Throttle Channel:"))); l->addWidget(throttleCB); + + connect(motorRB, SIGNAL(toggled(bool)), this, SLOT(onMotorStateChanged(bool))); } -void ThrottlePage::initializePage(){ +void ThrottlePage::initializePage() +{ populateCB(throttleCB); } -bool ThrottlePage::validatePage() { +bool ThrottlePage::validatePage() +{ releaseChannels(); return bookChannel(throttleCB->currentText(), THROTTLE, 100 ); } +void ThrottlePage::onMotorStateChanged(bool toggled) +{ + throttleCB->setEnabled(toggled); +} + AileronsPage::AileronsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) : StandardPage(Page_Ailerons, dlg, image, title, text, nextPage) { diff --git a/companion/src/wizarddialog.h b/companion/src/wizarddialog.h index a8b34dbd2..df3c91a26 100644 --- a/companion/src/wizarddialog.h +++ b/companion/src/wizarddialog.h @@ -105,14 +105,19 @@ private: class ThrottlePage: public StandardPage { Q_OBJECT -public: - ThrottlePage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); - void initializePage(); - bool validatePage(); -private: - QRadioButton *motorRB; - QRadioButton *noMotorRB; - QComboBox *throttleCB; + + public: + ThrottlePage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); + void initializePage(); + bool validatePage(); + + protected slots: + void onMotorStateChanged(bool toggled); + + private: + QRadioButton *motorRB; + QRadioButton *noMotorRB; + QComboBox *throttleCB; }; class AileronsPage: public StandardPage