Commit bca2c369 authored by tstellanova's avatar tstellanova

Fix waiting label display

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