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

QML sanitizing

parent f9e75ce8
......@@ -31,6 +31,8 @@ DebugBuild {
DESTDIR = $${OUT_PWD}/release
}
QML_IMPORT_PATH += $$PWD/src/QmlControls
#
# OS Specific settings
#
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
<file alias="QGroundControl/Airmap/FlightBrief.qml">FlightBrief.qml</file>
<file alias="QGroundControl/Airmap/FlightDetails.qml">FlightDetails.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>
</qresource>
<qresource prefix="/json">
......
......@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
APMAirframeComponentController {
......
......@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; }
......
......@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; }
......
......@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; }
......
......@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; }
......
......@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
property bool _firmware34: activeVehicle.versionCompare(3, 5, 0) < 0
......
......@@ -9,7 +9,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; }
......
......@@ -9,7 +9,6 @@ import QGroundControl.Controllers 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; }
......
......@@ -12,7 +12,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; }
......
......@@ -20,7 +20,7 @@
<file alias="SensorsComponentSummary.qml">../../AutoPilotPlugins/PX4/SensorsComponentSummary.qml</file>
<file alias="SensorsComponentSummaryFixedWing.qml">../../AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.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 prefix="/json">
<file alias="PX4/MavCmdInfoCommon.json">MavCmdInfoCommon.json</file>
......
Module QGroundControl.FlightDisplay
BuiltInPreFlightCheckModel 1.0 BuiltInPreFlightCheckModel.qml
FlightDisplayView 1.0 FlightDisplayView.qml
FlightDisplayViewMap 1.0 FlightDisplayViewMap.qml
FlightDisplayViewVideo 1.0 FlightDisplayViewVideo.qml
FlightDisplayViewWidgets 1.0 FlightDisplayViewWidgets.qml
GuidedActionConfirm 1.0 GuidedActionConfirm.qml
GuidedActionsController 1.0 GuidedActionsController.qml
GuidedActionList 1.0 GuidedActionList.qml
GuidedActionsController 1.0 GuidedActionsController.qml
GuidedAltitudeSlider 1.0 GuidedAltitudeSlider.qml
MultiVehicleList 1.0 MultiVehicleList.qml
PreFlightBatteryCheck 1.0 PreFlightBatteryCheck.qml
BuiltInPreFlightCheckModel 1.0 BuiltInPreFlightCheckModel.qml
PreFlightGPSCheck 1.0 PreFlightGPSCheck.qml
PreFlightRCCheck 1.0 PreFlightRCCheck.qml
PreFlightSensorsHealthCheck 1.0 PreFlightSensorsHealthCheck.qml
PreFlightSoundCheck 1.0 PreFlightSoundCheck.qml
......@@ -38,7 +38,7 @@ Item {
property Fact _mapboxFact: _settingsManager ? _settingsManager.appSettings.mapboxToken : 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 var savedCenter: undefined
property real savedZoom: 3
......@@ -59,7 +59,7 @@ Item {
readonly property real maxZoomLevel: 20
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 }
......
......@@ -32,7 +32,7 @@ SetupPage {
Connections {
target: joystickManager
onAvailableJoysticksChanged: {
if( joystickManager.joysticks.length == 0 ) {
if( joystickManager.joysticks.length === 0 ) {
summaryButton.checked = true
setupView.showSummaryPanel()
}
......@@ -387,7 +387,7 @@ SetupPage {
Component.onCompleted: {
var index = joystickCombo.find(joystickManager.activeJoystickName)
if (index == -1) {
if (index === -1) {
console.warn(qsTr("Active joystick name not in combo"), joystickManager.activeJoystickName)
} else {
joystickCombo.currentIndex = index
......@@ -412,7 +412,7 @@ SetupPage {
QGCRadioButton {
text: qsTr("Center stick is zero throttle")
checked: _activeJoystick ? _activeJoystick.throttleMode == 0 : false
checked: _activeJoystick ? _activeJoystick.throttleMode === 0 : false
onClicked: _activeJoystick.throttleMode = 0
}
......@@ -421,7 +421,7 @@ SetupPage {
x: 20
width: parent.width
spacing: ScreenTools.defaultFontPixelWidth
visible: _activeJoystick ? _activeJoystick.throttleMode == 0 : false
visible: _activeJoystick ? _activeJoystick.throttleMode === 0 : false
QGCCheckBox {
id: accumulator
......@@ -434,7 +434,7 @@ SetupPage {
QGCRadioButton {
text: qsTr("Full down stick is zero throttle")
checked: _activeJoystick ? _activeJoystick.throttleMode == 1 : false
checked: _activeJoystick ? _activeJoystick.throttleMode === 1 : false
onClicked: _activeJoystick.throttleMode = 1
}
......@@ -476,7 +476,7 @@ SetupPage {
QGCCheckBox {
id: advancedSettings
checked: activeVehicle.joystickMode != 0
checked: activeVehicle.joystickMode !== 0
text: qsTr("Advanced settings (careful!)")
onClicked: {
......@@ -531,7 +531,7 @@ SetupPage {
visible: advancedSettings.checked
QGCCheckBox {
id: joystickCircleCorrection
checked: activeVehicle.joystickMode != 0
checked: activeVehicle.joystickMode !== 0
text: qsTr("Enable circle correction")
Component.onCompleted: checked = _activeJoystick.circleCorrection
......@@ -608,7 +608,7 @@ SetupPage {
QGCCheckBox {
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) : "")
}
......
......@@ -50,7 +50,7 @@ Item {
loader.visible = false
textOutput.text = _noVehicleText
if (_activeVehicle) {
if (controller.customQmlFile == "") {
if (controller.customQmlFile === "") {
textOutput.text = _assignQmlFile
} else {
loader.source = controller.customQmlFile
......
......@@ -642,7 +642,7 @@ Rectangle {
QGCRadioButton {
text: qsTr("Perform Survey-In")
visible: rtkGrid.rtkSettings.useFixedBasePosition.visible
checked: rtkGrid.rtkSettings.useFixedBasePosition.value == false
checked: rtkGrid.rtkSettings.useFixedBasePosition.value === false
onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = false
Layout.columnSpan: 3
}
......@@ -676,7 +676,7 @@ Rectangle {
QGCRadioButton {
text: qsTr("Use Specified Base Position")
visible: rtkGrid.rtkSettings.useFixedBasePosition.visible
checked: rtkGrid.rtkSettings.useFixedBasePosition.value == true
checked: rtkGrid.rtkSettings.useFixedBasePosition.value === true
onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = true
Layout.columnSpan: 3
}
......
......@@ -86,9 +86,9 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
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: (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 {
function updatelinkSelectionMenu() {
if (activeVehicle) {
// 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])
}
linkSelectionMenuItems.length = 0
......@@ -55,7 +56,7 @@ Item {
// Add new items
var has_hl = false;
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)})
linkSelectionMenuItems.push(menuItem)
linkSelectionMenu.insertItem(i, menuItem)
......
......@@ -47,12 +47,13 @@ Item {
function updateFlightModesMenu() {
if (activeVehicle && activeVehicle.flightModeSetAvailable) {
// 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])
}
flightModesMenuItems.length = 0
// 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] })
flightModesMenuItems.push(menuItem)
flightModesMenu.insertItem(i, menuItem)
......
......@@ -46,7 +46,7 @@ Item {
QGCLabel {
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
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