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) : ...@@ -103,11 +103,12 @@ WaypointList::WaypointList(QWidget *parent, UASWaypointManager* wpm) :
// SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED // SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED
if (!WPM->getUAS()) if (!WPM->getUAS())
{ {
// Hide buttons, which don't make sense without valid UAS // Disable buttons which don't make sense without valid UAS.
m_ui->positionAddButton->hide(); m_ui->positionAddButton->setEnabled(false);
m_ui->transmitButton->hide(); m_ui->transmitButton->setEnabled(false);
m_ui->readButton->hide(); m_ui->readButton->setEnabled(false);
m_ui->refreshButton->hide(); m_ui->refreshButton->setEnabled(false);
//FIXME: The whole "Onboard Waypoints"-tab should be hidden, instead of "refresh" button //FIXME: The whole "Onboard Waypoints"-tab should be hidden, instead of "refresh" button
// Insert a "NO UAV" info into the Onboard Tab // Insert a "NO UAV" info into the Onboard Tab
QLabel* noUas = new QLabel(this); QLabel* noUas = new QLabel(this);
...@@ -185,6 +186,12 @@ void WaypointList::setUAS(UASInterface* uas) ...@@ -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))); 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(); WPM = uas->getWaypointManager();
this->uas = uas; this->uas = uas;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
...@@ -60,51 +63,23 @@ ...@@ -60,51 +63,23 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0" colspan="9"> <item row="1" column="6">
<widget class="QScrollArea" name="scrollArea"> <widget class="QToolButton" name="addButton">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>836</width>
<height>316</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="editableListWidget" native="true">
<property name="toolTip">
<string>Waypoint list. The list is empty until you issue a read command or add waypoints.</string>
</property>
<property name="statusTip">
<string>Waypoint list. The list is empty until you issue a read command or add waypoints.</string>
</property>
<property name="whatsThis">
<string>Waypoint list. The list is empty until you issue a read command or add waypoints.</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="saveButton">
<property name="toolTip"> <property name="toolTip">
<string>Save waypoints to a file on the local harddisk. Does not save them on the MAV.</string> <string>Add a new waypoint to this list. Transmit via write to the MAV.</string>
</property> </property>
<property name="statusTip"> <property name="statusTip">
<string>Save waypoints to a file on the local harddisk. Does not save them on the MAV.</string> <string>Add a new waypoint to this list. Transmit via write to the MAV.</string>
</property> </property>
<property name="whatsThis"> <property name="whatsThis">
<string>Save waypoints to a file on the local harddisk. Does not save them on the MAV.</string> <string>Add a new waypoint to this list. Transmit via write to the MAV.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Save WPs</string> <string>...</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/actions/list-add.svg</normaloff>:/files/images/actions/list-add.svg</iconset>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -137,68 +112,75 @@ ...@@ -137,68 +112,75 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="4"> <item row="1" column="0">
<widget class="QToolButton" name="positionAddButton"> <widget class="QPushButton" name="saveButton">
<property name="toolTip"> <property name="toolTip">
<string>Set the current vehicle position as new waypoint</string> <string>Save waypoints to a file on the local harddisk. Does not save them on the MAV.</string>
</property> </property>
<property name="statusTip"> <property name="statusTip">
<string>Set the current vehicle position as new waypoint</string> <string>Save waypoints to a file on the local harddisk. Does not save them on the MAV.</string>
</property> </property>
<property name="whatsThis"> <property name="whatsThis">
<string>Set the current vehicle position as new waypoint</string> <string>Save waypoints to a file on the local harddisk. Does not save them on the MAV.</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>Save WPs</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/actions/go-bottom.svg</normaloff>:/files/images/actions/go-bottom.svg</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="5"> <item row="1" column="2">
<widget class="QToolButton" name="addButton"> <widget class="QLabel" name="statusLabel">
<property name="toolTip"> <property name="toolTip">
<string>Add a new waypoint to this list. Transmit via write to the MAV.</string> <string>The current waypoint transmission status</string>
</property> </property>
<property name="statusTip"> <property name="statusTip">
<string>Add a new waypoint to this list. Transmit via write to the MAV.</string> <string>The current waypoint transmission status</string>
</property> </property>
<property name="whatsThis"> <property name="whatsThis">
<string>Add a new waypoint to this list. Transmit via write to the MAV.</string> <string>The current waypoint transmission status</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>Please add first waypoint.</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/actions/list-add.svg</normaloff>:/files/images/actions/list-add.svg</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="6"> <item row="0" column="0" colspan="10">
<widget class="QToolButton" name="clearWPListButton"> <widget class="QScrollArea" name="scrollArea">
<property name="toolTip"> <property name="widgetResizable">
<string>Delete all waypoints from this list. You have to click write to clear the list on the MAV as well.</string> <bool>true</bool>
</property>
<property name="statusTip">
<string>Delete all waypoints from this list. You have to click write to clear the list on the MAV as well.</string>
</property>
<property name="whatsThis">
<string>Delete all waypoints from this list. You have to click write to clear the list on the MAV as well.</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/actions/process-stop.svg</normaloff>:/files/images/actions/process-stop.svg</iconset>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>836</width>
<height>316</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="editableListWidget" native="true">
<property name="toolTip">
<string>Waypoint list. The list is empty until you issue a read command or add waypoints.</string>
</property>
<property name="statusTip">
<string>Waypoint list. The list is empty until you issue a read command or add waypoints.</string>
</property>
<property name="whatsThis">
<string>Waypoint list. The list is empty until you issue a read command or add waypoints.</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item row="1" column="7"> <item row="1" column="8">
<widget class="QPushButton" name="readButton"> <widget class="QPushButton" name="readButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Read all waypoints from the MAV. Clears the list on this computer.</string> <string>Read all waypoints from the MAV. Clears the list on this computer.</string>
</property> </property>
...@@ -217,8 +199,11 @@ ...@@ -217,8 +199,11 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="8"> <item row="1" column="9">
<widget class="QPushButton" name="transmitButton"> <widget class="QPushButton" name="transmitButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Transmit all waypoints on this list to the MAV.</string> <string>Transmit all waypoints on this list to the MAV.</string>
</property> </property>
...@@ -237,19 +222,46 @@ ...@@ -237,19 +222,46 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="7">
<widget class="QLabel" name="statusLabel"> <widget class="QToolButton" name="clearWPListButton">
<property name="toolTip"> <property name="toolTip">
<string>The current waypoint transmission status</string> <string>Delete all waypoints from this list. You have to click write to clear the list on the MAV as well.</string>
</property> </property>
<property name="statusTip"> <property name="statusTip">
<string>The current waypoint transmission status</string> <string>Delete all waypoints from this list. You have to click write to clear the list on the MAV as well.</string>
</property> </property>
<property name="whatsThis"> <property name="whatsThis">
<string>The current waypoint transmission status</string> <string>Delete all waypoints from this list. You have to click write to clear the list on the MAV as well.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Please add first waypoint.</string> <string>...</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/actions/process-stop.svg</normaloff>:/files/images/actions/process-stop.svg</iconset>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QToolButton" name="positionAddButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Set the current vehicle position as new waypoint</string>
</property>
<property name="statusTip">
<string>Set the current vehicle position as new waypoint</string>
</property>
<property name="whatsThis">
<string>Set the current vehicle position as new waypoint</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/actions/go-bottom.svg</normaloff>:/files/images/actions/go-bottom.svg</iconset>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -329,6 +341,9 @@ ...@@ -329,6 +341,9 @@
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QPushButton" name="refreshButton"> <widget class="QPushButton" name="refreshButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Read all waypoints from the MAV and display in View tab..</string> <string>Read all waypoints from the MAV and display in View tab..</string>
</property> </property>
......
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