Skip to content

Commit

Permalink
Make it possible to have a build without Airmap
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmaphobic committed Jan 27, 2018
1 parent f55279d commit a5e8264
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 5 deletions.
3 changes: 3 additions & 0 deletions qgroundcontrol.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

#-------------------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion src/Airmap/QGroundControl.Airmap.qmldir
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Module QGroundControl.Airmap
Module

QGroundControl.Airmap

AirspaceControl 1.0 AirspaceControl.qml
AirspaceRegulation 1.0 AirspaceRegulation.qml
5 changes: 5 additions & 0 deletions src/Airmap/dummy/AirspaceControl.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import QtQuick 2.3
Item {
property bool colapsed: true
property bool showColapse: false
}
3 changes: 3 additions & 0 deletions src/Airmap/dummy/AirspaceRegulation.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import QtQuick 2.3
Item {
}
4 changes: 4 additions & 0 deletions src/Airmap/dummy/QGroundControl.Airmap.qmldir
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Module QGroundControl.Airmap

AirspaceControl 1.0 AirspaceControl.qml
AirspaceRegulation 1.0 AirspaceRegulation.qml
7 changes: 7 additions & 0 deletions src/Airmap/dummy/airmap_dummy.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<RCC>
<qresource prefix="/qml">
<file alias="QGroundControl/Airmap/qmldir">QGroundControl.Airmap.qmldir</file>
<file alias="QGroundControl/Airmap/AirspaceControl.qml">AirspaceControl.qml</file>
<file alias="QGroundControl/Airmap/AirspaceRegulation.qml">AirspaceRegulation.qml</file>
</qresource>
</RCC>
14 changes: 10 additions & 4 deletions src/PlanView/PlanView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a5e8264

Please sign in to comment.