Commit 4210e759 authored by Don Gagne's avatar Don Gagne

Fix goto enabled state handling

parent 92272a10
......@@ -126,11 +126,13 @@ FlightMap {
onClicked: {
if (_activeVehicle) {
if (_activeVehicle.guidedMode && flightWidgets.guidedModeBar.state == "Shown") {
_gotoHereCoordinate = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y))
flightWidgets.guidedModeBar.confirmAction(flightWidgets.guidedModeBar.confirmGoTo)
} else {
if (flightWidgets.guidedModeBar.state != "Shown") {
flightWidgets.guidedModeBar.state = "Shown"
} else {
if (flightWidgets.gotoEnabled) {
_gotoHereCoordinate = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y))
flightWidgets.guidedModeBar.confirmAction(flightWidgets.guidedModeBar.confirmGoTo)
}
}
}
}
......
......@@ -25,7 +25,8 @@ import QGroundControl.FlightMap 1.0
Item {
id: _root
property alias guidedModeBar: _guidedModeBar
property alias guidedModeBar: _guidedModeBar
property bool gotoEnabled: _activeVehicle && _activeVehicle.guidedMode && _activeVehicle.flying
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
......@@ -444,7 +445,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
color: _lightWidgetBorders ? qgcPal.mapWidgetBorderDark : qgcPal.mapWidgetBorderLight
text: "Click in map to move vehicle"
visible: _activeVehicle && _activeVehicle.guidedMode && _activeVehicle.flying
visible: gotoEnabled
}
Row {
......
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