Commit dd0e522e authored by Michael Carpenter's avatar Michael Carpenter

Default disabled QGCComboBox until a parameter is recieved from the AP

parent d6a36d7c
......@@ -39,6 +39,8 @@ QGCComboBox::QGCComboBox(QWidget *parent) :
ui->editItemNameLabel->hide();
ui->itemValueLabel->hide();
ui->itemNameLabel->hide();
ui->editOptionComboBox->setEnabled(false);
isDisabled = true;
ui->editLine1->setStyleSheet("QWidget { border: 1px solid #66666B; border-radius: 3px; padding: 10px 0px 0px 0px; background: #111122; }");
ui->editLine2->setStyleSheet("QWidget { border: 1px solid #66666B; border-radius: 3px; padding: 10px 0px 0px 0px; background: #111122; }");
......@@ -192,6 +194,10 @@ void QGCComboBox::startEditMode()
ui->editItemNameLabel->show();
ui->itemValueLabel->show();
ui->itemNameLabel->show();
if (isDisabled)
{
ui->editOptionComboBox->setEnabled(true);
}
isInEditMode = true;
}
......@@ -223,6 +229,10 @@ void QGCComboBox::endEditMode()
ui->itemValueLabel->hide();
ui->itemNameLabel->hide();
ui->nameLabel->show();
if (isDisabled)
{
ui->editOptionComboBox->setEnabled(false);
}
isInEditMode = false;
emit editingFinished();
}
......@@ -293,6 +303,8 @@ void QGCComboBox::setParameterValue(int uas, int component, int paramCount, int
if (component == this->component && parameterName == this->parameterName)
{
ui->editOptionComboBox->setEnabled(true);
isDisabled = false;
for (int i=0;i<ui->editOptionComboBox->count();i++)
{
if (comboBoxTextToValMap[ui->editOptionComboBox->itemText(i)] == value.toInt())
......
......@@ -53,6 +53,7 @@ protected:
QVariant parameterValue; ///< Value of the parameter
double parameterScalingFactor; ///< Factor to scale the parameter between slider and true value
float parameterMin;
bool isDisabled;
float parameterMax;
int component; ///< ID of the MAV component to address
//double scaledInt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment