From 54b3055b234aa32df8973b6d1a79bd14b091d2d2 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Tue, 30 Jul 2019 11:56:01 -0400 Subject: [PATCH] Hide APM Mock Links if APM is not built. Fix Mocklink UI --- src/ui/preferences/MockLink.qml | 55 ++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/src/ui/preferences/MockLink.qml b/src/ui/preferences/MockLink.qml index 753336e03..9185cbfb0 100644 --- a/src/ui/preferences/MockLink.qml +++ b/src/ui/preferences/MockLink.qml @@ -8,7 +8,9 @@ ****************************************************************************/ -import QtQuick 2.3 +import QtQuick 2.11 +import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.11 import QGroundControl 1.0 import QGroundControl.Controls 1.0 @@ -25,48 +27,59 @@ Rectangle { QGCFlickable { anchors.fill: parent - contentWidth: column.width + (_margins * 2) + contentWidth: column.width + (_margins * 2) contentHeight: column.height + (_margins * 2) clip: true - Column { + ColumnLayout { id: column anchors.margins: _margins anchors.left: parent.left anchors.top: parent.top spacing: ScreenTools.defaultFontPixelHeight - QGCButton { - text: qsTr("PX4 Vehicle") - onClicked: QGroundControl.startPX4MockLink(sendStatusText.checked) + QGCCheckBox { + id: sendStatusText + text: qsTr("Send status text + voice") } QGCButton { - text: qsTr("APM ArduCopter Vehicle") - onClicked: QGroundControl.startAPMArduCopterMockLink(sendStatusText.checked) + text: qsTr("PX4 Vehicle") + Layout.fillWidth: true + onClicked: QGroundControl.startPX4MockLink(sendStatusText.checked) } QGCButton { - text: qsTr("APM ArduPlane Vehicle") - onClicked: QGroundControl.startAPMArduPlaneMockLink(sendStatusText.checked) + text: qsTr("APM ArduCopter Vehicle") + visible: QGroundControl.hasAPMSupport + Layout.fillWidth: true + onClicked: QGroundControl.startAPMArduCopterMockLink(sendStatusText.checked) } QGCButton { - text: qsTr("APM ArduSub Vehicle") - onClicked: QGroundControl.startAPMArduSubMockLink(sendStatusText.checked) + text: qsTr("APM ArduPlane Vehicle") + visible: QGroundControl.hasAPMSupport + Layout.fillWidth: true + onClicked: QGroundControl.startAPMArduPlaneMockLink(sendStatusText.checked) } QGCButton { - text: qsTr("APM ArduRover Vehicle") - onClicked: QGroundControl.startAPMArduRoverMockLink(sendStatusText.checked) + text: qsTr("APM ArduSub Vehicle") + visible: QGroundControl.hasAPMSupport + Layout.fillWidth: true + onClicked: QGroundControl.startAPMArduSubMockLink(sendStatusText.checked) } QGCButton { - text: qsTr("Generic Vehicle") - onClicked: QGroundControl.startGenericMockLink(sendStatusText.checked) + text: qsTr("APM ArduRover Vehicle") + visible: QGroundControl.hasAPMSupport + Layout.fillWidth: true + onClicked: QGroundControl.startAPMArduRoverMockLink(sendStatusText.checked) } - QGCCheckBox { - id: sendStatusText - text: qsTr("Send status text + voice") + QGCButton { + text: qsTr("Generic Vehicle") + Layout.fillWidth: true + onClicked: QGroundControl.startGenericMockLink(sendStatusText.checked) } QGCButton { - text: qsTr("Stop One MockLink") - onClicked: QGroundControl.stopOneMockLink() + text: qsTr("Stop One MockLink") + Layout.fillWidth: true + onClicked: QGroundControl.stopOneMockLink() } } } -- 2.22.0