Commit bca2c369 authored by tstellanova's avatar tstellanova

Fix waiting label display

parent e5198b1e
......@@ -34,14 +34,16 @@ void QGCConfigView::activeUASChanged(UASInterface* uas)
foreach (QObject* obj, ui->gridLayout->children()) {
QWidget* w = dynamic_cast<QWidget*>(obj);
if (w) {
ui->gridLayout->removeWidget(w);
if (obj != ui->waitingLabel)
if (obj != ui->waitingLabel) {
ui->gridLayout->removeWidget(w);
delete obj;
}
}
}
if (NULL != uas) {
ui->gridLayout->removeWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(false);
switch (uas->getAutopilotType()) {
case MAV_AUTOPILOT_PX4:
......@@ -49,11 +51,13 @@ void QGCConfigView::activeUASChanged(UASInterface* uas)
break;
default:
ui->gridLayout->addWidget(new QGCVehicleConfig());
break;
}
}
else {
//restore waiting label if we no longer have a connection
ui->gridLayout->addWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(true);
}
}
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