Commit 059bb4c6 authored by Gus Grubba's avatar Gus Grubba

QML sanitizing

parent f9e75ce8
...@@ -31,6 +31,8 @@ DebugBuild { ...@@ -31,6 +31,8 @@ DebugBuild {
DESTDIR = $${OUT_PWD}/release DESTDIR = $${OUT_PWD}/release
} }
QML_IMPORT_PATH += $$PWD/src/QmlControls
# #
# OS Specific settings # OS Specific settings
# #
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<file alias="QGroundControl/Airmap/FlightBrief.qml">FlightBrief.qml</file> <file alias="QGroundControl/Airmap/FlightBrief.qml">FlightBrief.qml</file>
<file alias="QGroundControl/Airmap/FlightDetails.qml">FlightDetails.qml</file> <file alias="QGroundControl/Airmap/FlightDetails.qml">FlightDetails.qml</file>
<file alias="QGroundControl/Airmap/FlightFeature.qml">FlightFeature.qml</file> <file alias="QGroundControl/Airmap/FlightFeature.qml">FlightFeature.qml</file>
<file alias="QGroundControl/Airmap/qmldir">QGroundControl.Airmap.qmldir</file> <file alias="QGroundControl/Airmap/qmldir">../QmlControls/QGroundControl/Airmap/qmldir</file>
<file alias="QGroundControl/Airmap/RuleSelector.qml">RuleSelector.qml</file> <file alias="QGroundControl/Airmap/RuleSelector.qml">RuleSelector.qml</file>
</qresource> </qresource>
<qresource prefix="/json"> <qresource prefix="/json">
......
...@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0 ...@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
QGCPalette { id: qgcPal; colorGroupEnabled: enabled } QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
APMAirframeComponentController { APMAirframeComponentController {
......
...@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0 ...@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; } FactPanelController { id: controller; }
......
...@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0 ...@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; } FactPanelController { id: controller; }
......
...@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0 ...@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; } FactPanelController { id: controller; }
......
...@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0 ...@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; } FactPanelController { id: controller; }
......
...@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0 ...@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
property bool _firmware34: activeVehicle.versionCompare(3, 5, 0) < 0 property bool _firmware34: activeVehicle.versionCompare(3, 5, 0) < 0
......
...@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0 ...@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; } FactPanelController { id: controller; }
......
...@@ -9,7 +9,6 @@ import QGroundControl.Controllers 1.0 ...@@ -9,7 +9,6 @@ import QGroundControl.Controllers 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; } FactPanelController { id: controller; }
......
...@@ -12,7 +12,6 @@ import QGroundControl.Palette 1.0 ...@@ -12,7 +12,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; } FactPanelController { id: controller; }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<file alias="SensorsComponentSummary.qml">../../AutoPilotPlugins/PX4/SensorsComponentSummary.qml</file> <file alias="SensorsComponentSummary.qml">../../AutoPilotPlugins/PX4/SensorsComponentSummary.qml</file>
<file alias="SensorsComponentSummaryFixedWing.qml">../../AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml</file> <file alias="SensorsComponentSummaryFixedWing.qml">../../AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml</file>
<file alias="SensorsSetup.qml">../../AutoPilotPlugins/PX4/SensorsSetup.qml</file> <file alias="SensorsSetup.qml">../../AutoPilotPlugins/PX4/SensorsSetup.qml</file>
<file alias="QGroundControl/PX4/qmldir">QGroundControl.PX4.qmldir</file> <file alias="QGroundControl/PX4/qmldir">../../QmlControls/QGroundControl/PX4/qmldir</file>
</qresource> </qresource>
<qresource prefix="/json"> <qresource prefix="/json">
<file alias="PX4/MavCmdInfoCommon.json">MavCmdInfoCommon.json</file> <file alias="PX4/MavCmdInfoCommon.json">MavCmdInfoCommon.json</file>
......
Module QGroundControl.FlightDisplay Module QGroundControl.FlightDisplay
BuiltInPreFlightCheckModel 1.0 BuiltInPreFlightCheckModel.qml
FlightDisplayView 1.0 FlightDisplayView.qml FlightDisplayView 1.0 FlightDisplayView.qml
FlightDisplayViewMap 1.0 FlightDisplayViewMap.qml FlightDisplayViewMap 1.0 FlightDisplayViewMap.qml
FlightDisplayViewVideo 1.0 FlightDisplayViewVideo.qml FlightDisplayViewVideo 1.0 FlightDisplayViewVideo.qml
FlightDisplayViewWidgets 1.0 FlightDisplayViewWidgets.qml FlightDisplayViewWidgets 1.0 FlightDisplayViewWidgets.qml
GuidedActionConfirm 1.0 GuidedActionConfirm.qml GuidedActionConfirm 1.0 GuidedActionConfirm.qml
GuidedActionsController 1.0 GuidedActionsController.qml
GuidedActionList 1.0 GuidedActionList.qml GuidedActionList 1.0 GuidedActionList.qml
GuidedActionsController 1.0 GuidedActionsController.qml
GuidedAltitudeSlider 1.0 GuidedAltitudeSlider.qml GuidedAltitudeSlider 1.0 GuidedAltitudeSlider.qml
MultiVehicleList 1.0 MultiVehicleList.qml MultiVehicleList 1.0 MultiVehicleList.qml
PreFlightBatteryCheck 1.0 PreFlightBatteryCheck.qml PreFlightBatteryCheck 1.0 PreFlightBatteryCheck.qml
BuiltInPreFlightCheckModel 1.0 BuiltInPreFlightCheckModel.qml
PreFlightGPSCheck 1.0 PreFlightGPSCheck.qml PreFlightGPSCheck 1.0 PreFlightGPSCheck.qml
PreFlightRCCheck 1.0 PreFlightRCCheck.qml PreFlightRCCheck 1.0 PreFlightRCCheck.qml
PreFlightSensorsHealthCheck 1.0 PreFlightSensorsHealthCheck.qml PreFlightSensorsHealthCheck 1.0 PreFlightSensorsHealthCheck.qml
PreFlightSoundCheck 1.0 PreFlightSoundCheck.qml PreFlightSoundCheck 1.0 PreFlightSoundCheck.qml
...@@ -38,7 +38,7 @@ Item { ...@@ -38,7 +38,7 @@ Item {
property Fact _mapboxFact: _settingsManager ? _settingsManager.appSettings.mapboxToken : null property Fact _mapboxFact: _settingsManager ? _settingsManager.appSettings.mapboxToken : null
property Fact _esriFact: _settingsManager ? _settingsManager.appSettings.esriToken : null property Fact _esriFact: _settingsManager ? _settingsManager.appSettings.esriToken : null
property string mapType: _fmSettings.mapProvider.enumStringValue + " " + _fmSettings.mapType.enumStringValue property string mapType: _fmSettings ? (_fmSettings.mapProvider.enumStringValue + " " + _fmSettings.mapType.enumStringValue) : ""
property bool isMapInteractive: false property bool isMapInteractive: false
property var savedCenter: undefined property var savedCenter: undefined
property real savedZoom: 3 property real savedZoom: 3
...@@ -59,7 +59,7 @@ Item { ...@@ -59,7 +59,7 @@ Item {
readonly property real maxZoomLevel: 20 readonly property real maxZoomLevel: 20
readonly property real sliderTouchArea: ScreenTools.defaultFontPixelWidth * (ScreenTools.isTinyScreen ? 5 : (ScreenTools.isMobile ? 6 : 3)) readonly property real sliderTouchArea: ScreenTools.defaultFontPixelWidth * (ScreenTools.isTinyScreen ? 5 : (ScreenTools.isMobile ? 6 : 3))
readonly property int _maxTilesForDownload: _settings.maxTilesForDownload.rawValue readonly property int _maxTilesForDownload: _settings ? _settings.maxTilesForDownload.rawValue : 0
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
......
...@@ -32,7 +32,7 @@ SetupPage { ...@@ -32,7 +32,7 @@ SetupPage {
Connections { Connections {
target: joystickManager target: joystickManager
onAvailableJoysticksChanged: { onAvailableJoysticksChanged: {
if( joystickManager.joysticks.length == 0 ) { if( joystickManager.joysticks.length === 0 ) {
summaryButton.checked = true summaryButton.checked = true
setupView.showSummaryPanel() setupView.showSummaryPanel()
} }
...@@ -387,7 +387,7 @@ SetupPage { ...@@ -387,7 +387,7 @@ SetupPage {
Component.onCompleted: { Component.onCompleted: {
var index = joystickCombo.find(joystickManager.activeJoystickName) var index = joystickCombo.find(joystickManager.activeJoystickName)
if (index == -1) { if (index === -1) {
console.warn(qsTr("Active joystick name not in combo"), joystickManager.activeJoystickName) console.warn(qsTr("Active joystick name not in combo"), joystickManager.activeJoystickName)
} else { } else {
joystickCombo.currentIndex = index joystickCombo.currentIndex = index
...@@ -412,7 +412,7 @@ SetupPage { ...@@ -412,7 +412,7 @@ SetupPage {
QGCRadioButton { QGCRadioButton {
text: qsTr("Center stick is zero throttle") text: qsTr("Center stick is zero throttle")
checked: _activeJoystick ? _activeJoystick.throttleMode == 0 : false checked: _activeJoystick ? _activeJoystick.throttleMode === 0 : false
onClicked: _activeJoystick.throttleMode = 0 onClicked: _activeJoystick.throttleMode = 0
} }
...@@ -421,7 +421,7 @@ SetupPage { ...@@ -421,7 +421,7 @@ SetupPage {
x: 20 x: 20
width: parent.width width: parent.width
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
visible: _activeJoystick ? _activeJoystick.throttleMode == 0 : false visible: _activeJoystick ? _activeJoystick.throttleMode === 0 : false
QGCCheckBox { QGCCheckBox {
id: accumulator id: accumulator
...@@ -434,7 +434,7 @@ SetupPage { ...@@ -434,7 +434,7 @@ SetupPage {
QGCRadioButton { QGCRadioButton {
text: qsTr("Full down stick is zero throttle") text: qsTr("Full down stick is zero throttle")
checked: _activeJoystick ? _activeJoystick.throttleMode == 1 : false checked: _activeJoystick ? _activeJoystick.throttleMode === 1 : false
onClicked: _activeJoystick.throttleMode = 1 onClicked: _activeJoystick.throttleMode = 1
} }
...@@ -476,7 +476,7 @@ SetupPage { ...@@ -476,7 +476,7 @@ SetupPage {
QGCCheckBox { QGCCheckBox {
id: advancedSettings id: advancedSettings
checked: activeVehicle.joystickMode != 0 checked: activeVehicle.joystickMode !== 0
text: qsTr("Advanced settings (careful!)") text: qsTr("Advanced settings (careful!)")
onClicked: { onClicked: {
...@@ -531,7 +531,7 @@ SetupPage { ...@@ -531,7 +531,7 @@ SetupPage {
visible: advancedSettings.checked visible: advancedSettings.checked
QGCCheckBox { QGCCheckBox {
id: joystickCircleCorrection id: joystickCircleCorrection
checked: activeVehicle.joystickMode != 0 checked: activeVehicle.joystickMode !== 0
text: qsTr("Enable circle correction") text: qsTr("Enable circle correction")
Component.onCompleted: checked = _activeJoystick.circleCorrection Component.onCompleted: checked = _activeJoystick.circleCorrection
...@@ -608,7 +608,7 @@ SetupPage { ...@@ -608,7 +608,7 @@ SetupPage {
QGCCheckBox { QGCCheckBox {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: _activeJoystick ? _activeJoystick.buttonActions[modelData] != "" : false checked: _activeJoystick ? _activeJoystick.buttonActions[modelData] !== "" : false
onClicked: _activeJoystick.setButtonAction(modelData, checked ? buttonActionCombo.textAt(buttonActionCombo.currentIndex) : "") onClicked: _activeJoystick.setButtonAction(modelData, checked ? buttonActionCombo.textAt(buttonActionCombo.currentIndex) : "")
} }
......
...@@ -50,7 +50,7 @@ Item { ...@@ -50,7 +50,7 @@ Item {
loader.visible = false loader.visible = false
textOutput.text = _noVehicleText textOutput.text = _noVehicleText
if (_activeVehicle) { if (_activeVehicle) {
if (controller.customQmlFile == "") { if (controller.customQmlFile === "") {
textOutput.text = _assignQmlFile textOutput.text = _assignQmlFile
} else { } else {
loader.source = controller.customQmlFile loader.source = controller.customQmlFile
......
...@@ -642,7 +642,7 @@ Rectangle { ...@@ -642,7 +642,7 @@ Rectangle {
QGCRadioButton { QGCRadioButton {
text: qsTr("Perform Survey-In") text: qsTr("Perform Survey-In")
visible: rtkGrid.rtkSettings.useFixedBasePosition.visible visible: rtkGrid.rtkSettings.useFixedBasePosition.visible
checked: rtkGrid.rtkSettings.useFixedBasePosition.value == false checked: rtkGrid.rtkSettings.useFixedBasePosition.value === false
onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = false onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = false
Layout.columnSpan: 3 Layout.columnSpan: 3
} }
...@@ -676,7 +676,7 @@ Rectangle { ...@@ -676,7 +676,7 @@ Rectangle {
QGCRadioButton { QGCRadioButton {
text: qsTr("Use Specified Base Position") text: qsTr("Use Specified Base Position")
visible: rtkGrid.rtkSettings.useFixedBasePosition.visible visible: rtkGrid.rtkSettings.useFixedBasePosition.visible
checked: rtkGrid.rtkSettings.useFixedBasePosition.value == true checked: rtkGrid.rtkSettings.useFixedBasePosition.value === true
onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = true onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = true
Layout.columnSpan: 3 Layout.columnSpan: 3
} }
......
...@@ -86,9 +86,9 @@ Item { ...@@ -86,9 +86,9 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
QGCLabel { text: qsTr("Voltage:") } QGCLabel { text: qsTr("Voltage:") }
QGCLabel { text: (activeVehicle && activeVehicle.battery.voltage.value != -1) ? (activeVehicle.battery.voltage.valueString + " " + activeVehicle.battery.voltage.units) : "N/A" } QGCLabel { text: (activeVehicle && activeVehicle.battery.voltage.value !== -1) ? (activeVehicle.battery.voltage.valueString + " " + activeVehicle.battery.voltage.units) : "N/A" }
QGCLabel { text: qsTr("Accumulated Consumption:") } QGCLabel { text: qsTr("Accumulated Consumption:") }
QGCLabel { text: (activeVehicle && activeVehicle.battery.mahConsumed.value != -1) ? (activeVehicle.battery.mahConsumed.valueString + " " + activeVehicle.battery.mahConsumed.units) : "N/A" } QGCLabel { text: (activeVehicle && activeVehicle.battery.mahConsumed.value !== -1) ? (activeVehicle.battery.mahConsumed.valueString + " " + activeVehicle.battery.mahConsumed.units) : "N/A" }
} }
} }
} }
......
...@@ -47,7 +47,8 @@ Item { ...@@ -47,7 +47,8 @@ Item {
function updatelinkSelectionMenu() { function updatelinkSelectionMenu() {
if (activeVehicle) { if (activeVehicle) {
// Remove old menu items // Remove old menu items
for (var i = 0; i < linkSelectionMenuItems.length; i++) { var i
for (i = 0; i < linkSelectionMenuItems.length; i++) {
linkSelectionMenu.removeItem(linkSelectionMenuItems[i]) linkSelectionMenu.removeItem(linkSelectionMenuItems[i])
} }
linkSelectionMenuItems.length = 0 linkSelectionMenuItems.length = 0
...@@ -55,7 +56,7 @@ Item { ...@@ -55,7 +56,7 @@ Item {
// Add new items // Add new items
var has_hl = false; var has_hl = false;
var links = activeVehicle.links var links = activeVehicle.links
for (var i = 0; i < links.length; i++) { for (i = 0; i < links.length; i++) {
var menuItem = linkSelectionMenuItemComponent.createObject(null, { "text": links[i].getName(), "enabled": links[i].link_active(activeVehicle.id)}) var menuItem = linkSelectionMenuItemComponent.createObject(null, { "text": links[i].getName(), "enabled": links[i].link_active(activeVehicle.id)})
linkSelectionMenuItems.push(menuItem) linkSelectionMenuItems.push(menuItem)
linkSelectionMenu.insertItem(i, menuItem) linkSelectionMenu.insertItem(i, menuItem)
......
...@@ -47,12 +47,13 @@ Item { ...@@ -47,12 +47,13 @@ Item {
function updateFlightModesMenu() { function updateFlightModesMenu() {
if (activeVehicle && activeVehicle.flightModeSetAvailable) { if (activeVehicle && activeVehicle.flightModeSetAvailable) {
// Remove old menu items // Remove old menu items
for (var i = 0; i < flightModesMenuItems.length; i++) { var i
for (i = 0; i < flightModesMenuItems.length; i++) {
flightModesMenu.removeItem(flightModesMenuItems[i]) flightModesMenu.removeItem(flightModesMenuItems[i])
} }
flightModesMenuItems.length = 0 flightModesMenuItems.length = 0
// Add new items // Add new items
for (var i = 0; i < _flightModes.length; i++) { for (i = 0; i < _flightModes.length; i++) {
var menuItem = flightModeMenuItemComponent.createObject(null, { "text": _flightModes[i] }) var menuItem = flightModeMenuItemComponent.createObject(null, { "text": _flightModes[i] })
flightModesMenuItems.push(menuItem) flightModesMenuItems.push(menuItem)
flightModesMenu.insertItem(i, menuItem) flightModesMenu.insertItem(i, menuItem)
......
...@@ -46,7 +46,7 @@ Item { ...@@ -46,7 +46,7 @@ Item {
QGCLabel { QGCLabel {
id: rssiLabel id: rssiLabel
text: activeVehicle ? (activeVehicle.rcRSSI != 255 ? qsTr("RC RSSI Status") : qsTr("RC RSSI Data Unavailable")) : qsTr("N/A", "No data available") text: activeVehicle ? (activeVehicle.rcRSSI !== 255 ? qsTr("RC RSSI Status") : qsTr("RC RSSI Data Unavailable")) : qsTr("N/A", "No data available")
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
......
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