Newer
Older
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtMultimedia 5.5
import QtQuick.Layouts 1.2
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.MultiVehicleManager 1.0
import QGroundControl.Palette 1.0
import QGroundControl.SettingsManager 1.0
id: _qgcView
viewPanel: panel
anchors.fill: parent
anchors.margins: ScreenTools.defaultFontPixelWidth
property Fact _percentRemainingAnnounce: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce
property Fact _savePath: QGroundControl.settingsManager.appSettings.savePath
property Fact _appFontPointSize: QGroundControl.settingsManager.appSettings.appFontPointSize
property Fact _userBrandImageIndoor: QGroundControl.settingsManager.brandImageSettings.userBrandImageIndoor
property Fact _userBrandImageOutdoor: QGroundControl.settingsManager.brandImageSettings.userBrandImageOutdoor
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 20
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30
property Fact _mapProvider: QGroundControl.settingsManager.flightMapSettings.mapProvider
property Fact _mapType: QGroundControl.settingsManager.flightMapSettings.mapType
property Fact _followTarget: QGroundControl.settingsManager.appSettings.followTarget
property real _panelWidth: _qgcView.width * _internalWidthRatio
readonly property real _internalWidthRatio: 0.8
readonly property string _requiresRestart: qsTr("(Requires Restart)")
QGCViewPanel {
id: panel
anchors.fill: parent
QGCFlickable {
clip: true
anchors.fill: parent
contentHeight: settingsColumn.height
contentWidth: settingsColumn.width
Column {
id: settingsColumn
width: _qgcView.width
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.margins: ScreenTools.defaultFontPixelWidth
//-----------------------------------------------------------------
height: unitLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.unitsSettings.visible
id: unitLabel
text: qsTr("Units (Requires Restart)")
font.family: ScreenTools.demiboldFontFamily
height: unitsCol.height + (ScreenTools.defaultFontPixelHeight * 2)
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.unitsSettings.visible
Column {
id: unitsCol
spacing: ScreenTools.defaultFontPixelWidth
anchors.centerIn: parent
model: [ QGroundControl.settingsManager.unitsSettings.distanceUnits, QGroundControl.settingsManager.unitsSettings.areaUnits, QGroundControl.settingsManager.unitsSettings.speedUnits, QGroundControl.settingsManager.unitsSettings.temperatureUnits ]
property var names: [ qsTr("Distance:"), qsTr("Area:"), qsTr("Speed:"), qsTr("Temperature:") ]
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: modelData.visible
QGCLabel {
width: _labelWidth
anchors.baseline: factCombo.baseline
text: unitsRepeater.names[index]
}
FactComboBox {
id: factCombo
width: _editFieldWidth
fact: modelData
indexModel: false
}
//-----------------------------------------------------------------
height: miscLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.appSettings.visible
text: qsTr("Miscellaneous")
font.family: ScreenTools.demiboldFontFamily
height: miscCol.height + (ScreenTools.defaultFontPixelHeight * 2)
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.appSettings.visible
Column {
id: miscCol
spacing: ScreenTools.defaultFontPixelWidth
anchors.centerIn: parent
//-----------------------------------------------------------------
//-- Base UI Font Point Size
Row {
visible: _appFontPointSize ? _appFontPointSize.visible : false
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel {
id: baseFontLabel
anchors.verticalCenter: parent.verticalCenter
}
Row {
id: baseFontRow
spacing: ScreenTools.defaultFontPixelWidth / 2
anchors.verticalCenter: parent.verticalCenter
QGCButton {
id: decrementButton
width: height
height: baseFontEdit.height
text: "-"
onClicked: {
if (_appFontPointSize.value > _appFontPointSize.min) {
_appFontPointSize.value = _appFontPointSize.value - 1
FactTextField {
id: baseFontEdit
width: _editFieldWidth - (decrementButton.width * 2) - (baseFontRow.spacing * 2)
fact: QGroundControl.settingsManager.appSettings.appFontPointSize
}
QGCButton {
width: height
height: baseFontEdit.height
text: "+"
onClicked: {
if (_appFontPointSize.value < _appFontPointSize.max) {
_appFontPointSize.value = _appFontPointSize.value + 1
}
}
}
}
QGCLabel {
anchors.verticalCenter: parent.verticalCenter
}
}
//-----------------------------------------------------------------
//-- Palette Styles
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
}
FactComboBox {
width: _editFieldWidth
fact: QGroundControl.settingsManager.appSettings.indoorPalette
indexModel: false
anchors.verticalCenter: parent.verticalCenter
}
}
//-----------------------------------------------------------------
//-- Map Provider
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _mapProvider.visible
QGCLabel {
text: qsTr("Map Provider:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
}
FactComboBox {
width: _editFieldWidth
fact: _mapProvider
indexModel: false
anchors.verticalCenter: parent.verticalCenter
}
}
//-----------------------------------------------------------------
//-- Map Type
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _mapType.visible
QGCLabel {
text: qsTr("Map Type:")
anchors.verticalCenter: parent.verticalCenter
Connections {
target: QGroundControl.settingsManager.flightMapSettings
onMapTypeChanged: {
mapTypes.model = _mapType.enumStrings
}
}
}
}
//-----------------------------------------------------------------
//-- Follow Target
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _followTarget.visible
QGCLabel {
text: qsTr("Stream GCS Position:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
}
FactComboBox {
width: _editFieldWidth
fact: _followTarget
indexModel: false
anchors.verticalCenter: parent.verticalCenter
}
}
//-----------------------------------------------------------------
text: qsTr("Mute all audio output")
fact: _audioMuted
visible: _audioMuted.visible
property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted
}
//-----------------------------------------------------------------
//-- Save telemetry log
text: qsTr("Save telemetry log after each flight")
fact: _telemetrySave
property Fact _telemetrySave: QGroundControl.settingsManager.appSettings.telemetrySave
}
//-----------------------------------------------------------------
//-- Save even if not armed
text: qsTr("Save telemetry log even if vehicle was not armed")
fact: _telemetrySaveNotArmed
visible: _telemetrySaveNotArmed.visible
enabled: promptSaveLog.checked
property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed
}
//-----------------------------------------------------------------
//-- Clear settings
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
}
onNo: {
clearCheck.checked = false
clearDialog.visible = false
}
}
}
//-----------------------------------------------------------------
//-- Battery talker
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible
QGCCheckBox {
id: announcePercentCheckbox
text: qsTr("Announce battery lower than:")
checked: _percentRemainingAnnounce.value !== 0
width: (_labelWidth + _editFieldWidth) * 0.65
anchors.verticalCenter: parent.verticalCenter
onClicked: {
if (checked) {
_percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString
} else {
_percentRemainingAnnounce.value = 0
}
}
}
FactTextField {
id: announcePercent
fact: _percentRemainingAnnounce
enabled: announcePercentCheckbox.checked
anchors.verticalCenter: parent.verticalCenter
}
}
//-----------------------------------------------------------------
//-- Virtual joystick settings
text: qsTr("Virtual Joystick")
visible: _virtualJoystick.visible
fact: _virtualJoystick
property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick
}
//-----------------------------------------------------------------
//-- Default mission item altitude
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude.visible
anchors.verticalCenter: parent.verticalCenter
width: (_labelWidth + _editFieldWidth) * 0.65
text: qsTr("Default Mission Altitude:")
}
FactTextField {
id: defaultItemAltitudeField
fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude
//-----------------------------------------------------------------
FactCheckBox {
fact: _autoLoad
visible: _autoLoad.visible
property Fact _autoLoad: QGroundControl.settingsManager.appSettings.autoLoadMissions
}
//-----------------------------------------------------------------
//-- Advanced Link Settings
FactCheckBox {
text: qsTr("Advanced Link Settings")
fact: _advancedLinkSettings
visible: _advancedLinkSettings.visible
property Fact _advancedLinkSettings: QGroundControl.settingsManager.appSettings.advancedLinkSettings
}
//-----------------------------------------------------------------
//-- Save path
visible: _savePath.visible && !ScreenTools.isMobile
QGCLabel {
anchors.baseline: savePathBrowse.baseline
QGCLabel {
anchors.baseline: savePathBrowse.baseline
Layout.maximumWidth: _panelWidth * 0.5
elide: Text.ElideMiddle
text: _savePath.rawValue === "" ? qsTr("<not set>") : _savePath.value
id: savePathBrowse
text: "Browse"
onClicked: savePathBrowseDialog.openForLoad()
QGCFileDialog {
id: savePathBrowseDialog
qgcView: _qgcView
title: qsTr("Choose the location to save files:")
folder: _savePath.rawValue
selectExisting: true
onAcceptedForLoad: _savePath.rawValue = file
Philipp Oettershagen
committed
//-----------------------------------------------------------------
//-- Checklist Settings
FactCheckBox {
text: qsTr("Use preflight checklist")
fact: _useChecklist
visible: _useChecklist.visible
property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist
}
//-----------------------------------------------------------------
//-- RTK GPS
Item {
height: unitLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.rtkSettings.visible
QGCLabel {
id: rtkLabel
text: qsTr("RTK GPS (Requires Restart)")
font.family: ScreenTools.demiboldFontFamily
}
}
Rectangle {
height: rtkGrid.height + (ScreenTools.defaultFontPixelHeight * 2)
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.rtkSettings.visible
GridLayout {
id: rtkGrid
anchors.centerIn: parent
columns: 2
rowSpacing: ScreenTools.defaultFontPixelWidth
columnSpacing: ScreenTools.defaultFontPixelWidth
QGCLabel {
text: qsTr("Survey in accuracy:")
}
FactTextField {
fact: QGroundControl.settingsManager.rtkSettings.surveyInAccuracyLimit
}
QGCLabel {
}
FactTextField {
fact: QGroundControl.settingsManager.rtkSettings.surveyInMinObservationDuration
}
}
}
//-----------------------------------------------------------------
//-- Autoconnect settings
Item {
height: autoConnectLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.autoConnectSettings.visible
Andreas Bircher
committed
QGCLabel {
font.family: ScreenTools.demiboldFontFamily
Andreas Bircher
committed
}
}
height: autoConnectCol.height + (ScreenTools.defaultFontPixelHeight * 2)
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.autoConnectSettings.visible
Column {
id: autoConnectCol
spacing: ScreenTools.defaultFontPixelWidth * 2
Row {
spacing: ScreenTools.defaultFontPixelWidth * 2
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
anchors.horizontalCenter: parent.horizontalCenter
spacing: ScreenTools.defaultFontPixelWidth
visible: !ScreenTools.isMobile
&& QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.visible
&& QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.visible
QGCLabel {
anchors.baseline: nmeaPortCombo.baseline
text: qsTr("NMEA GPS Device:")
width: _labelWidth
}
QGCComboBox {
id: nmeaPortCombo
model: ListModel {
ListElement { text: "disabled" }
}
onActivated: {
if (index != -1) {
QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.value = textAt(index);
}
}
Component.onCompleted: {
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;
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: ScreenTools.defaultFontPixelWidth
visible: !ScreenTools.isMobile
&& QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.visible
&& QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.visible
QGCLabel {
anchors.baseline: nmeaBaudCombo.baseline
text: qsTr("NMEA GPS Baudrate:")
width: _labelWidth
}
QGCComboBox {
id: nmeaBaudCombo
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;
}
}
}
Andreas Bircher
committed
}
}
//-----------------------------------------------------------------
//-- Video Source
Item {
height: videoLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.videoSettings.visible
QGCLabel {
id: videoLabel
font.family: ScreenTools.demiboldFontFamily
}
}
Rectangle {
height: videoCol.height + (ScreenTools.defaultFontPixelHeight * 2)
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.videoSettings.visible
Column {
id: videoCol
spacing: ScreenTools.defaultFontPixelWidth
anchors.centerIn: parent
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.videoSettings.videoSource.visible
QGCLabel {
text: qsTr("Video Source:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
FactComboBox {
id: videoSource
width: _editFieldWidth
indexModel: false
fact: QGroundControl.settingsManager.videoSettings.videoSource
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.videoSettings.udpPort.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 1
QGCLabel {
text: qsTr("UDP Port:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
width: _editFieldWidth
fact: QGroundControl.settingsManager.videoSettings.udpPort
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.videoSettings.rtspUrl.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 2
anchors.verticalCenter: parent.verticalCenter
text: qsTr("RTSP URL:")
width: _labelWidth
}
width: _editFieldWidth
fact: QGroundControl.settingsManager.videoSettings.rtspUrl
anchors.verticalCenter: parent.verticalCenter
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.videoSettings.tcpUrl.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 3
QGCLabel {
text: qsTr("TCP URL:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
}
FactTextField {
width: _editFieldWidth
fact: QGroundControl.settingsManager.videoSettings.tcpUrl
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 3 && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
QGCLabel {
text: qsTr("Aspect Ratio:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
}
FactTextField {
width: _editFieldWidth
fact: QGroundControl.settingsManager.videoSettings.aspectRatio
anchors.verticalCenter: parent.verticalCenter
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 3 && QGroundControl.settingsManager.videoSettings.gridLines.visible
text: qsTr("Disable When Disarmed:")
anchors.verticalCenter: parent.verticalCenter
FactCheckBox {
text: ""
fact: QGroundControl.settingsManager.videoSettings.disableWhenDisarmed
anchors.verticalCenter: parent.verticalCenter
}
}
}
} // Video Source - Rectangle
//-----------------------------------------------------------------
//-- Video Source
Item {
height: videoRecLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.videoSettings.visible
QGCLabel {
id: videoRecLabel
text: qsTr("Video Recording")
font.family: ScreenTools.demiboldFontFamily
}
}
Rectangle {
height: videoRecCol.height + (ScreenTools.defaultFontPixelHeight * 2)
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.videoSettings.visible
Column {
id: videoRecCol
spacing: ScreenTools.defaultFontPixelWidth
anchors.centerIn: parent
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 4 && QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
QGCLabel {
text: qsTr("Auto-Delete Files:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
}
FactCheckBox {
text: ""
fact: QGroundControl.settingsManager.videoSettings.enableStorageLimit
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 4 && QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
QGCLabel {
text: qsTr("Max Storage Usage:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
}
FactTextField {
width: _editFieldWidth
fact: QGroundControl.settingsManager.videoSettings.maxVideoSize
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 4 && QGroundControl.settingsManager.videoSettings.recordingFormat.visible
QGCLabel {
text: qsTr("Video File Format:")
width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
}
FactComboBox {
width: _editFieldWidth
fact: QGroundControl.settingsManager.videoSettings.recordingFormat
anchors.verticalCenter: parent.verticalCenter
//-----------------------------------------------------------------
//-- Custom Brand Image
Item {
height: userBrandImageLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.brandImageSettings.visible && !ScreenTools.isMobile
QGCLabel {
id: userBrandImageLabel
text: qsTr("Brand Image")
font.family: ScreenTools.demiboldFontFamily
}
}
Rectangle {
height: userBrandImageCol.height + (ScreenTools.defaultFontPixelHeight * 2)
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.brandImageSettings.visible && !ScreenTools.isMobile
Column {
id: userBrandImageCol
spacing: ScreenTools.defaultFontPixelWidth
anchors.centerIn: parent
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _userBrandImageIndoor.visible
QGCLabel {
anchors.baseline: userBrandImageIndoorBrowse.baseline
width: _labelWidth*1.5
text: qsTr("Indoor Brand Image Path:")
}
QGCTextField {
anchors.baseline: userBrandImageIndoorBrowse.baseline
readOnly: true
width: _editFieldWidth
text: _userBrandImageIndoor.valueString.replace("file:///","")
}
QGCButton {
id: userBrandImageIndoorBrowse
text: "Browse"
onClicked: userBrandImageIndoorBrowseDialog.openForLoad()
QGCFileDialog {
id: userBrandImageIndoorBrowseDialog
qgcView: _qgcView
title: qsTr("Choose custom brand image file:")
folder: _userBrandImageIndoor.rawValue.replace("file:///","")
selectExisting: true
selectFolder: false
onAcceptedForLoad: _userBrandImageIndoor.rawValue = "file:///" + file
}
}
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _userBrandImageOutdoor.visible
QGCLabel {
anchors.baseline: userBrandImageOutdoorBrowse.baseline
width: _labelWidth*1.5
text: qsTr("Outdoor Brand Image Path:")
}
QGCTextField {
anchors.baseline: userBrandImageOutdoorBrowse.baseline
readOnly: true
width: _editFieldWidth
text: _userBrandImageOutdoor.valueString.replace("file:///","")
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
}
QGCButton {
id: userBrandImageOutdoorBrowse
text: "Browse"
onClicked: userBrandImageOutdoorBrowseDialog.openForLoad()
QGCFileDialog {
id: userBrandImageOutdoorBrowseDialog
qgcView: _qgcView
title: qsTr("Choose custom brand image file:")
folder: _userBrandImageOutdoor.rawValue.replace("file:///","")
selectExisting: true
selectFolder: false
onAcceptedForLoad: _userBrandImageOutdoor.rawValue = "file:///" + file
}
}
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _userBrandImageIndoor.visible
QGCButton {
id: userBrandImageReset
text: "Reset Default Brand Image"
onClicked: {
_userBrandImageIndoor.rawValue = ""
_userBrandImageOutdoor.rawValue = ""
}
}
}
}
}
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("%1 Version: %2").arg(QGroundControl.appName).arg(QGroundControl.qgcVersion)
} // settingsColumn
} // QGCFlickable
} // QGCViewPanel
} // QGCView