diff --git a/src/ui/QGCConfigView.cc b/src/ui/QGCConfigView.cc index ff88f313a07d0d43380fd1e386f0675e0e6d1f04..fb8f519b73bd3be644e0827c7ed7c1da95596406 100644 --- a/src/ui/QGCConfigView.cc +++ b/src/ui/QGCConfigView.cc @@ -34,14 +34,16 @@ void QGCConfigView::activeUASChanged(UASInterface* uas) foreach (QObject* obj, ui->gridLayout->children()) { QWidget* w = dynamic_cast(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); } }