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

Avoid variable name colision

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