Commit 5b4407a0 authored by Gus Grubba's avatar Gus Grubba

Avoid variable name colision

parent 4b8317d5
......@@ -123,7 +123,7 @@ Item {
Layout.alignment: Qt.AlignHCenter
font.pointSize: ScreenTools.largeFontPointSize
color: _textColor
activeVehicle: _vehicle
currentVehicle: _vehicle
}
QGCLabel {
......
......@@ -17,9 +17,9 @@ import QGroundControl.ScreenTools 1.0
// Label control whichs pop up a flight mode change menu when clicked
QGCLabel {
id: flightModeMenuLabel
text: activeVehicle ? activeVehicle.flightMode : qsTr("N/A", "No data to display")
text: currentVehicle ? currentVehicle.flightMode : qsTr("N/A", "No data to display")
property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var currentVehicle: QGroundControl.multiVehicleManager.activeVehicle
Menu {
id: flightModesMenu
......@@ -29,14 +29,14 @@ QGCLabel {
id: flightModeMenuItemComponent
MenuItem {
onTriggered: activeVehicle.flightMode = text
onTriggered: currentVehicle.flightMode = text
}
}
property var flightModesMenuItems: []
function updateFlightModesMenu() {
if (activeVehicle && activeVehicle.flightModeSetAvailable) {
if (currentVehicle && currentVehicle.flightModeSetAvailable) {
var i;
// Remove old menu items
for (i = 0; i < flightModesMenuItems.length; i++) {
......@@ -44,8 +44,8 @@ QGCLabel {
}
flightModesMenuItems.length = 0
// Add new items
for (i = 0; i < activeVehicle.flightModes.length; i++) {
var menuItem = flightModeMenuItemComponent.createObject(null, { "text": activeVehicle.flightModes[i] })
for (i = 0; i < currentVehicle.flightModes.length; i++) {
var menuItem = flightModeMenuItemComponent.createObject(null, { "text": currentVehicle.flightModes[i] })
flightModesMenuItems.push(menuItem)
flightModesMenu.insertItem(i, menuItem)
}
......@@ -60,7 +60,7 @@ QGCLabel {
}
MouseArea {
visible: activeVehicle && activeVehicle.flightModeSetAvailable
visible: currentVehicle && currentVehicle.flightModeSetAvailable
anchors.fill: parent
onClicked: flightModesMenu.popup()
}
......
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