Commit 247294a8 authored by Bryant's avatar Bryant

The mission listing now has its UI disabled when not usable due to the lack of a connected UAS.

parent d2317252
......@@ -103,11 +103,12 @@ WaypointList::WaypointList(QWidget *parent, UASWaypointManager* wpm) :
// SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED
if (!WPM->getUAS())
{
// Hide buttons, which don't make sense without valid UAS
m_ui->positionAddButton->hide();
m_ui->transmitButton->hide();
m_ui->readButton->hide();
m_ui->refreshButton->hide();
// Disable buttons which don't make sense without valid UAS.
m_ui->positionAddButton->setEnabled(false);
m_ui->transmitButton->setEnabled(false);
m_ui->readButton->setEnabled(false);
m_ui->refreshButton->setEnabled(false);
//FIXME: The whole "Onboard Waypoints"-tab should be hidden, instead of "refresh" button
// Insert a "NO UAV" info into the Onboard Tab
QLabel* noUas = new QLabel(this);
......@@ -185,6 +186,12 @@ void WaypointList::setUAS(UASInterface* uas)
disconnect(this->uas, SIGNAL(attitudeChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateAttitude(UASInterface*,double,double,double,quint64)));
}
// Now that there's a valid UAS, enable the UI.
m_ui->positionAddButton->setEnabled(true);
m_ui->transmitButton->setEnabled(true);
m_ui->readButton->setEnabled(true);
m_ui->refreshButton->setEnabled(true);
WPM = uas->getWaypointManager();
this->uas = uas;
......
This diff is collapsed.
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