diff --git a/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc b/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc index b4ce2e4..d67a530 100644 --- a/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc +++ b/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc @@ -446,46 +446,55 @@ void APMFirmwarePlugin::_handleIncomingHeartbeat(Vehicle* vehicle, mavlink_messa { bool flying = false; - // We pull Vehicle::flying state from HEARTBEAT on ArduPilot. This is a firmware specific test. + mavlink_heartbeat_t heartbeat; + mavlink_msg_heartbeat_decode(message, &heartbeat); - if (vehicle->armed()) { - mavlink_heartbeat_t heartbeat; - mavlink_msg_heartbeat_decode(message, &heartbeat); + if (message->compid == MAV_COMP_ID_AUTOPILOT1) { + // We pull Vehicle::flying state from HEARTBEAT on ArduPilot. This is a firmware specific test. + if (vehicle->armed()) { - flying = heartbeat.system_status == MAV_STATE_ACTIVE; - if (!flying && vehicle->flying()) { - // If we were previously flying, and we go into critical or emergency assume we are still flying - flying = heartbeat.system_status == MAV_STATE_CRITICAL || heartbeat.system_status == MAV_STATE_EMERGENCY; + flying = heartbeat.system_status == MAV_STATE_ACTIVE; + if (!flying && vehicle->flying()) { + // If we were previously flying, and we go into critical or emergency assume we are still flying + flying = heartbeat.system_status == MAV_STATE_CRITICAL || heartbeat.system_status == MAV_STATE_EMERGENCY; + } } + vehicle->_setFlying(flying); } - vehicle->_setFlying(flying); + // We need to know whether this component is part of the ArduPilot stack code or not so we can adjust mavlink quirks appropriately. + // If the component sends a heartbeat we can know that. If it's doesn't there is pretty much no way to know. + _ardupilotComponentMap[message->sysid][message->compid] = heartbeat.autopilot == MAV_AUTOPILOT_ARDUPILOTMEGA; + + // Force the ESP8266 to be non-ArduPilot code (it doesn't send heartbeats) + _ardupilotComponentMap[message->sysid][MAV_COMP_ID_UDP_BRIDGE] = false; } bool APMFirmwarePlugin::adjustIncomingMavlinkMessage(Vehicle* vehicle, mavlink_message_t* message) { - // Only translate messages which come from the autopilot. All other components are expected to follow current mavlink spec. - if (message->compid != MAV_COMP_ID_AUTOPILOT1) { + if (message->msgid == MAVLINK_MSG_ID_HEARTBEAT) { + // We need to look at all heartbeats that go by from any component + _handleIncomingHeartbeat(vehicle, message); return true; } - switch (message->msgid) { - case MAVLINK_MSG_ID_PARAM_VALUE: - _handleIncomingParamValue(vehicle, message); - break; - case MAVLINK_MSG_ID_STATUSTEXT: - return _handleIncomingStatusText(vehicle, message, false /* longVersion */); - case MAVLINK_MSG_ID_STATUSTEXT_LONG: - return _handleIncomingStatusText(vehicle, message, true /* longVersion */); - case MAVLINK_MSG_ID_HEARTBEAT: - _handleIncomingHeartbeat(vehicle, message); - break; - case MAVLINK_MSG_ID_RC_CHANNELS: - _handleRCChannels(vehicle, message); - break; - case MAVLINK_MSG_ID_RC_CHANNELS_RAW: - _handleRCChannelsRaw(vehicle, message); - break; + // Only translate messages which come from ArduPilot code. All other components are expected to follow current mavlink spec. + if (_ardupilotComponentMap[vehicle->id()][message->compid]) { + switch (message->msgid) { + case MAVLINK_MSG_ID_PARAM_VALUE: + _handleIncomingParamValue(vehicle, message); + break; + case MAVLINK_MSG_ID_STATUSTEXT: + return _handleIncomingStatusText(vehicle, message, false /* longVersion */); + case MAVLINK_MSG_ID_STATUSTEXT_LONG: + return _handleIncomingStatusText(vehicle, message, true /* longVersion */); + case MAVLINK_MSG_ID_RC_CHANNELS: + _handleRCChannels(vehicle, message); + break; + case MAVLINK_MSG_ID_RC_CHANNELS_RAW: + _handleRCChannelsRaw(vehicle, message); + break; + } } return true; @@ -493,15 +502,13 @@ bool APMFirmwarePlugin::adjustIncomingMavlinkMessage(Vehicle* vehicle, mavlink_m void APMFirmwarePlugin::adjustOutgoingMavlinkMessage(Vehicle* vehicle, LinkInterface* outgoingLink, mavlink_message_t* message) { - //-- Don't process messages to/from UDP Bridge. It doesn't suffer from these issues - if (message->compid == MAV_COMP_ID_UDP_BRIDGE) { - return; - } - - switch (message->msgid) { - case MAVLINK_MSG_ID_PARAM_SET: - _handleOutgoingParamSet(vehicle, outgoingLink, message); - break; + // Only translate messages which come from ArduPilot code. All other components are expected to follow current mavlink spec. + if (_ardupilotComponentMap[vehicle->id()][message->compid]) { + switch (message->msgid) { + case MAVLINK_MSG_ID_PARAM_SET: + _handleOutgoingParamSet(vehicle, outgoingLink, message); + break; + } } } diff --git a/src/FirmwarePlugin/APM/APMFirmwarePlugin.h b/src/FirmwarePlugin/APM/APMFirmwarePlugin.h index b7cbfbb..c5867d0 100644 --- a/src/FirmwarePlugin/APM/APMFirmwarePlugin.h +++ b/src/FirmwarePlugin/APM/APMFirmwarePlugin.h @@ -137,6 +137,7 @@ private: // Vehicle specific data should go into APMFirmwarePluginInstanceData QList _supportedModes; + QMap> _ardupilotComponentMap; static const char* _artooIP; static const int _artooVideoHandshakePort; diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index 35d260b..5f91307 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -559,8 +559,11 @@ Item { active: (_virtualJoystick ? _virtualJoystick.value : false) && !(activeVehicle ? activeVehicle.highLatencyLink : false) property bool useLightColors: isBackgroundDark + // The default behaviour is not centralized throttle + property bool centralizeThrottle: _virtualJoystickCentralized ? _virtualJoystickCentralized.value : false property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick + property Fact _virtualJoystickCentralized: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized } ToolStrip { diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index d33573e..2a5b31e 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -85,6 +85,10 @@ Item { target: QGroundControl.settingsManager.appSettings.virtualJoystick onValueChanged: _setInstrumentWidget() } + Connections { + target: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized + onValueChanged: _setInstrumentWidget() + } Connections { target: QGroundControl.settingsManager.appSettings.showLargeCompass diff --git a/src/FlightDisplay/VirtualJoystick.qml b/src/FlightDisplay/VirtualJoystick.qml index 9a7b52c..060c56a 100644 --- a/src/FlightDisplay/VirtualJoystick.qml +++ b/src/FlightDisplay/VirtualJoystick.qml @@ -17,8 +17,8 @@ import QGroundControl.Palette 1.0 import QGroundControl.Vehicle 1.0 Item { - //property bool useLightColors - Must be passed in from loader - + //property bool useLightColors - Must be passed in from loaded + //property bool centralizeThrottle - Must be passed in from loaded Timer { interval: 40 // 25Hz, same as real joystick rate running: QGroundControl.settingsManager.appSettings.virtualJoystick.value && activeVehicle @@ -39,8 +39,8 @@ Item { width: parent.height height: parent.height yAxisThrottle: true + yAxisThrottleCentered: centralizeThrottle lightColors: useLightColors - throttle: true } JoystickThumbPad { diff --git a/src/QmlControls/JoystickThumbPad.qml b/src/QmlControls/JoystickThumbPad.qml index de7b54e..614595e 100644 --- a/src/QmlControls/JoystickThumbPad.qml +++ b/src/QmlControls/JoystickThumbPad.qml @@ -11,26 +11,36 @@ Item { property real xAxis: 0 ///< Value range [-1,1], negative values left stick, positive values right stick property real yAxis: 0 ///< Value range [-1,1], negative values up stick, positive values down stick property bool yAxisThrottle: false ///< true: yAxis used for throttle, range [1,0], positive value are stick up + property bool yAxisThrottleCentered: false ///< false: center yAxis in throttle for reverser and forward property real xPositionDelta: 0 ///< Amount to move the control on x axis property real yPositionDelta: 0 ///< Amount to move the control on y axis - property bool throttle: false property real _centerXY: width / 2 property bool _processTouchPoints: false - property bool _stickCenteredOnce: false property real stickPositionX: _centerXY - property real stickPositionY: yAxisThrottle ? height : _centerXY + property real stickPositionY: yAxisThrottleCentered ? _centerXY : height QGCMapPalette { id: mapPal } - onStickPositionXChanged: { + onWidthChanged: calculateXAxis() + onStickPositionXChanged: calculateXAxis() + onHeightChanged: calculateYAxis() + onStickPositionYChanged: calculateYAxis() + + function calculateXAxis() { + if(!_joyRoot.visible) { + return; + } var xAxisTemp = stickPositionX / width xAxisTemp *= 2.0 xAxisTemp -= 1.0 xAxis = xAxisTemp } - onStickPositionYChanged: { + function calculateYAxis() { + if(!_joyRoot.visible) { + return; + } var yAxisTemp = stickPositionY / height yAxisTemp *= 2.0 yAxisTemp -= 1.0 @@ -40,8 +50,7 @@ Item { yAxis = yAxisTemp } - function reCenter() - { + function reCenter() { _processTouchPoints = false // Move control back to original position @@ -50,13 +59,12 @@ Item { // Center sticks stickPositionX = _centerXY - if (!yAxisThrottle) { + if (yAxisThrottleCentered) { stickPositionY = _centerXY } } - function thumbDown(touchPoints) - { + function thumbDown(touchPoints) { // Position the control around the initial thumb position xPositionDelta = touchPoints[0].x - _centerXY if (yAxisThrottle) { @@ -86,7 +94,7 @@ Item { QGCColoredImage { color: lightColors ? "white" : "black" - visible: throttle + visible: yAxisThrottle height: ScreenTools.defaultFontPixelHeight width: height sourceSize.height: height @@ -100,7 +108,7 @@ Item { QGCColoredImage { color: lightColors ? "white" : "black" - visible: throttle + visible: yAxisThrottle height: ScreenTools.defaultFontPixelHeight width: height sourceSize.height: height @@ -114,7 +122,7 @@ Item { QGCColoredImage { color: lightColors ? "white" : "black" - visible: throttle + visible: yAxisThrottle height: ScreenTools.defaultFontPixelHeight width: height sourceSize.height: height @@ -128,7 +136,7 @@ Item { QGCColoredImage { color: lightColors ? "white" : "black" - visible: throttle + visible: yAxisThrottle height: ScreenTools.defaultFontPixelHeight width: height sourceSize.height: height diff --git a/src/Settings/App.SettingsGroup.json b/src/Settings/App.SettingsGroup.json index 4e42382..37058d7 100644 --- a/src/Settings/App.SettingsGroup.json +++ b/src/Settings/App.SettingsGroup.json @@ -104,6 +104,13 @@ "defaultValue": false }, { + "name": "virtualJoystickCentralized", + "shortDescription": "Set virtual joystick to be centralize throttle (spring-loaded).", + "longDescription": "If this option is enabled the virtual joystick throttle stick will be centralized.", + "type": "bool", + "defaultValue": false +}, +{ "name": "gstDebugLevel", "shortDescription": "Video streaming debug", "longDescription": "Sets the environment variable GST_DEBUG for all pipeline elements on boot.", diff --git a/src/Settings/AppSettings.cc b/src/Settings/AppSettings.cc index a5fe947..cc9ac31 100644 --- a/src/Settings/AppSettings.cc +++ b/src/Settings/AppSettings.cc @@ -78,6 +78,7 @@ DECLARE_SETTINGSFACT(AppSettings, telemetrySave) DECLARE_SETTINGSFACT(AppSettings, telemetrySaveNotArmed) DECLARE_SETTINGSFACT(AppSettings, audioMuted) DECLARE_SETTINGSFACT(AppSettings, virtualJoystick) +DECLARE_SETTINGSFACT(AppSettings, virtualJoystickCentralized) DECLARE_SETTINGSFACT(AppSettings, appFontPointSize) DECLARE_SETTINGSFACT(AppSettings, showLargeCompass) DECLARE_SETTINGSFACT(AppSettings, savePath) diff --git a/src/Settings/AppSettings.h b/src/Settings/AppSettings.h index 17cb0ec..afa5496 100644 --- a/src/Settings/AppSettings.h +++ b/src/Settings/AppSettings.h @@ -33,6 +33,7 @@ public: DEFINE_SETTINGFACT(telemetrySaveNotArmed) DEFINE_SETTINGFACT(audioMuted) DEFINE_SETTINGFACT(virtualJoystick) + DEFINE_SETTINGFACT(virtualJoystickCentralized) DEFINE_SETTINGFACT(appFontPointSize) DEFINE_SETTINGFACT(indoorPalette) DEFINE_SETTINGFACT(showLargeCompass) diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml index a751dca..bdcaf70 100644 --- a/src/VehicleSetup/JoystickConfig.qml +++ b/src/VehicleSetup/JoystickConfig.qml @@ -818,20 +818,24 @@ SetupPage { MouseArea { - id: deadbandMouseArea - anchors.fill: parent.item - enabled: controller.deadbandToggle + id: deadbandMouseArea + anchors.fill: parent.item + enabled: controller.deadbandToggle + preventStealing: true - property real startY + property real startX + property real direction onPressed: { - startY = mouseY + startX = mouseX + direction = startX > width/2 ? 1 : -1 parent.item.deadbandColor = "#3C6315" } onPositionChanged: { - var newValue = parent.item.deadbandValue + (startY - mouseY)*15 + var mouseToDeadband = 32768/(width/2) // Factor to have deadband follow the mouse movement + var newValue = parent.item.deadbandValue + direction*(mouseX - startX)*mouseToDeadband if ((newValue > 0) && (newValue <32768)){parent.item.deadbandValue=newValue;} - startY = mouseY + startX = mouseX } onReleased: { controller.setDeadbandValue(modelData,parent.item.deadbandValue) diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index 4ac6fc4..85e4742 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -56,926 +56,935 @@ Rectangle { readonly property real _internalWidthRatio: 0.8 - QGCFlickable { - clip: true - anchors.fill: parent - contentHeight: outerItem.height - contentWidth: outerItem.width - - Item { - id: outerItem + QGCFlickable { + clip: true + anchors.fill: parent + contentHeight: outerItem.height + contentWidth: outerItem.width + + Item { + id: outerItem width: Math.max(_root.width, settingsColumn.width) - height: settingsColumn.height - - ColumnLayout { - id: settingsColumn - anchors.horizontalCenter: parent.horizontalCenter - - QGCLabel { - id: unitsSectionLabel - text: qsTr("Units") - visible: QGroundControl.settingsManager.unitsSettings.visible - } - Rectangle { - Layout.preferredHeight: unitsGrid.height + (_margins * 2) - Layout.preferredWidth: unitsGrid.width + (_margins * 2) - color: qgcPal.windowShade - visible: miscSectionLabel.visible - Layout.fillWidth: true - - GridLayout { - id: unitsGrid - anchors.topMargin: _margins - anchors.top: parent.top - Layout.fillWidth: false - anchors.horizontalCenter: parent.horizontalCenter - flow: GridLayout.TopToBottom - rows: 4 - - Repeater { - model: [ qsTr("Distance"), qsTr("Area"), qsTr("Speed"), qsTr("Temperature") ] - QGCLabel { text: modelData } - } - Repeater { - model: [ QGroundControl.settingsManager.unitsSettings.distanceUnits, QGroundControl.settingsManager.unitsSettings.areaUnits, QGroundControl.settingsManager.unitsSettings.speedUnits, QGroundControl.settingsManager.unitsSettings.temperatureUnits ] - FactComboBox { - Layout.preferredWidth: _comboFieldWidth - fact: modelData - indexModel: false - } - } + height: settingsColumn.height + + ColumnLayout { + id: settingsColumn + anchors.horizontalCenter: parent.horizontalCenter + + QGCLabel { + id: unitsSectionLabel + text: qsTr("Units") + visible: QGroundControl.settingsManager.unitsSettings.visible } - } - - Item { width: 1; height: _margins } - - QGCLabel { - id: miscSectionLabel - text: qsTr("Miscellaneous") - visible: QGroundControl.settingsManager.appSettings.visible - } - Rectangle { - Layout.preferredWidth: Math.max(comboGrid.width, miscCol.width) + (_margins * 2) - Layout.preferredHeight: (pathRow.visible ? pathRow.y + pathRow.height : miscColItem.y + miscColItem.height) + (_margins * 2) - Layout.fillWidth: true - color: qgcPal.windowShade - visible: miscSectionLabel.visible - - Item { - id: comboGridItem - anchors.margins: _margins - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - height: comboGrid.height + Rectangle { + Layout.preferredHeight: unitsGrid.height + (_margins * 2) + Layout.preferredWidth: unitsGrid.width + (_margins * 2) + color: qgcPal.windowShade + visible: miscSectionLabel.visible + Layout.fillWidth: true GridLayout { - id: comboGrid + id: unitsGrid + anchors.topMargin: _margins + anchors.top: parent.top + Layout.fillWidth: false anchors.horizontalCenter: parent.horizontalCenter - columns: 2 - - QGCLabel { - text: qsTr("Language") - visible: QGroundControl.settingsManager.appSettings.language.visible - } - FactComboBox { - Layout.preferredWidth: _comboFieldWidth - fact: QGroundControl.settingsManager.appSettings.language - indexModel: false - visible: QGroundControl.settingsManager.appSettings.language.visible - } - - QGCLabel { - text: qsTr("Color Scheme") - visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible - } - FactComboBox { - Layout.preferredWidth: _comboFieldWidth - fact: QGroundControl.settingsManager.appSettings.indoorPalette - indexModel: false - visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible - } + flow: GridLayout.TopToBottom + rows: 4 - QGCLabel { - text: qsTr("Map Provider") - width: _labelWidth - visible: _mapProvider.visible - } - FactComboBox { - Layout.preferredWidth: _comboFieldWidth - fact: _mapProvider - indexModel: false - visible: _mapProvider.visible - } - - QGCLabel { - text: qsTr("Map Type") - visible: _mapType.visible + Repeater { + model: [ qsTr("Distance"), qsTr("Area"), qsTr("Speed"), qsTr("Temperature") ] + QGCLabel { text: modelData } } - FactComboBox { - id: mapTypes - Layout.preferredWidth: _comboFieldWidth - fact: _mapType - indexModel: false - visible: _mapType.visible - Connections { - target: QGroundControl.settingsManager.flightMapSettings - onMapTypeChanged: { - mapTypes.model = _mapType.enumStrings - } + Repeater { + model: [ QGroundControl.settingsManager.unitsSettings.distanceUnits, QGroundControl.settingsManager.unitsSettings.areaUnits, QGroundControl.settingsManager.unitsSettings.speedUnits, QGroundControl.settingsManager.unitsSettings.temperatureUnits ] + FactComboBox { + Layout.preferredWidth: _comboFieldWidth + fact: modelData + indexModel: false } } - - QGCLabel { - text: qsTr("Stream GCS Position") - visible: _followTarget.visible - } - FactComboBox { - Layout.preferredWidth: _comboFieldWidth - fact: _followTarget - indexModel: false - visible: _followTarget.visible - } } } - Item { - id: miscColItem - anchors.margins: _margins - anchors.left: parent.left - anchors.right: parent.right - anchors.top: comboGridItem.bottom - height: miscCol.height + Item { width: 1; height: _margins } - ColumnLayout { - id: miscCol - anchors.horizontalCenter: parent.horizontalCenter - spacing: _margins + QGCLabel { + id: miscSectionLabel + text: qsTr("Miscellaneous") + visible: QGroundControl.settingsManager.appSettings.visible + } + Rectangle { + Layout.preferredWidth: Math.max(comboGrid.width, miscCol.width) + (_margins * 2) + Layout.preferredHeight: (pathRow.visible ? pathRow.y + pathRow.height : miscColItem.y + miscColItem.height) + (_margins * 2) + Layout.fillWidth: true + color: qgcPal.windowShade + visible: miscSectionLabel.visible + + Item { + id: comboGridItem + anchors.margins: _margins + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + height: comboGrid.height + + GridLayout { + id: comboGrid + anchors.horizontalCenter: parent.horizontalCenter + columns: 2 - RowLayout { - Layout.fillWidth: false - Layout.alignment: Qt.AlignHCenter - visible: _appFontPointSize ? _appFontPointSize.visible : false + QGCLabel { + text: qsTr("Language") + visible: QGroundControl.settingsManager.appSettings.language.visible + } + FactComboBox { + Layout.preferredWidth: _comboFieldWidth + fact: QGroundControl.settingsManager.appSettings.language + indexModel: false + visible: QGroundControl.settingsManager.appSettings.language.visible + } QGCLabel { - text: qsTr("Font Size:") + text: qsTr("Color Scheme") + visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible } - QGCButton { - Layout.preferredWidth: height - Layout.preferredHeight: baseFontEdit.height - text: "-" - onClicked: { - if (_appFontPointSize.value > _appFontPointSize.min) { - _appFontPointSize.value = _appFontPointSize.value - 1 - } - } + FactComboBox { + Layout.preferredWidth: _comboFieldWidth + fact: QGroundControl.settingsManager.appSettings.indoorPalette + indexModel: false + visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible } - FactTextField { - id: baseFontEdit - Layout.preferredWidth: _valueFieldWidth - fact: QGroundControl.settingsManager.appSettings.appFontPointSize + + QGCLabel { + text: qsTr("Map Provider") + width: _labelWidth + visible: _mapProvider.visible } - QGCButton { - Layout.preferredWidth: height - Layout.preferredHeight: baseFontEdit.height - text: "+" - onClicked: { - if (_appFontPointSize.value < _appFontPointSize.max) { - _appFontPointSize.value = _appFontPointSize.value + 1 + FactComboBox { + Layout.preferredWidth: _comboFieldWidth + fact: _mapProvider + indexModel: false + visible: _mapProvider.visible + } + + QGCLabel { + text: qsTr("Map Type") + visible: _mapType.visible + } + FactComboBox { + id: mapTypes + Layout.preferredWidth: _comboFieldWidth + fact: _mapType + indexModel: false + visible: _mapType.visible + Connections { + target: QGroundControl.settingsManager.flightMapSettings + onMapTypeChanged: { + mapTypes.model = _mapType.enumStrings } } } - } - - FactCheckBox { - text: qsTr("Mute all audio output") - fact: _audioMuted - visible: _audioMuted.visible - property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted + QGCLabel { + text: qsTr("Stream GCS Position") + visible: _followTarget.visible + } + FactComboBox { + Layout.preferredWidth: _comboFieldWidth + fact: _followTarget + indexModel: false + visible: _followTarget.visible + } } + } - FactCheckBox { - text: qsTr("AutoLoad Missions") - fact: _autoLoad - visible: _autoLoad.visible + Item { + id: miscColItem + anchors.margins: _margins + anchors.left: parent.left + anchors.right: parent.right + anchors.top: comboGridItem.bottom + height: miscCol.height - property Fact _autoLoad: QGroundControl.settingsManager.appSettings.autoLoadMissions - } + ColumnLayout { + id: miscCol + anchors.horizontalCenter: parent.horizontalCenter + spacing: _margins - QGCCheckBox { - id: clearCheck - text: qsTr("Clear all settings on next start") - checked: false - onClicked: { - checked ? clearDialog.visible = true : QGroundControl.clearDeleteAllSettingsNextBoot() - } - MessageDialog { - id: clearDialog - visible: false - icon: StandardIcon.Warning - standardButtons: StandardButton.Yes | StandardButton.No - title: qsTr("Clear Settings") - text: qsTr("All saved settings will be reset the next time you start %1. Is this really what you want?").arg(QGroundControl.appName) - onYes: { - QGroundControl.deleteAllSettingsNextBoot() - clearDialog.visible = false + RowLayout { + Layout.fillWidth: false + Layout.alignment: Qt.AlignHCenter + visible: _appFontPointSize ? _appFontPointSize.visible : false + + QGCLabel { + text: qsTr("Font Size:") + } + QGCButton { + Layout.preferredWidth: height + Layout.preferredHeight: baseFontEdit.height + text: "-" + onClicked: { + if (_appFontPointSize.value > _appFontPointSize.min) { + _appFontPointSize.value = _appFontPointSize.value - 1 + } + } } - onNo: { - clearCheck.checked = false - clearDialog.visible = false + FactTextField { + id: baseFontEdit + Layout.preferredWidth: _valueFieldWidth + fact: QGroundControl.settingsManager.appSettings.appFontPointSize + } + QGCButton { + Layout.preferredWidth: height + Layout.preferredHeight: baseFontEdit.height + text: "+" + onClicked: { + if (_appFontPointSize.value < _appFontPointSize.max) { + _appFontPointSize.value = _appFontPointSize.value + 1 + } + } } } - } - RowLayout { - visible: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible + + FactCheckBox { + text: qsTr("Mute all audio output") + fact: _audioMuted + visible: _audioMuted.visible + property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted + } + + FactCheckBox { + text: qsTr("AutoLoad Missions") + fact: _autoLoad + visible: _autoLoad.visible + + property Fact _autoLoad: QGroundControl.settingsManager.appSettings.autoLoadMissions + } QGCCheckBox { - id: announcePercentCheckbox - text: qsTr("Announce battery lower than") - checked: _percentRemainingAnnounce.value !== 0 + id: clearCheck + text: qsTr("Clear all settings on next start") + checked: false onClicked: { - if (checked) { - _percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString - } else { - _percentRemainingAnnounce.value = 0 + checked ? clearDialog.visible = true : QGroundControl.clearDeleteAllSettingsNextBoot() + } + MessageDialog { + id: clearDialog + visible: false + icon: StandardIcon.Warning + standardButtons: StandardButton.Yes | StandardButton.No + title: qsTr("Clear Settings") + text: qsTr("All saved settings will be reset the next time you start %1. Is this really what you want?").arg(QGroundControl.appName) + onYes: { + QGroundControl.deleteAllSettingsNextBoot() + clearDialog.visible = false + } + onNo: { + clearCheck.checked = false + clearDialog.visible = false } } } - FactTextField { - fact: _percentRemainingAnnounce - Layout.preferredWidth: _valueFieldWidth - enabled: announcePercentCheckbox.checked + + RowLayout { + visible: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible + + QGCCheckBox { + id: announcePercentCheckbox + text: qsTr("Announce battery lower than") + checked: _percentRemainingAnnounce.value !== 0 + onClicked: { + if (checked) { + _percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString + } else { + _percentRemainingAnnounce.value = 0 + } + } + } + FactTextField { + fact: _percentRemainingAnnounce + Layout.preferredWidth: _valueFieldWidth + enabled: announcePercentCheckbox.checked + } } } } - } - //----------------------------------------------------------------- - //-- Save path - RowLayout { - id: pathRow - anchors.margins: _margins - anchors.left: parent.left - anchors.right: parent.right - anchors.top: miscColItem.bottom - visible: _savePath.visible && !ScreenTools.isMobile - - QGCLabel { text: qsTr("Application Load/Save Path") } - QGCTextField { - Layout.fillWidth: true - readOnly: true - text: _savePath.rawValue === "" ? qsTr("") : _savePath.value - } - QGCButton { - text: qsTr("Browse") - onClicked: savePathBrowseDialog.openForLoad() - QGCFileDialog { - id: savePathBrowseDialog - title: qsTr("Choose the location to save/load files") - folder: _savePath.rawValue - selectExisting: true - selectFolder: true - onAcceptedForLoad: _savePath.rawValue = file + //----------------------------------------------------------------- + //-- Save path + RowLayout { + id: pathRow + anchors.margins: _margins + anchors.left: parent.left + anchors.right: parent.right + anchors.top: miscColItem.bottom + visible: _savePath.visible && !ScreenTools.isMobile + + QGCLabel { text: qsTr("Application Load/Save Path") } + QGCTextField { + Layout.fillWidth: true + readOnly: true + text: _savePath.rawValue === "" ? qsTr("") : _savePath.value + } + QGCButton { + text: qsTr("Browse") + onClicked: savePathBrowseDialog.openForLoad() + QGCFileDialog { + id: savePathBrowseDialog + title: qsTr("Choose the location to save/load files") + folder: _savePath.rawValue + selectExisting: true + selectFolder: true + onAcceptedForLoad: _savePath.rawValue = file + } } } } - } - - Item { width: 1; height: _margins } - QGCLabel { - id: loggingSectionLabel - text: qsTr("Data Persistence") - } - Rectangle { - Layout.preferredHeight: dataPersistCol.height + (_margins * 2) - Layout.preferredWidth: dataPersistCol.width + (_margins * 2) - color: qgcPal.windowShade - Layout.fillWidth: true - ColumnLayout { - id: dataPersistCol - anchors.margins: _margins - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - spacing: _margins * 1.5 - FactCheckBox { - id: disableDataPersistence - text: qsTr("Disable all data persistence") - fact: _disableDataPersistence - visible: _disableDataPersistence.visible - property Fact _disableDataPersistence: QGroundControl.settingsManager.appSettings.disableAllPersistence - } - QGCLabel { - text: qsTr("When Data Persistence is disabled, all telemetry logging and map tile caching is disabled and not written to disk.") - wrapMode: Text.WordWrap - font.pointSize: ScreenTools.smallFontPointSize - Layout.maximumWidth: logIfNotArmed.visible ? logIfNotArmed.width : disableDataPersistence.width * 1.5 - } + + Item { width: 1; height: _margins } + QGCLabel { + id: loggingSectionLabel + text: qsTr("Data Persistence") } - } - - Item { width: 1; height: _margins } - QGCLabel { - text: qsTr("Telemetry Logs from Vehicle") - } - Rectangle { - Layout.preferredHeight: loggingCol.height + (_margins * 2) - Layout.preferredWidth: loggingCol.width + (_margins * 2) - color: qgcPal.windowShade - Layout.fillWidth: true - ColumnLayout { - id: loggingCol - anchors.margins: _margins - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - spacing: _margins - FactCheckBox { - id: promptSaveLog - text: qsTr("Save log after each flight") - fact: _telemetrySave - visible: _telemetrySave.visible - enabled: !disableDataPersistence.checked - property Fact _telemetrySave: QGroundControl.settingsManager.appSettings.telemetrySave - } - FactCheckBox { - id: logIfNotArmed - text: qsTr("Save logs even if vehicle was not armed") - fact: _telemetrySaveNotArmed - visible: _telemetrySaveNotArmed.visible - enabled: promptSaveLog.checked && !disableDataPersistence.checked - property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed + Rectangle { + Layout.preferredHeight: dataPersistCol.height + (_margins * 2) + Layout.preferredWidth: dataPersistCol.width + (_margins * 2) + color: qgcPal.windowShade + Layout.fillWidth: true + ColumnLayout { + id: dataPersistCol + anchors.margins: _margins + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + spacing: _margins * 1.5 + FactCheckBox { + id: disableDataPersistence + text: qsTr("Disable all data persistence") + fact: _disableDataPersistence + visible: _disableDataPersistence.visible + property Fact _disableDataPersistence: QGroundControl.settingsManager.appSettings.disableAllPersistence + } + QGCLabel { + text: qsTr("When Data Persistence is disabled, all telemetry logging and map tile caching is disabled and not written to disk.") + wrapMode: Text.WordWrap + font.pointSize: ScreenTools.smallFontPointSize + Layout.maximumWidth: logIfNotArmed.visible ? logIfNotArmed.width : disableDataPersistence.width * 1.5 + } } } - } - - Item { width: 1; height: _margins } - QGCLabel { - id: flyViewSectionLabel - text: qsTr("Fly View") - visible: QGroundControl.settingsManager.flyViewSettings.visible - } - Rectangle { - Layout.preferredHeight: flyViewCol.height + (_margins * 2) - Layout.preferredWidth: flyViewCol.width + (_margins * 2) - color: qgcPal.windowShade - visible: flyViewSectionLabel.visible - Layout.fillWidth: true - - ColumnLayout { - id: flyViewCol - anchors.margins: _margins - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - spacing: _margins - - FactCheckBox { - text: qsTr("Use preflight checklist") - fact: _useChecklist - visible: _useChecklist.visible - - property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist + + Item { width: 1; height: _margins } + QGCLabel { + text: qsTr("Telemetry Logs from Vehicle") + } + Rectangle { + Layout.preferredHeight: loggingCol.height + (_margins * 2) + Layout.preferredWidth: loggingCol.width + (_margins * 2) + color: qgcPal.windowShade + Layout.fillWidth: true + ColumnLayout { + id: loggingCol + anchors.margins: _margins + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + spacing: _margins + FactCheckBox { + id: promptSaveLog + text: qsTr("Save log after each flight") + fact: _telemetrySave + visible: _telemetrySave.visible + enabled: !disableDataPersistence.checked + property Fact _telemetrySave: QGroundControl.settingsManager.appSettings.telemetrySave + } + FactCheckBox { + id: logIfNotArmed + text: qsTr("Save logs even if vehicle was not armed") + fact: _telemetrySaveNotArmed + visible: _telemetrySaveNotArmed.visible + enabled: promptSaveLog.checked && !disableDataPersistence.checked + property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed + } } + } - FactCheckBox { - text: qsTr("Virtual Joystick") - visible: _virtualJoystick.visible - fact: _virtualJoystick + Item { width: 1; height: _margins } + QGCLabel { + id: flyViewSectionLabel + text: qsTr("Fly View") + visible: QGroundControl.settingsManager.flyViewSettings.visible + } + Rectangle { + Layout.preferredHeight: flyViewCol.height + (_margins * 2) + Layout.preferredWidth: flyViewCol.width + (_margins * 2) + color: qgcPal.windowShade + visible: flyViewSectionLabel.visible + Layout.fillWidth: true - property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick - } + ColumnLayout { + id: flyViewCol + anchors.margins: _margins + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + spacing: _margins - GridLayout { - columns: 2 + FactCheckBox { + text: qsTr("Use preflight checklist") + fact: _useChecklist + visible: _useChecklist.visible - QGCLabel { text: qsTr("Guided Minimum Altitude") } - FactTextField { - Layout.preferredWidth: _valueFieldWidth - fact: QGroundControl.settingsManager.flyViewSettings.guidedMinimumAltitude + property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist } - QGCLabel { text: qsTr("Guided Maximum Altitude") } - FactTextField { - Layout.preferredWidth: _valueFieldWidth - fact: QGroundControl.settingsManager.flyViewSettings.guidedMaximumAltitude + FactCheckBox { + text: qsTr("Virtual Joystick") + visible: _virtualJoystick.visible + fact: _virtualJoystick + + property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick } - } - } - } - - Item { width: 1; height: _margins } - - QGCLabel { - id: planViewSectionLabel - text: qsTr("Plan View") - visible: QGroundControl.settingsManager.planViewSettings.visible - } - Rectangle { - Layout.preferredHeight: planViewCol.height + (_margins * 2) - Layout.preferredWidth: planViewCol.width + (_margins * 2) - color: qgcPal.windowShade - visible: planViewSectionLabel.visible - Layout.fillWidth: true - - ColumnLayout { - id: planViewCol - anchors.margins: _margins - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - spacing: _margins - RowLayout { - spacing: ScreenTools.defaultFontPixelWidth - visible: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude.visible + FactCheckBox { + text: qsTr("Auto-Center throttle") + visible: _virtualJoystickCentralized.visible && activeVehicle && (activeVehicle.sub || activeVehicle.rover) + fact: _virtualJoystickCentralized + Layout.leftMargin: _margins - QGCLabel { text: qsTr("Default Mission Altitude") } - FactTextField { - Layout.preferredWidth: _valueFieldWidth - fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude + property Fact _virtualJoystickCentralized: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized + } + + GridLayout { + columns: 2 + + QGCLabel { text: qsTr("Guided Minimum Altitude") } + FactTextField { + Layout.preferredWidth: _valueFieldWidth + fact: QGroundControl.settingsManager.flyViewSettings.guidedMinimumAltitude + } + + QGCLabel { text: qsTr("Guided Maximum Altitude") } + FactTextField { + Layout.preferredWidth: _valueFieldWidth + fact: QGroundControl.settingsManager.flyViewSettings.guidedMaximumAltitude + } } } } - } - - Item { width: 1; height: _margins } - - QGCLabel { - id: autoConnectSectionLabel - text: qsTr("AutoConnect to the following devices") - visible: QGroundControl.settingsManager.autoConnectSettings.visible - } - Rectangle { - Layout.preferredWidth: autoConnectCol.width + (_margins * 2) - Layout.preferredHeight: autoConnectCol.height + (_margins * 2) - color: qgcPal.windowShade - visible: autoConnectSectionLabel.visible - Layout.fillWidth: true - - ColumnLayout { - id: autoConnectCol - anchors.margins: _margins - anchors.left: parent.left - anchors.top: parent.top - spacing: _margins - RowLayout { - spacing: _margins + Item { width: 1; height: _margins } - Repeater { - id: autoConnectRepeater - model: [ QGroundControl.settingsManager.autoConnectSettings.autoConnectPixhawk, - QGroundControl.settingsManager.autoConnectSettings.autoConnectSiKRadio, - QGroundControl.settingsManager.autoConnectSettings.autoConnectPX4Flow, - QGroundControl.settingsManager.autoConnectSettings.autoConnectLibrePilot, - QGroundControl.settingsManager.autoConnectSettings.autoConnectUDP, - QGroundControl.settingsManager.autoConnectSettings.autoConnectRTKGPS - ] + QGCLabel { + id: planViewSectionLabel + text: qsTr("Plan View") + visible: QGroundControl.settingsManager.planViewSettings.visible + } + Rectangle { + Layout.preferredHeight: planViewCol.height + (_margins * 2) + Layout.preferredWidth: planViewCol.width + (_margins * 2) + color: qgcPal.windowShade + visible: planViewSectionLabel.visible + Layout.fillWidth: true - property var names: [ qsTr("Pixhawk"), qsTr("SiK Radio"), qsTr("PX4 Flow"), qsTr("LibrePilot"), qsTr("UDP"), qsTr("RTK GPS") ] + ColumnLayout { + id: planViewCol + anchors.margins: _margins + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + spacing: _margins - FactCheckBox { - text: autoConnectRepeater.names[index] - fact: modelData - visible: modelData.visible + RowLayout { + spacing: ScreenTools.defaultFontPixelWidth + visible: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude.visible + + QGCLabel { text: qsTr("Default Mission Altitude") } + FactTextField { + Layout.preferredWidth: _valueFieldWidth + fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude } } } + } - GridLayout { - Layout.fillWidth: false - Layout.alignment: Qt.AlignHCenter - columns: 2 - visible: !ScreenTools.isMobile - && QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.visible - && QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.visible + Item { width: 1; height: _margins } - QGCLabel { - text: qsTr("NMEA GPS Device") + QGCLabel { + id: autoConnectSectionLabel + text: qsTr("AutoConnect to the following devices") + visible: QGroundControl.settingsManager.autoConnectSettings.visible + } + Rectangle { + Layout.preferredWidth: autoConnectCol.width + (_margins * 2) + Layout.preferredHeight: autoConnectCol.height + (_margins * 2) + color: qgcPal.windowShade + visible: autoConnectSectionLabel.visible + Layout.fillWidth: true + + ColumnLayout { + id: autoConnectCol + anchors.margins: _margins + anchors.left: parent.left + anchors.top: parent.top + spacing: _margins + + RowLayout { + spacing: _margins + + Repeater { + id: autoConnectRepeater + model: [ QGroundControl.settingsManager.autoConnectSettings.autoConnectPixhawk, + QGroundControl.settingsManager.autoConnectSettings.autoConnectSiKRadio, + QGroundControl.settingsManager.autoConnectSettings.autoConnectPX4Flow, + QGroundControl.settingsManager.autoConnectSettings.autoConnectLibrePilot, + QGroundControl.settingsManager.autoConnectSettings.autoConnectUDP, + QGroundControl.settingsManager.autoConnectSettings.autoConnectRTKGPS + ] + + property var names: [ qsTr("Pixhawk"), qsTr("SiK Radio"), qsTr("PX4 Flow"), qsTr("LibrePilot"), qsTr("UDP"), qsTr("RTK GPS") ] + + FactCheckBox { + text: autoConnectRepeater.names[index] + fact: modelData + visible: modelData.visible + } + } } - QGCComboBox { - id: nmeaPortCombo - Layout.preferredWidth: _comboFieldWidth - model: ListModel { + GridLayout { + Layout.fillWidth: false + Layout.alignment: Qt.AlignHCenter + columns: 2 + visible: !ScreenTools.isMobile + && QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.visible + && QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.visible + + QGCLabel { + text: qsTr("NMEA GPS Device") } + QGCComboBox { + id: nmeaPortCombo + Layout.preferredWidth: _comboFieldWidth - onActivated: { - if (index != -1) { - QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.value = textAt(index); + model: ListModel { + } + + onActivated: { + if (index != -1) { + QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.value = textAt(index); + } + } + Component.onCompleted: { + model.append({text: gpsDisabled}) + model.append({text: gpsUdpPort}) + + for (var i in QGroundControl.linkManager.serialPorts) { + nmeaPortCombo.model.append({text:QGroundControl.linkManager.serialPorts[i]}) + } + var index = nmeaPortCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.valueString); + nmeaPortCombo.currentIndex = index; + if (QGroundControl.linkManager.serialPorts.length === 0) { + nmeaPortCombo.model.append({text: "Serial "}) + } } } - Component.onCompleted: { - model.append({text: gpsDisabled}) - model.append({text: gpsUdpPort}) - for (var i in QGroundControl.linkManager.serialPorts) { - nmeaPortCombo.model.append({text:QGroundControl.linkManager.serialPorts[i]}) + QGCLabel { + visible: nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled + text: qsTr("NMEA GPS Baudrate") + } + QGCComboBox { + visible: nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled + id: nmeaBaudCombo + Layout.preferredWidth: _comboFieldWidth + model: [4800, 9600, 19200, 38400, 57600, 115200] + + onActivated: { + if (index != -1) { + QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.value = textAt(index); + } } - var index = nmeaPortCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.valueString); - nmeaPortCombo.currentIndex = index; - if (QGroundControl.linkManager.serialPorts.length === 0) { - nmeaPortCombo.model.append({text: "Serial "}) + Component.onCompleted: { + var index = nmeaBaudCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.valueString); + nmeaBaudCombo.currentIndex = index; } } + + QGCLabel { + text: qsTr("NMEA stream UDP port") + visible: nmeaPortCombo.currentText === gpsUdpPort + } + FactTextField { + visible: nmeaPortCombo.currentText === gpsUdpPort + Layout.preferredWidth: _valueFieldWidth + fact: QGroundControl.settingsManager.autoConnectSettings.nmeaUdpPort + } } + } + } - QGCLabel { - visible: nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled - text: qsTr("NMEA GPS Baudrate") + Item { width: 1; height: _margins } + + QGCLabel { + id: rtkSectionLabel + text: qsTr("RTK GPS") + visible: QGroundControl.settingsManager.rtkSettings.visible + } + Rectangle { + Layout.preferredHeight: rtkGrid.height + (_margins * 2) + Layout.preferredWidth: rtkGrid.width + (_margins * 2) + color: qgcPal.windowShade + visible: rtkSectionLabel.visible + Layout.fillWidth: true + + GridLayout { + id: rtkGrid + anchors.topMargin: _margins + anchors.top: parent.top + Layout.fillWidth: true + anchors.horizontalCenter: parent.horizontalCenter + columns: 3 + + property var rtkSettings: QGroundControl.settingsManager.rtkSettings + property bool useFixedPosition: rtkSettings.useFixedBasePosition.rawValue + property real firstColWidth: ScreenTools.defaultFontPixelWidth * 3 + + QGCRadioButton { + text: qsTr("Perform Survey-In") + visible: rtkGrid.rtkSettings.useFixedBasePosition.visible + checked: rtkGrid.rtkSettings.useFixedBasePosition.value === false + onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = false + Layout.columnSpan: 3 } - QGCComboBox { - visible: nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled - id: nmeaBaudCombo - Layout.preferredWidth: _comboFieldWidth - model: [4800, 9600, 19200, 38400, 57600, 115200] - onActivated: { - if (index != -1) { - QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.value = textAt(index); - } - } - Component.onCompleted: { - var index = nmeaBaudCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.valueString); - nmeaBaudCombo.currentIndex = index; - } + Item { width: rtkGrid.firstColWidth; height: 1 } + QGCLabel { + text: rtkGrid.rtkSettings.surveyInAccuracyLimit.shortDescription + visible: rtkGrid.rtkSettings.surveyInAccuracyLimit.visible + enabled: !rtkGrid.useFixedPosition + } + FactTextField { + fact: rtkGrid.rtkSettings.surveyInAccuracyLimit + visible: rtkGrid.rtkSettings.surveyInAccuracyLimit.visible + enabled: !rtkGrid.useFixedPosition + Layout.preferredWidth: _valueFieldWidth } + Item { width: rtkGrid.firstColWidth; height: 1 } QGCLabel { - text: qsTr("NMEA stream UDP port") - visible: nmeaPortCombo.currentText === gpsUdpPort + text: rtkGrid.rtkSettings.surveyInMinObservationDuration.shortDescription + visible: rtkGrid.rtkSettings.surveyInMinObservationDuration.visible + enabled: !rtkGrid.useFixedPosition } FactTextField { - visible: nmeaPortCombo.currentText === gpsUdpPort + fact: rtkGrid.rtkSettings.surveyInMinObservationDuration + visible: rtkGrid.rtkSettings.surveyInMinObservationDuration.visible + enabled: !rtkGrid.useFixedPosition Layout.preferredWidth: _valueFieldWidth - fact: QGroundControl.settingsManager.autoConnectSettings.nmeaUdpPort } - } - } - } - - Item { width: 1; height: _margins } - - QGCLabel { - id: rtkSectionLabel - text: qsTr("RTK GPS") - visible: QGroundControl.settingsManager.rtkSettings.visible - } - Rectangle { - Layout.preferredHeight: rtkGrid.height + (_margins * 2) - Layout.preferredWidth: rtkGrid.width + (_margins * 2) - color: qgcPal.windowShade - visible: rtkSectionLabel.visible - Layout.fillWidth: true - - GridLayout { - id: rtkGrid - anchors.topMargin: _margins - anchors.top: parent.top - Layout.fillWidth: true - anchors.horizontalCenter: parent.horizontalCenter - columns: 3 - - property var rtkSettings: QGroundControl.settingsManager.rtkSettings - property bool useFixedPosition: rtkSettings.useFixedBasePosition.rawValue - property real firstColWidth: ScreenTools.defaultFontPixelWidth * 3 - - QGCRadioButton { - text: qsTr("Perform Survey-In") - visible: rtkGrid.rtkSettings.useFixedBasePosition.visible - checked: rtkGrid.rtkSettings.useFixedBasePosition.value === false - onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = false - Layout.columnSpan: 3 - } - Item { width: rtkGrid.firstColWidth; height: 1 } - QGCLabel { - text: rtkGrid.rtkSettings.surveyInAccuracyLimit.shortDescription - visible: rtkGrid.rtkSettings.surveyInAccuracyLimit.visible - enabled: !rtkGrid.useFixedPosition - } - FactTextField { - fact: rtkGrid.rtkSettings.surveyInAccuracyLimit - visible: rtkGrid.rtkSettings.surveyInAccuracyLimit.visible - enabled: !rtkGrid.useFixedPosition - Layout.preferredWidth: _valueFieldWidth - } + QGCRadioButton { + text: qsTr("Use Specified Base Position") + visible: rtkGrid.rtkSettings.useFixedBasePosition.visible + checked: rtkGrid.rtkSettings.useFixedBasePosition.value === true + onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = true + Layout.columnSpan: 3 + } - Item { width: rtkGrid.firstColWidth; height: 1 } - QGCLabel { - text: rtkGrid.rtkSettings.surveyInMinObservationDuration.shortDescription - visible: rtkGrid.rtkSettings.surveyInMinObservationDuration.visible - enabled: !rtkGrid.useFixedPosition - } - FactTextField { - fact: rtkGrid.rtkSettings.surveyInMinObservationDuration - visible: rtkGrid.rtkSettings.surveyInMinObservationDuration.visible - enabled: !rtkGrid.useFixedPosition - Layout.preferredWidth: _valueFieldWidth - } + Item { width: rtkGrid.firstColWidth; height: 1 } + QGCLabel { + text: rtkGrid.rtkSettings.fixedBasePositionLatitude.shortDescription + visible: rtkGrid.rtkSettings.fixedBasePositionLatitude.visible + enabled: rtkGrid.useFixedPosition + } + FactTextField { + fact: rtkGrid.rtkSettings.fixedBasePositionLatitude + visible: rtkGrid.rtkSettings.fixedBasePositionLatitude.visible + enabled: rtkGrid.useFixedPosition + Layout.fillWidth: true + } - QGCRadioButton { - text: qsTr("Use Specified Base Position") - visible: rtkGrid.rtkSettings.useFixedBasePosition.visible - checked: rtkGrid.rtkSettings.useFixedBasePosition.value === true - onClicked: rtkGrid.rtkSettings.useFixedBasePosition.value = true - Layout.columnSpan: 3 - } + Item { width: rtkGrid.firstColWidth; height: 1 } + QGCLabel { + text: rtkGrid.rtkSettings.fixedBasePositionLongitude.shortDescription + visible: rtkGrid.rtkSettings.fixedBasePositionLongitude.visible + enabled: rtkGrid.useFixedPosition + } + FactTextField { + fact: rtkGrid.rtkSettings.fixedBasePositionLongitude + visible: rtkGrid.rtkSettings.fixedBasePositionLongitude.visible + enabled: rtkGrid.useFixedPosition + Layout.fillWidth: true + } - Item { width: rtkGrid.firstColWidth; height: 1 } - QGCLabel { - text: rtkGrid.rtkSettings.fixedBasePositionLatitude.shortDescription - visible: rtkGrid.rtkSettings.fixedBasePositionLatitude.visible - enabled: rtkGrid.useFixedPosition - } - FactTextField { - fact: rtkGrid.rtkSettings.fixedBasePositionLatitude - visible: rtkGrid.rtkSettings.fixedBasePositionLatitude.visible - enabled: rtkGrid.useFixedPosition - Layout.fillWidth: true - } + Item { width: rtkGrid.firstColWidth; height: 1 } + QGCLabel { + text: rtkGrid.rtkSettings.fixedBasePositionAltitude.shortDescription + visible: rtkGrid.rtkSettings.fixedBasePositionAltitude.visible + enabled: rtkGrid.useFixedPosition + } + FactTextField { + fact: rtkGrid.rtkSettings.fixedBasePositionAltitude + visible: rtkGrid.rtkSettings.fixedBasePositionAltitude.visible + enabled: rtkGrid.useFixedPosition + Layout.fillWidth: true + } - Item { width: rtkGrid.firstColWidth; height: 1 } - QGCLabel { - text: rtkGrid.rtkSettings.fixedBasePositionLongitude.shortDescription - visible: rtkGrid.rtkSettings.fixedBasePositionLongitude.visible - enabled: rtkGrid.useFixedPosition - } - FactTextField { - fact: rtkGrid.rtkSettings.fixedBasePositionLongitude - visible: rtkGrid.rtkSettings.fixedBasePositionLongitude.visible - enabled: rtkGrid.useFixedPosition - Layout.fillWidth: true - } + Item { width: rtkGrid.firstColWidth; height: 1 } + QGCLabel { + text: rtkGrid.rtkSettings.fixedBasePositionAccuracy.shortDescription + visible: rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible + enabled: rtkGrid.useFixedPosition + } + FactTextField { + fact: rtkGrid.rtkSettings.fixedBasePositionAccuracy + visible: rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible + enabled: rtkGrid.useFixedPosition + Layout.fillWidth: true + } - Item { width: rtkGrid.firstColWidth; height: 1 } - QGCLabel { - text: rtkGrid.rtkSettings.fixedBasePositionAltitude.shortDescription - visible: rtkGrid.rtkSettings.fixedBasePositionAltitude.visible - enabled: rtkGrid.useFixedPosition - } - FactTextField { - fact: rtkGrid.rtkSettings.fixedBasePositionAltitude - visible: rtkGrid.rtkSettings.fixedBasePositionAltitude.visible - enabled: rtkGrid.useFixedPosition - Layout.fillWidth: true - } + Item { width: rtkGrid.firstColWidth; height: 1 } + QGCButton { + text: qsTr("Save Current Base Position") + enabled: QGroundControl.gpsRtk && QGroundControl.gpsRtk.valid.value + Layout.columnSpan: 2 - Item { width: rtkGrid.firstColWidth; height: 1 } - QGCLabel { - text: rtkGrid.rtkSettings.fixedBasePositionAccuracy.shortDescription - visible: rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible - enabled: rtkGrid.useFixedPosition - } - FactTextField { - fact: rtkGrid.rtkSettings.fixedBasePositionAccuracy - visible: rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible - enabled: rtkGrid.useFixedPosition - Layout.fillWidth: true + onClicked: { + rtkGrid.rtkSettings.fixedBasePositionLatitude.rawValue = QGroundControl.gpsRtk.currentLatitude.rawValue + rtkGrid.rtkSettings.fixedBasePositionLongitude.rawValue = QGroundControl.gpsRtk.currentLongitude.rawValue + rtkGrid.rtkSettings.fixedBasePositionAltitude.rawValue = QGroundControl.gpsRtk.currentAltitude.rawValue + rtkGrid.rtkSettings.fixedBasePositionAccuracy.rawValue = QGroundControl.gpsRtk.currentAccuracy.rawValue + } + } } + } - Item { width: rtkGrid.firstColWidth; height: 1 } - QGCButton { - text: qsTr("Save Current Base Position") - enabled: QGroundControl.gpsRtk && QGroundControl.gpsRtk.valid.value - Layout.columnSpan: 2 + Item { width: 1; height: _margins } - onClicked: { - rtkGrid.rtkSettings.fixedBasePositionLatitude.rawValue = QGroundControl.gpsRtk.currentLatitude.rawValue - rtkGrid.rtkSettings.fixedBasePositionLongitude.rawValue = QGroundControl.gpsRtk.currentLongitude.rawValue - rtkGrid.rtkSettings.fixedBasePositionAltitude.rawValue = QGroundControl.gpsRtk.currentAltitude.rawValue - rtkGrid.rtkSettings.fixedBasePositionAccuracy.rawValue = QGroundControl.gpsRtk.currentAccuracy.rawValue + QGCLabel { + id: videoSectionLabel + text: qsTr("Video") + visible: QGroundControl.settingsManager.videoSettings.visible && !QGroundControl.videoManager.autoStreamConfigured + } + Rectangle { + Layout.preferredWidth: videoGrid.width + (_margins * 2) + Layout.preferredHeight: videoGrid.height + (_margins * 2) + Layout.fillWidth: true + color: qgcPal.windowShade + visible: videoSectionLabel.visible + + GridLayout { + id: videoGrid + anchors.margins: _margins + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + Layout.fillWidth: false + Layout.fillHeight: false + columns: 2 + QGCLabel { + text: qsTr("Video Source") + visible: QGroundControl.settingsManager.videoSettings.videoSource.visible + } + FactComboBox { + id: videoSource + Layout.preferredWidth: _comboFieldWidth + indexModel: false + fact: QGroundControl.settingsManager.videoSettings.videoSource + visible: QGroundControl.settingsManager.videoSettings.videoSource.visible + } + + QGCLabel { + text: qsTr("UDP Port") + visible: (_isUDP || _isMPEGTS) && QGroundControl.settingsManager.videoSettings.udpPort.visible + } + FactTextField { + Layout.preferredWidth: _comboFieldWidth + fact: QGroundControl.settingsManager.videoSettings.udpPort + visible: (_isUDP || _isMPEGTS) && QGroundControl.settingsManager.videoSettings.udpPort.visible + } + + QGCLabel { + text: qsTr("RTSP URL") + visible: _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible + } + FactTextField { + Layout.preferredWidth: _comboFieldWidth + fact: QGroundControl.settingsManager.videoSettings.rtspUrl + visible: _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible + } + + QGCLabel { + text: qsTr("TCP URL") + visible: _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible + } + FactTextField { + Layout.preferredWidth: _comboFieldWidth + fact: QGroundControl.settingsManager.videoSettings.tcpUrl + visible: _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible + } + QGCLabel { + text: qsTr("Aspect Ratio") + visible: _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible + } + FactTextField { + Layout.preferredWidth: _comboFieldWidth + fact: QGroundControl.settingsManager.videoSettings.aspectRatio + visible: _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible + } + + QGCLabel { + text: qsTr("Disable When Disarmed") + visible: _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible + } + FactCheckBox { + text: "" + fact: QGroundControl.settingsManager.videoSettings.disableWhenDisarmed + visible: _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible } } } - } - - Item { width: 1; height: _margins } - - QGCLabel { - id: videoSectionLabel - text: qsTr("Video") - visible: QGroundControl.settingsManager.videoSettings.visible && !QGroundControl.videoManager.autoStreamConfigured - } - Rectangle { - Layout.preferredWidth: videoGrid.width + (_margins * 2) - Layout.preferredHeight: videoGrid.height + (_margins * 2) - Layout.fillWidth: true - color: qgcPal.windowShade - visible: videoSectionLabel.visible - - GridLayout { - id: videoGrid - anchors.margins: _margins - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - Layout.fillWidth: false - Layout.fillHeight: false - columns: 2 - QGCLabel { - text: qsTr("Video Source") - visible: QGroundControl.settingsManager.videoSettings.videoSource.visible - } - FactComboBox { - id: videoSource - Layout.preferredWidth: _comboFieldWidth - indexModel: false - fact: QGroundControl.settingsManager.videoSettings.videoSource - visible: QGroundControl.settingsManager.videoSettings.videoSource.visible - } - QGCLabel { - text: qsTr("UDP Port") - visible: (_isUDP || _isMPEGTS) && QGroundControl.settingsManager.videoSettings.udpPort.visible - } - FactTextField { - Layout.preferredWidth: _comboFieldWidth - fact: QGroundControl.settingsManager.videoSettings.udpPort - visible: (_isUDP || _isMPEGTS) && QGroundControl.settingsManager.videoSettings.udpPort.visible - } + Item { width: 1; height: _margins } - QGCLabel { - text: qsTr("RTSP URL") - visible: _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible - } - FactTextField { - Layout.preferredWidth: _comboFieldWidth - fact: QGroundControl.settingsManager.videoSettings.rtspUrl - visible: _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible - } + QGCLabel { + id: videoRecSectionLabel + text: qsTr("Video Recording") + visible: (QGroundControl.settingsManager.videoSettings.visible && _isGst) || QGroundControl.videoManager.autoStreamConfigured + } + Rectangle { + Layout.preferredWidth: videoRecCol.width + (_margins * 2) + Layout.preferredHeight: videoRecCol.height + (_margins * 2) + Layout.fillWidth: true + color: qgcPal.windowShade + visible: videoRecSectionLabel.visible - QGCLabel { - text: qsTr("TCP URL") - visible: _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible - } - FactTextField { - Layout.preferredWidth: _comboFieldWidth - fact: QGroundControl.settingsManager.videoSettings.tcpUrl - visible: _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible - } - QGCLabel { - text: qsTr("Aspect Ratio") - visible: _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible - } - FactTextField { - Layout.preferredWidth: _comboFieldWidth - fact: QGroundControl.settingsManager.videoSettings.aspectRatio - visible: _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible - } + GridLayout { + id: videoRecCol + anchors.margins: _margins + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + Layout.fillWidth: false + columns: 2 - QGCLabel { - text: qsTr("Disable When Disarmed") - visible: _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible - } - FactCheckBox { - text: "" - fact: QGroundControl.settingsManager.videoSettings.disableWhenDisarmed - visible: _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible + QGCLabel { + text: qsTr("Auto-Delete Files") + visible: QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible + } + FactCheckBox { + text: "" + fact: QGroundControl.settingsManager.videoSettings.enableStorageLimit + visible: QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible + } + + QGCLabel { + text: qsTr("Max Storage Usage") + visible: QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value + } + FactTextField { + Layout.preferredWidth: _comboFieldWidth + fact: QGroundControl.settingsManager.videoSettings.maxVideoSize + visible: QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value + } + + QGCLabel { + text: qsTr("Video File Format") + visible: QGroundControl.settingsManager.videoSettings.recordingFormat.visible + } + FactComboBox { + Layout.preferredWidth: _comboFieldWidth + fact: QGroundControl.settingsManager.videoSettings.recordingFormat + visible: QGroundControl.settingsManager.videoSettings.recordingFormat.visible + } } } - } - - Item { width: 1; height: _margins } - - QGCLabel { - id: videoRecSectionLabel - text: qsTr("Video Recording") - visible: (QGroundControl.settingsManager.videoSettings.visible && _isGst) || QGroundControl.videoManager.autoStreamConfigured - } - Rectangle { - Layout.preferredWidth: videoRecCol.width + (_margins * 2) - Layout.preferredHeight: videoRecCol.height + (_margins * 2) - Layout.fillWidth: true - color: qgcPal.windowShade - visible: videoRecSectionLabel.visible - - GridLayout { - id: videoRecCol - anchors.margins: _margins - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - Layout.fillWidth: false - columns: 2 - - QGCLabel { - text: qsTr("Auto-Delete Files") - visible: QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible - } - FactCheckBox { - text: "" - fact: QGroundControl.settingsManager.videoSettings.enableStorageLimit - visible: QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible - } - QGCLabel { - text: qsTr("Max Storage Usage") - visible: QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value - } - FactTextField { - Layout.preferredWidth: _comboFieldWidth - fact: QGroundControl.settingsManager.videoSettings.maxVideoSize - visible: QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value - } + Item { width: 1; height: _margins; visible: videoRecSectionLabel.visible } - QGCLabel { - text: qsTr("Video File Format") - visible: QGroundControl.settingsManager.videoSettings.recordingFormat.visible - } - FactComboBox { - Layout.preferredWidth: _comboFieldWidth - fact: QGroundControl.settingsManager.videoSettings.recordingFormat - visible: QGroundControl.settingsManager.videoSettings.recordingFormat.visible - } + QGCLabel { + id: brandImageSectionLabel + text: qsTr("Brand Image") + visible: QGroundControl.settingsManager.brandImageSettings.visible && !ScreenTools.isMobile } - } - - Item { width: 1; height: _margins; visible: videoRecSectionLabel.visible } - - QGCLabel { - id: brandImageSectionLabel - text: qsTr("Brand Image") - visible: QGroundControl.settingsManager.brandImageSettings.visible && !ScreenTools.isMobile - } - Rectangle { - Layout.preferredWidth: brandImageGrid.width + (_margins * 2) - Layout.preferredHeight: brandImageGrid.height + (_margins * 2) - Layout.fillWidth: true - color: qgcPal.windowShade - visible: brandImageSectionLabel.visible - - GridLayout { - id: brandImageGrid - anchors.margins: _margins - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - columns: 3 - - QGCLabel { - text: qsTr("Indoor Image") - visible: _userBrandImageIndoor.visible - } - QGCTextField { - readOnly: true - Layout.fillWidth: true - text: _userBrandImageIndoor.valueString.replace("file:///","") - } - QGCButton { - text: qsTr("Browse") - onClicked: userBrandImageIndoorBrowseDialog.openForLoad() - QGCFileDialog { - id: userBrandImageIndoorBrowseDialog - title: qsTr("Choose custom brand image file") - folder: _userBrandImageIndoor.rawValue.replace("file:///","") - selectExisting: true - selectFolder: false - onAcceptedForLoad: _userBrandImageIndoor.rawValue = "file:///" + file + Rectangle { + Layout.preferredWidth: brandImageGrid.width + (_margins * 2) + Layout.preferredHeight: brandImageGrid.height + (_margins * 2) + Layout.fillWidth: true + color: qgcPal.windowShade + visible: brandImageSectionLabel.visible + + GridLayout { + id: brandImageGrid + anchors.margins: _margins + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + columns: 3 + + QGCLabel { + text: qsTr("Indoor Image") + visible: _userBrandImageIndoor.visible + } + QGCTextField { + readOnly: true + Layout.fillWidth: true + text: _userBrandImageIndoor.valueString.replace("file:///","") + } + QGCButton { + text: qsTr("Browse") + onClicked: userBrandImageIndoorBrowseDialog.openForLoad() + QGCFileDialog { + id: userBrandImageIndoorBrowseDialog + title: qsTr("Choose custom brand image file") + folder: _userBrandImageIndoor.rawValue.replace("file:///","") + selectExisting: true + selectFolder: false + onAcceptedForLoad: _userBrandImageIndoor.rawValue = "file:///" + file + } } - } - QGCLabel { - text: qsTr("Outdoor Image") - visible: _userBrandImageOutdoor.visible - } - QGCTextField { - readOnly: true - Layout.fillWidth: true - text: _userBrandImageOutdoor.valueString.replace("file:///","") - } - QGCButton { - text: qsTr("Browse") - onClicked: userBrandImageOutdoorBrowseDialog.openForLoad() - QGCFileDialog { - id: userBrandImageOutdoorBrowseDialog - title: qsTr("Choose custom brand image file") - folder: _userBrandImageOutdoor.rawValue.replace("file:///","") - selectExisting: true - selectFolder: false - onAcceptedForLoad: _userBrandImageOutdoor.rawValue = "file:///" + file + QGCLabel { + text: qsTr("Outdoor Image") + visible: _userBrandImageOutdoor.visible } - } - QGCButton { - text: qsTr("Reset Default Brand Image") - Layout.columnSpan: 3 - Layout.alignment: Qt.AlignHCenter - onClicked: { - _userBrandImageIndoor.rawValue = "" - _userBrandImageOutdoor.rawValue = "" + QGCTextField { + readOnly: true + Layout.fillWidth: true + text: _userBrandImageOutdoor.valueString.replace("file:///","") + } + QGCButton { + text: qsTr("Browse") + onClicked: userBrandImageOutdoorBrowseDialog.openForLoad() + QGCFileDialog { + id: userBrandImageOutdoorBrowseDialog + title: qsTr("Choose custom brand image file") + folder: _userBrandImageOutdoor.rawValue.replace("file:///","") + selectExisting: true + selectFolder: false + onAcceptedForLoad: _userBrandImageOutdoor.rawValue = "file:///" + file + } + } + QGCButton { + text: qsTr("Reset Default Brand Image") + Layout.columnSpan: 3 + Layout.alignment: Qt.AlignHCenter + onClicked: { + _userBrandImageIndoor.rawValue = "" + _userBrandImageOutdoor.rawValue = "" + } } } } - } - - Item { width: 1; height: _margins } - - QGCLabel { - text: qsTr("%1 Version").arg(QGroundControl.appName) - Layout.alignment: Qt.AlignHCenter - } - QGCLabel { - text: QGroundControl.qgcVersion - Layout.alignment: Qt.AlignHCenter - } - } // settingsColumn - } + + Item { width: 1; height: _margins } + + QGCLabel { + text: qsTr("%1 Version").arg(QGroundControl.appName) + Layout.alignment: Qt.AlignHCenter + } + QGCLabel { + text: QGroundControl.qgcVersion + Layout.alignment: Qt.AlignHCenter + } + } // settingsColumn + } } }