From a5e8264bb2a5b34e61d54d457e81d2a804c805b5 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 20 Jan 2018 23:47:39 -0500 Subject: [PATCH] Make it possible to have a build without Airmap --- qgroundcontrol.pro | 3 +++ src/Airmap/QGroundControl.Airmap.qmldir | 4 +++- src/Airmap/dummy/AirspaceControl.qml | 5 +++++ src/Airmap/dummy/AirspaceRegulation.qml | 3 +++ src/Airmap/dummy/QGroundControl.Airmap.qmldir | 4 ++++ src/Airmap/dummy/airmap_dummy.qrc | 7 +++++++ src/PlanView/PlanView.qml | 14 ++++++++++---- 7 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 src/Airmap/dummy/AirspaceControl.qml create mode 100644 src/Airmap/dummy/AirspaceRegulation.qml create mode 100644 src/Airmap/dummy/QGroundControl.Airmap.qmldir create mode 100644 src/Airmap/dummy/airmap_dummy.qrc diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index e856f8c36..70436ad6a 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -1075,6 +1075,9 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) { src/Airmap/AirspaceManagement.cc \ src/Airmap/AirspaceController.cc \ src/Airmap/AirMapSettings.cc +} else { + RESOURCES += \ + src/Airmap/dummy/airmap_dummy.qrc } #------------------------------------------------------------------------------------- diff --git a/src/Airmap/QGroundControl.Airmap.qmldir b/src/Airmap/QGroundControl.Airmap.qmldir index 116917dfd..a6cf465b2 100644 --- a/src/Airmap/QGroundControl.Airmap.qmldir +++ b/src/Airmap/QGroundControl.Airmap.qmldir @@ -1,4 +1,6 @@ -Module QGroundControl.Airmap +Module + +QGroundControl.Airmap AirspaceControl 1.0 AirspaceControl.qml AirspaceRegulation 1.0 AirspaceRegulation.qml diff --git a/src/Airmap/dummy/AirspaceControl.qml b/src/Airmap/dummy/AirspaceControl.qml new file mode 100644 index 000000000..4a3fbc6ba --- /dev/null +++ b/src/Airmap/dummy/AirspaceControl.qml @@ -0,0 +1,5 @@ +import QtQuick 2.3 +Item { + property bool colapsed: true + property bool showColapse: false +} diff --git a/src/Airmap/dummy/AirspaceRegulation.qml b/src/Airmap/dummy/AirspaceRegulation.qml new file mode 100644 index 000000000..9009b3fa1 --- /dev/null +++ b/src/Airmap/dummy/AirspaceRegulation.qml @@ -0,0 +1,3 @@ +import QtQuick 2.3 +Item { +} diff --git a/src/Airmap/dummy/QGroundControl.Airmap.qmldir b/src/Airmap/dummy/QGroundControl.Airmap.qmldir new file mode 100644 index 000000000..116917dfd --- /dev/null +++ b/src/Airmap/dummy/QGroundControl.Airmap.qmldir @@ -0,0 +1,4 @@ +Module QGroundControl.Airmap + +AirspaceControl 1.0 AirspaceControl.qml +AirspaceRegulation 1.0 AirspaceRegulation.qml diff --git a/src/Airmap/dummy/airmap_dummy.qrc b/src/Airmap/dummy/airmap_dummy.qrc new file mode 100644 index 000000000..173e9aa06 --- /dev/null +++ b/src/Airmap/dummy/airmap_dummy.qrc @@ -0,0 +1,7 @@ + + + QGroundControl.Airmap.qmldir + AirspaceControl.qml + AirspaceRegulation.qml + + diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index e19564ea8..49da675e4 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -96,9 +96,13 @@ QGCView { } on_EnableAirMapChanged: { - if(_enableAirMap) { - planControlColapsed = true - airspaceControl.colapsed = false + if(QGroundControl.airmapSupported) { + if(_enableAirMap) { + planControlColapsed = true + airspaceControl.colapsed = false + } else { + planControlColapsed = false + } } else { planControlColapsed = false } @@ -565,14 +569,16 @@ QGCView { width: height height: ScreenTools.defaultFontPixelWidth * 2.5 sourceSize.height: height - source: "qrc:/airmap/expand.svg" + source: QGroundControl.airmapSupported ? "qrc:/airmap/expand.svg" : "" color: "white" + visible: QGroundControl.airmapSupported anchors.right: parent.right anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.verticalCenter: parent.verticalCenter } MouseArea { anchors.fill: parent + enabled: QGroundControl.airmapSupported onClicked: { airspaceControl.colapsed = true planControlColapsed = false -- 2.22.0