GeneralSettings.qml 70.5 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
dogmaphobic's avatar
dogmaphobic committed
9 10


11 12
import QtQuick                  2.3
import QtQuick.Controls         1.2
13
import QtQuick.Controls.Styles  1.4
14
import QtQuick.Dialogs          1.2
15
import QtQuick.Layouts          1.2
dogmaphobic's avatar
dogmaphobic committed
16 17 18

import QGroundControl                       1.0
import QGroundControl.FactSystem            1.0
19
import QGroundControl.FactControls          1.0
dogmaphobic's avatar
dogmaphobic committed
20 21 22 23
import QGroundControl.Controls              1.0
import QGroundControl.ScreenTools           1.0
import QGroundControl.MultiVehicleManager   1.0
import QGroundControl.Palette               1.0
24
import QGroundControl.Controllers           1.0
25
import QGroundControl.SettingsManager       1.0
dogmaphobic's avatar
dogmaphobic committed
26

27
Rectangle {
28
    id:                 _root
29
    color:              qgcPal.window
30 31
    anchors.fill:       parent
    anchors.margins:    ScreenTools.defaultFontPixelWidth
dogmaphobic's avatar
dogmaphobic committed
32

33 34 35 36 37 38 39 40
    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 Fact _virtualJoystick:                     QGroundControl.settingsManager.appSettings.virtualJoystick
    property Fact _virtualJoystickAutoCenterThrottle:   QGroundControl.settingsManager.appSettings.virtualJoystickAutoCenterThrottle

41
    property real _labelWidth:                  ScreenTools.defaultFontPixelWidth * 20
42
    property real _comboFieldWidth:             ScreenTools.defaultFontPixelWidth * 30
43
    property real _valueFieldWidth:             ScreenTools.defaultFontPixelWidth * 10
44 45
    property string _mapProvider:               QGroundControl.settingsManager.flightMapSettings.mapProvider.value
    property string _mapType:                   QGroundControl.settingsManager.flightMapSettings.mapType.value
46
    property Fact _followTarget:                QGroundControl.settingsManager.appSettings.followTarget
47
    property real _panelWidth:                  _root.width * _internalWidthRatio
48
    property real _margins:                     ScreenTools.defaultFontPixelWidth
49
    property var _planViewSettings:             QGroundControl.settingsManager.planViewSettings
Don Gagne's avatar
Don Gagne committed
50

51 52
    property string _videoSource:               QGroundControl.settingsManager.videoSettings.videoSource.value
    property bool   _isGst:                     QGroundControl.videoManager.isGStreamer
Gus Grubba's avatar
Gus Grubba committed
53
    property bool   _isUDP264:                  _isGst && _videoSource === QGroundControl.settingsManager.videoSettings.udp264VideoSource
54
    property bool   _isUDP265:                  _isGst && _videoSource === QGroundControl.settingsManager.videoSettings.udp265VideoSource
55 56
    property bool   _isRTSP:                    _isGst && _videoSource === QGroundControl.settingsManager.videoSettings.rtspVideoSource
    property bool   _isTCP:                     _isGst && _videoSource === QGroundControl.settingsManager.videoSettings.tcpVideoSource
57
    property bool   _isMPEGTS:                  _isGst && _videoSource === QGroundControl.settingsManager.videoSettings.mpegtsVideoSource
58

59 60 61
    property string gpsDisabled: "Disabled"
    property string gpsUdpPort:  "UDP Port"

62
    readonly property real _internalWidthRatio: 0.8
63

64 65 66
        QGCFlickable {
            clip:               true
            anchors.fill:       parent
67 68
            contentHeight:      outerItem.height
            contentWidth:       outerItem.width
69

70 71
            Item {
                id:     outerItem
72
            width:  Math.max(_root.width, settingsColumn.width)
73
                height: settingsColumn.height
74

75 76 77
                ColumnLayout {
                    id:                         settingsColumn
                    anchors.horizontalCenter:   parent.horizontalCenter
78

79 80
                    QGCLabel {
                        id:         unitsSectionLabel
81
                        text:       qsTr("Units")
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
                        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
99

100 101 102
                            Repeater {
                                model: [ qsTr("Distance"), qsTr("Area"), qsTr("Speed"), qsTr("Temperature") ]
                                QGCLabel { text: modelData }
103
                            }
104
                            Repeater {
Remek Zajac's avatar
Remek Zajac committed
105
                                model:  [ QGroundControl.settingsManager.unitsSettings.horizontalDistanceUnits, QGroundControl.settingsManager.unitsSettings.areaUnits, QGroundControl.settingsManager.unitsSettings.speedUnits, QGroundControl.settingsManager.unitsSettings.temperatureUnits ]
106
                                FactComboBox {
107 108 109
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   modelData
                                    indexModel:             false
110
                                }
111 112 113 114
                            }
                        }
                    }

115
                    Item { width: 1; height: _margins }
116

117
                    QGCLabel {
118 119 120
                        id:         miscSectionLabel
                        text:       qsTr("Miscellaneous")
                        visible:    QGroundControl.settingsManager.appSettings.visible
121
                    }
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
                    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
141

142
                                QGCLabel {
143 144 145 146 147 148 149 150 151
                                    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
                                }
152

153
                                QGCLabel {
154 155
                                    text:           qsTr("Color Scheme")
                                    visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible
156
                                }
157 158 159 160 161
                                FactComboBox {
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   QGroundControl.settingsManager.appSettings.indoorPalette
                                    indexModel:             false
                                    visible:                QGroundControl.settingsManager.appSettings.indoorPalette.visible
162
                                }
163 164 165 166

                                QGCLabel {
                                    text:       qsTr("Map Provider")
                                    width:      _labelWidth
167
                                }
Remek Zajac's avatar
Remek Zajac committed
168

169 170
                                QGCComboBox {
                                    id:             mapCombo
171
                                    model:          QGroundControl.mapEngineManager.mapProviderList
172
                                    Layout.preferredWidth:  _comboFieldWidth
173
                                    onActivated: {
Pierre TILAK's avatar
Pierre TILAK committed
174 175 176 177
                                        _mapProvider = textAt(index)
                                        QGroundControl.settingsManager.flightMapSettings.mapProvider.value=textAt(index)
                                        QGroundControl.settingsManager.flightMapSettings.mapType.value=QGroundControl.mapEngineManager.mapTypeList(textAt(index))[0]
                                    }
178 179
                                    Component.onCompleted: {
                                        var index = mapCombo.find(_mapProvider)
180
                                        if(index < 0) index = 0
181
                                        mapCombo.currentIndex = index
182
                                    }
183
                                }
184 185 186 187 188 189
                                QGCLabel {
                                    text:       qsTr("Map Type")
                                    width:      _labelWidth
                                }
                                QGCComboBox {
                                    id:             mapTypeCombo
Pierre TILAK's avatar
Pierre TILAK committed
190
                                    model:          QGroundControl.mapEngineManager.mapTypeList(_mapProvider)
191 192
                                    Layout.preferredWidth:  _comboFieldWidth
                                    onActivated: {
Pierre TILAK's avatar
Pierre TILAK committed
193 194
                                        _mapType = textAt(index)
                                        QGroundControl.settingsManager.flightMapSettings.mapType.value=textAt(index)
195 196 197
                                    }
                                    Component.onCompleted: {
                                        var index = mapTypeCombo.find(_mapType)
198
                                        if(index < 0) index = 0
199 200 201
                                        mapTypeCombo.currentIndex = index
                                    }
                                }
202

203
                                QGCLabel {
204 205
                                    text:                   qsTr("Stream GCS Position")
                                    visible:                _followTarget.visible
206 207 208 209 210
                                }
                                FactComboBox {
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   _followTarget
                                    indexModel:             false
211
                                    visible:                _followTarget.visible
212
                                }
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
                                QGCLabel {
                                    text:                           qsTr("UI Scaling")
                                    visible:                        _appFontPointSize.visible
                                    Layout.alignment:               Qt.AlignVCenter
                                }
                                Item {
                                    width:                          _comboFieldWidth
                                    height:                         baseFontEdit.height * 1.5
                                    visible:                        _appFontPointSize.visible
                                    Layout.alignment:               Qt.AlignVCenter
                                    Row {
                                        spacing:                    ScreenTools.defaultFontPixelWidth
                                        anchors.verticalCenter:     parent.verticalCenter
                                        QGCButton {
                                            width:                  height
                                            height:                 baseFontEdit.height * 1.5
                                            text:                   "-"
                                            anchors.verticalCenter: parent.verticalCenter
                                            onClicked: {
                                                if (_appFontPointSize.value > _appFontPointSize.min) {
                                                    _appFontPointSize.value = _appFontPointSize.value - 1
                                                }
                                            }
                                        }
                                        QGCLabel {
                                            id:                     baseFontEdit
                                            width:                  ScreenTools.defaultFontPixelWidth * 6
                                            text:                   (QGroundControl.settingsManager.appSettings.appFontPointSize.value / ScreenTools.platformFontPointSize * 100).toFixed(0) + "%"
                                            horizontalAlignment:    Text.AlignHCenter
                                            anchors.verticalCenter: parent.verticalCenter
                                        }
                                        Text {

                                        }

                                        QGCButton {
                                            width:                  height
                                            height:                 baseFontEdit.height * 1.5
                                            text:                   "+"
                                            anchors.verticalCenter: parent.verticalCenter
                                            onClicked: {
                                                if (_appFontPointSize.value < _appFontPointSize.max) {
                                                    _appFontPointSize.value = _appFontPointSize.value + 1
                                                }
                                            }
                                        }
                                    }
                                }
261
                            }
Gus Grubba's avatar
Gus Grubba committed
262
                        }
263

264 265 266 267 268 269
                        Item {
                            id:                 miscColItem
                            anchors.margins:    _margins
                            anchors.left:       parent.left
                            anchors.right:      parent.right
                            anchors.top:        comboGridItem.bottom
270
                            anchors.topMargin:  ScreenTools.defaultFontPixelHeight
271
                            height:             miscCol.height
272

273 274 275 276
                            ColumnLayout {
                                id:                         miscCol
                                anchors.horizontalCenter:   parent.horizontalCenter
                                spacing:                    _margins
277

Gus Grubba's avatar
Gus Grubba committed
278 279 280
                                FactCheckBox {
                                    text:       qsTr("Use Vehicle Pairing")
                                    fact:       _usePairing
281
                                    visible:    _usePairing.visible && QGroundControl.supportsPairing
Gus Grubba's avatar
Gus Grubba committed
282 283 284
                                    property Fact _usePairing: QGroundControl.settingsManager.appSettings.usePairing
                                }

285 286 287
                                FactCheckBox {
                                    text:       qsTr("Mute all audio output")
                                    fact:       _audioMuted
288
                                    visible:    _audioMuted.visible
289
                                    property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted
290
                                }
291

292 293 294
                                FactCheckBox {
                                    text:       qsTr("Check for Internet connection")
                                    fact:       _checkInternet
Gus Grubba's avatar
Gus Grubba committed
295
                                    visible:    _checkInternet && _checkInternet.visible
296 297 298
                                    property Fact _checkInternet: QGroundControl.settingsManager.appSettings.checkInternet
                                }

299 300 301
                                FactCheckBox {
                                    text:       qsTr("AutoLoad Missions")
                                    fact:       _autoLoad
Gus Grubba's avatar
Gus Grubba committed
302
                                    visible:    _autoLoad && _autoLoad.visible
303 304 305

                                    property Fact _autoLoad: QGroundControl.settingsManager.appSettings.autoLoadMissions
                                }
306 307

                                QGCCheckBox {
308 309 310
                                    id:         clearCheck
                                    text:       qsTr("Clear all settings on next start")
                                    checked:    false
311
                                    onClicked: {
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
                                        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
328 329
                                        }
                                    }
330
                                }
331

332 333 334 335 336 337
                                RowLayout {
                                    visible: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible

                                    QGCCheckBox {
                                        id:         announcePercentCheckbox
                                        text:       qsTr("Announce battery lower than")
338
                                        checked:    _percentRemainingAnnounce.value !== 0
339 340 341 342 343 344 345 346 347 348 349 350 351
                                        onClicked: {
                                            if (checked) {
                                                _percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString
                                            } else {
                                                _percentRemainingAnnounce.value = 0
                                            }
                                        }
                                    }
                                    FactTextField {
                                        fact:                   _percentRemainingAnnounce
                                        Layout.preferredWidth:  _valueFieldWidth
                                        enabled:                announcePercentCheckbox.checked
                                    }
352
                                }
353 354 355
                            }
                        }

356 357
                        //-----------------------------------------------------------------
                        //-- Save path
Don Gagne's avatar
Don Gagne committed
358
                        RowLayout {
359 360 361 362 363
                            id:                 pathRow
                            anchors.margins:    _margins
                            anchors.left:       parent.left
                            anchors.right:      parent.right
                            anchors.top:        miscColItem.bottom
364
                            visible:            _savePath.visible && !ScreenTools.isMobile
365 366 367 368 369

                            QGCLabel { text: qsTr("Application Load/Save Path") }
                            QGCTextField {
                                Layout.fillWidth:   true
                                readOnly:           true
370
                                text:               _savePath.rawValue === "" ? qsTr("<not set>") : _savePath.value
371 372
                            }
                            QGCButton {
373
                                text:       qsTr("Browse")
374 375 376
                                onClicked:  savePathBrowseDialog.openForLoad()
                                QGCFileDialog {
                                    id:             savePathBrowseDialog
377
                                    title:          qsTr("Choose the location to save/load files")
378
                                    folder:         _savePath.rawValue
379
                                    selectExisting: true
380
                                    selectFolder:   true
381
                                    onAcceptedForLoad: _savePath.rawValue = file
382
                                }
383 384
                            }
                        }
Don Gagne's avatar
Don Gagne committed
385
                    }
386

387 388 389
                    Item { width: 1; height: _margins }
                    QGCLabel {
                        id:         loggingSectionLabel
390
                        text:       qsTr("Data Persistence")
391
                    }
392
                    Rectangle {
393 394
                        Layout.preferredHeight: dataPersistCol.height + (_margins * 2)
                        Layout.preferredWidth:  dataPersistCol.width + (_margins * 2)
395 396 397
                        color:                  qgcPal.windowShade
                        Layout.fillWidth:       true
                        ColumnLayout {
398
                            id:                         dataPersistCol
399 400 401
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
402
                            spacing:                    _margins * 1.5
403
                            FactCheckBox {
404 405 406
                                id:         disableDataPersistence
                                text:       qsTr("Disable all data persistence")
                                fact:       _disableDataPersistence
407
                                visible:    _disableDataPersistence.visible
408
                                property Fact _disableDataPersistence: QGroundControl.settingsManager.appSettings.disableAllPersistence
409
                            }
410 411 412 413 414 415
                            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
                            }
416 417
                        }
                    }
418 419 420 421

                    Item { width: 1; height: _margins }
                    QGCLabel {
                        text:       qsTr("Telemetry Logs from Vehicle")
422
                        visible:    telemetryRect.visible
423 424
                    }
                    Rectangle {
425
                        id:                     telemetryRect
426 427 428 429
                        Layout.preferredHeight: loggingCol.height + (_margins * 2)
                        Layout.preferredWidth:  loggingCol.width + (_margins * 2)
                        color:                  qgcPal.windowShade
                        Layout.fillWidth:       true
430
                        visible:                promptSaveLog._telemetrySave.visible || logIfNotArmed._telemetrySaveNotArmed.visible || promptSaveCsv._saveCsvTelemetry.visible
431 432 433 434 435 436
                        ColumnLayout {
                            id:                         loggingCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
437 438
                            FactCheckBox {
                                id:         promptSaveLog
Gus Grubba's avatar
Gus Grubba committed
439
                                text:       qsTr("Save log after each flight")
440
                                fact:       _telemetrySave
441
                                visible:    _telemetrySave.visible
442
                                enabled:    !disableDataPersistence.checked
443 444 445 446
                                property Fact _telemetrySave: QGroundControl.settingsManager.appSettings.telemetrySave
                            }
                            FactCheckBox {
                                id:         logIfNotArmed
Gus Grubba's avatar
Gus Grubba committed
447
                                text:       qsTr("Save logs even if vehicle was not armed")
448
                                fact:       _telemetrySaveNotArmed
449
                                visible:    _telemetrySaveNotArmed.visible
450
                                enabled:    promptSaveLog.checked && !disableDataPersistence.checked
451 452
                                property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed
                            }
453 454 455 456 457 458 459 460
                            FactCheckBox {
                                id:         promptSaveCsv
                                text:       qsTr("Save CSV log of telemetry data")
                                fact:       _saveCsvTelemetry
                                visible:    _saveCsvTelemetry.visible
                                enabled:    !disableDataPersistence.checked
                                property Fact _saveCsvTelemetry: QGroundControl.settingsManager.appSettings.saveCsvTelemetry
                            }
461
                        }
462
                    }
463 464

                    Item { width: 1; height: _margins }
465 466 467 468 469 470 471 472 473 474 475
                    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
476

477 478 479 480 481 482
                        ColumnLayout {
                            id:                         flyViewCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
483

484
                            FactCheckBox {
485 486 487 488
                                id:             useCheckList
                                text:           qsTr("Use Preflight Checklist")
                                fact:           _useChecklist
                                visible:        _useChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
489

490
                                property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist
491
                            }
Don Gagne's avatar
Don Gagne committed
492

493 494 495 496 497 498 499 500 501
                            FactCheckBox {
                                text:           qsTr("Enforce Preflight Checklist")
                                fact:           _enforceChecklist
                                enabled:        QGroundControl.settingsManager.appSettings.useChecklist.value
                                visible:        useCheckList.visible && _enforceChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length

                                property Fact _enforceChecklist: QGroundControl.settingsManager.appSettings.enforceChecklist
                            }

502 503 504 505 506 507 508 509
                            FactCheckBox {
                                text:       qsTr("Keep Map Centered On Vehicle")
                                fact:       _keepMapCenteredOnVehicle
                                visible:    _keepMapCenteredOnVehicle.visible

                                property Fact _keepMapCenteredOnVehicle: QGroundControl.settingsManager.flyViewSettings.keepMapCenteredOnVehicle
                            }

510 511 512
                            FactCheckBox {
                                text:       qsTr("Show Telemetry Log Replay Status Bar")
                                fact:       _showLogReplayStatusBar
513
                                visible:    _showLogReplayStatusBar.visible
514 515 516 517

                                property Fact _showLogReplayStatusBar: QGroundControl.settingsManager.flyViewSettings.showLogReplayStatusBar
                            }

518 519
                            RowLayout {
                                spacing: ScreenTools.defaultFontPixelWidth
520

521 522 523 524 525
                                FactCheckBox {
                                    text:       qsTr("Virtual Joystick")
                                    visible:    _virtualJoystick.visible
                                    fact:       _virtualJoystick
                                }
526

527 528 529 530 531 532
                                FactCheckBox {
                                    text:       qsTr("Auto-Center Throttle")
                                    visible:    _virtualJoystickAutoCenterThrottle.visible
                                    enabled:    _virtualJoystick.rawValue
                                    fact:       _virtualJoystickAutoCenterThrottle
                                }
533
                            }
534

535
                            FactCheckBox {
536
                                text:       qsTr("Use Vertical Instrument Panel")
537
                                visible:    _alternateInstrumentPanel.visible
538 539 540 541
                                fact:       _alternateInstrumentPanel

                                property Fact _alternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel
                            }
542
                            FactCheckBox {
543
                                text:       qsTr("Show additional heading indicators on Compass")
544
                                visible:    _showAdditionalIndicatorsCompass.visible
545
                                fact:       _showAdditionalIndicatorsCompass
546

547
                                property Fact _showAdditionalIndicatorsCompass: QGroundControl.settingsManager.flyViewSettings.showAdditionalIndicatorsCompass
548 549
                            }
                            FactCheckBox {
550
                                text:       qsTr("Lock Compass Nose-Up")
551
                                visible:    _lockNoseUpCompass.visible
552
                                fact:       _lockNoseUpCompass
553

554
                                property Fact _lockNoseUpCompass: QGroundControl.settingsManager.flyViewSettings.lockNoseUpCompass
555
                            }
556

557

558 559 560
                            GridLayout {
                                columns: 2

561 562 563 564 565
                                property Fact _guidedMinimumAltitude:   QGroundControl.settingsManager.flyViewSettings.guidedMinimumAltitude
                                property Fact _guidedMaximumAltitude:   QGroundControl.settingsManager.flyViewSettings.guidedMaximumAltitude
                                property Fact _maxGoToLocationDistance: QGroundControl.settingsManager.flyViewSettings.maxGoToLocationDistance

                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
566
                                    text:                   qsTr("Guided Minimum Altitude")
567
                                    visible:                parent._guidedMinimumAltitude.visible
568
                                }
569 570
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
571
                                    visible:                parent._guidedMinimumAltitude.visible
572
                                    fact:                   parent._guidedMinimumAltitude
573 574
                                }

575
                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
576
                                    text:                   qsTr("Guided Maximum Altitude")
577
                                    visible:                parent._guidedMaximumAltitude.visible
578
                                }
579 580
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
581
                                    visible:                parent._guidedMaximumAltitude.visible
582 583 584 585
                                    fact:                   parent._guidedMaximumAltitude
                                }

                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
586
                                    text:                   qsTr("Go To Location Max Distance")
587
                                    visible:                parent._maxGoToLocationDistance.visible
588
                                }
589 590
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
591
                                    visible:                parent._maxGoToLocationDistance.visible
592
                                    fact:                   parent._maxGoToLocationDistance
593
                                }
594
                            }
595 596
                        }
                    }
597

598
                    Item { width: 1; height: _margins }
599

600 601 602
                    QGCLabel {
                        id:         planViewSectionLabel
                        text:       qsTr("Plan View")
603
                        visible:    _planViewSettings.visible
604 605 606 607 608 609 610
                    }
                    Rectangle {
                        Layout.preferredHeight: planViewCol.height + (_margins * 2)
                        Layout.preferredWidth:  planViewCol.width + (_margins * 2)
                        color:                  qgcPal.windowShade
                        visible:                planViewSectionLabel.visible
                        Layout.fillWidth:       true
611

612 613 614 615 616 617
                        ColumnLayout {
                            id:                         planViewCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
618

619 620 621 622 623 624 625 626
                            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
627
                                }
628
                            }
629 630 631 632 633

                            FactCheckBox {
                                text:   qsTr("Use MAV_CMD_CONDITION_GATE for pattern generation")
                                fact:   QGroundControl.settingsManager.planViewSettings.useConditionGate
                            }
634

635 636 637 638 639
                            FactCheckBox {
                                text:       qsTr("Missions Do Not Require Takeoff Item")
                                fact:       _planViewSettings.takeoffItemNotRequired
                                visible:    _planViewSettings.takeoffItemNotRequired.visible
                            }
640
                        }
641
                    }
642

643
                    Item { width: 1; height: _margins }
644

645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684
                    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
                                    }
                                }
685
                            }
686

687 688 689 690 691 692 693 694 695 696
                            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")
697
                                }
698 699 700
                                QGCComboBox {
                                    id:                     nmeaPortCombo
                                    Layout.preferredWidth:  _comboFieldWidth
701

702 703 704 705 706 707 708 709 710
                                    model:  ListModel {
                                    }

                                    onActivated: {
                                        if (index != -1) {
                                            QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.value = textAt(index);
                                        }
                                    }
                                    Component.onCompleted: {
711 712 713
                                        model.append({text: gpsDisabled})
                                        model.append({text: gpsUdpPort})

714 715 716 717 718
                                        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;
719 720 721
                                        if (QGroundControl.linkManager.serialPorts.length === 0) {
                                            nmeaPortCombo.model.append({text: "Serial <none available>"})
                                        }
722 723 724
                                    }
                                }

725
                                QGCLabel {
726
                                    visible:          nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled
727 728 729
                                    text:             qsTr("NMEA GPS Baudrate")
                                }
                                QGCComboBox {
730
                                    visible:                nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled
731 732 733 734 735 736 737 738
                                    id:                     nmeaBaudCombo
                                    Layout.preferredWidth:  _comboFieldWidth
                                    model:                  [4800, 9600, 19200, 38400, 57600, 115200]

                                    onActivated: {
                                        if (index != -1) {
                                            QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.value = textAt(index);
                                        }
739
                                    }
740 741 742
                                    Component.onCompleted: {
                                        var index = nmeaBaudCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.valueString);
                                        nmeaBaudCombo.currentIndex = index;
743 744
                                    }
                                }
745 746 747 748 749 750 751 752 753 754

                                QGCLabel {
                                    text:       qsTr("NMEA stream UDP port")
                                    visible:    nmeaPortCombo.currentText === gpsUdpPort
                                }
                                FactTextField {
                                    visible:                nmeaPortCombo.currentText === gpsUdpPort
                                    Layout.preferredWidth:  _valueFieldWidth
                                    fact:                   QGroundControl.settingsManager.autoConnectSettings.nmeaUdpPort
                                }
755
                            }
756 757
                        }
                    }
758

759 760
                    Item { width: 1; height: _margins }

Don Gagne's avatar
Don Gagne committed
761
                    QGCLabel {
762
                        id:         rtkSectionLabel
763
                        text:       qsTr("RTK GPS")
764
                        visible:    QGroundControl.settingsManager.rtkSettings.visible
Don Gagne's avatar
Don Gagne committed
765
                    }
766 767 768 769 770 771 772 773 774 775 776
                    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
777
                            Layout.fillWidth:           true
778
                            anchors.horizontalCenter:   parent.horizontalCenter
779
                            columns:                    3
780

Gus Grubba's avatar
Gus Grubba committed
781
                            property var  rtkSettings:      QGroundControl.settingsManager.rtkSettings
782
                            property bool useFixedPosition: rtkSettings.useFixedBasePosition.rawValue
783
                            property real firstColWidth:    ScreenTools.defaultFontPixelWidth * 3
784

785 786
                            QGCRadioButton {
                                text:               qsTr("Perform Survey-In")
787 788
                                visible:            rtkGrid.rtkSettings.useFixedBasePosition.visible
                                checked:            rtkGrid.rtkSettings.useFixedBasePosition.value === false
789
                                Layout.columnSpan:  3
790
                                onClicked:          rtkGrid.rtkSettings.useFixedBasePosition.value = false
791
                            }
792

793
                            Item { width: rtkGrid.firstColWidth; height: 1 }
794
                            QGCLabel {
795 796
                                text:               rtkGrid.rtkSettings.surveyInAccuracyLimit.shortDescription
                                visible:            rtkGrid.rtkSettings.surveyInAccuracyLimit.visible
Gus Grubba's avatar
Gus Grubba committed
797
                                enabled:            !rtkGrid.useFixedPosition
798
                            }
799
                            FactTextField {
800 801
                                fact:               rtkGrid.rtkSettings.surveyInAccuracyLimit
                                visible:            rtkGrid.rtkSettings.surveyInAccuracyLimit.visible
Gus Grubba's avatar
Gus Grubba committed
802
                                enabled:            !rtkGrid.useFixedPosition
803
                                Layout.preferredWidth:  _valueFieldWidth
804
                            }
805

806
                            Item { width: rtkGrid.firstColWidth; height: 1 }
807
                            QGCLabel {
808 809
                                text:               rtkGrid.rtkSettings.surveyInMinObservationDuration.shortDescription
                                visible:            rtkGrid.rtkSettings.surveyInMinObservationDuration.visible
Gus Grubba's avatar
Gus Grubba committed
810
                                enabled:            !rtkGrid.useFixedPosition
811
                            }
812
                            FactTextField {
813 814
                                fact:               rtkGrid.rtkSettings.surveyInMinObservationDuration
                                visible:            rtkGrid.rtkSettings.surveyInMinObservationDuration.visible
Gus Grubba's avatar
Gus Grubba committed
815
                                enabled:            !rtkGrid.useFixedPosition
816
                                Layout.preferredWidth:  _valueFieldWidth
817
                            }
818

819 820
                            QGCRadioButton {
                                text:               qsTr("Use Specified Base Position")
821 822 823
                                visible:            rtkGrid.rtkSettings.useFixedBasePosition.visible
                                checked:            rtkGrid.rtkSettings.useFixedBasePosition.value === true
                                onClicked:          rtkGrid.rtkSettings.useFixedBasePosition.value = true
824
                                Layout.columnSpan:  3
825
                            }
826

827
                            Item { width: rtkGrid.firstColWidth; height: 1 }
828
                            QGCLabel {
829 830
                                text:               rtkGrid.rtkSettings.fixedBasePositionLatitude.shortDescription
                                visible:            rtkGrid.rtkSettings.fixedBasePositionLatitude.visible
Gus Grubba's avatar
Gus Grubba committed
831
                                enabled:            rtkGrid.useFixedPosition
832 833
                            }
                            FactTextField {
834 835
                                fact:               rtkGrid.rtkSettings.fixedBasePositionLatitude
                                visible:            rtkGrid.rtkSettings.fixedBasePositionLatitude.visible
836 837 838
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
839

840
                            Item { width: rtkGrid.firstColWidth; height: 1 }
841
                            QGCLabel {
842 843
                                text:               rtkGrid.rtkSettings.fixedBasePositionLongitude.shortDescription
                                visible:            rtkGrid.rtkSettings.fixedBasePositionLongitude.visible
Gus Grubba's avatar
Gus Grubba committed
844
                                enabled:            rtkGrid.useFixedPosition
845 846
                            }
                            FactTextField {
847 848
                                fact:               rtkGrid.rtkSettings.fixedBasePositionLongitude
                                visible:            rtkGrid.rtkSettings.fixedBasePositionLongitude.visible
849 850 851
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
852

853
                            Item { width: rtkGrid.firstColWidth; height: 1 }
854
                            QGCLabel {
855 856
                                text:           rtkGrid.rtkSettings.fixedBasePositionAltitude.shortDescription
                                visible:        rtkGrid.rtkSettings.fixedBasePositionAltitude.visible
857
                                enabled:        rtkGrid.useFixedPosition
858 859
                            }
                            FactTextField {
860 861
                                fact:               rtkGrid.rtkSettings.fixedBasePositionAltitude
                                visible:            rtkGrid.rtkSettings.fixedBasePositionAltitude.visible
862 863 864
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
865

866
                            Item { width: rtkGrid.firstColWidth; height: 1 }
867
                            QGCLabel {
868 869
                                text:           rtkGrid.rtkSettings.fixedBasePositionAccuracy.shortDescription
                                visible:        rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible
870
                                enabled:        rtkGrid.useFixedPosition
871 872
                            }
                            FactTextField {
873 874
                                fact:               rtkGrid.rtkSettings.fixedBasePositionAccuracy
                                visible:            rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible
875 876 877
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
878

879
                            Item { width: rtkGrid.firstColWidth; height: 1 }
880 881
                            QGCButton {
                                text:               qsTr("Save Current Base Position")
882
                                enabled:            QGroundControl.gpsRtk && QGroundControl.gpsRtk.valid.value
883
                                Layout.columnSpan:  2
884 885 886 887 888 889
                                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
                                }
890
                            }
891
                        }
892
                    }
893 894

                    Item { width: 1; height: _margins }
895

896 897 898 899 900 901
                    QGCLabel {
                        id:         adsbSectionLabel
                        text:       qsTr("ADSB Server")
                        visible:    QGroundControl.settingsManager.adsbVehicleManagerSettings.visible
                    }
                    Rectangle {
902
                        Layout.preferredHeight: adsbGrid.y + adsbGrid.height + _margins
903 904 905 906 907
                        Layout.preferredWidth:  adsbGrid.width + (_margins * 2)
                        color:                  qgcPal.windowShade
                        visible:                adsbSectionLabel.visible
                        Layout.fillWidth:       true

908 909 910 911 912 913 914 915 916 917 918
                        QGCLabel {
                            id:                 warningLabel
                            anchors.margins:    _margins
                            anchors.top:        parent.top
                            anchors.left:       parent.left
                            anchors.right:      parent.right
                            font.pointSize:     ScreenTools.smallFontPointSize
                            wrapMode:           Text.WordWrap
                            text:               qsTr("Note: These setting are not meant for use with an ADSB transponder which is situated on the vehicle.")
                        }

919 920 921
                        GridLayout {
                            id:                         adsbGrid
                            anchors.topMargin:          _margins
922
                            anchors.top:                warningLabel.bottom
923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959
                            Layout.fillWidth:           true
                            anchors.horizontalCenter:   parent.horizontalCenter
                            columns:                    2

                            property var  adsbSettings:    QGroundControl.settingsManager.adsbVehicleManagerSettings

                            FactCheckBox {
                                text:                   adsbGrid.adsbSettings.adsbServerConnectEnabled.shortDescription
                                fact:                   adsbGrid.adsbSettings.adsbServerConnectEnabled
                                visible:                adsbGrid.adsbSettings.adsbServerConnectEnabled.visible
                                Layout.columnSpan:      2
                            }

                            QGCLabel {
                                text:               adsbGrid.adsbSettings.adsbServerHostAddress.shortDescription
                                visible:            adsbGrid.adsbSettings.adsbServerHostAddress.visible
                            }
                            FactTextField {
                                fact:                   adsbGrid.adsbSettings.adsbServerHostAddress
                                visible:                adsbGrid.adsbSettings.adsbServerHostAddress.visible
                                Layout.preferredWidth:  _valueFieldWidth
                            }

                            QGCLabel {
                                text:               adsbGrid.adsbSettings.adsbServerPort.shortDescription
                                visible:            adsbGrid.adsbSettings.adsbServerPort.visible
                            }
                            FactTextField {
                                fact:                   adsbGrid.adsbSettings.adsbServerPort
                                visible:                adsbGrid.adsbSettings.adsbServerPort.visible
                                Layout.preferredWidth:  _valueFieldWidth
                            }
                        }
                    }

                    Item { width: 1; height: _margins }

960
                    QGCLabel {
961 962
                        id:         videoSectionLabel
                        text:       qsTr("Video")
963
                        visible:    QGroundControl.settingsManager.videoSettings.visible && !QGroundControl.videoManager.autoStreamConfigured
964
                    }
965 966 967 968 969 970 971 972 973 974 975 976 977 978 979
                    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
980
                            QGCLabel {
981 982
                                text:                   qsTr("Video Source")
                                visible:                QGroundControl.settingsManager.videoSettings.videoSource.visible
983
                            }
984
                            FactComboBox {
985 986 987 988 989
                                id:                     videoSource
                                Layout.preferredWidth:  _comboFieldWidth
                                indexModel:             false
                                fact:                   QGroundControl.settingsManager.videoSettings.videoSource
                                visible:                QGroundControl.settingsManager.videoSettings.videoSource.visible
990
                            }
991

992
                            QGCLabel {
993
                                text:                   qsTr("UDP Port")
994
                                visible:                (_isUDP264 || _isUDP265 || _isMPEGTS)  && QGroundControl.settingsManager.videoSettings.udpPort.visible
995
                            }
996
                            FactTextField {
997 998
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.udpPort
999
                                visible:                (_isUDP264 || _isUDP265 || _isMPEGTS) && QGroundControl.settingsManager.videoSettings.udpPort.visible
1000
                            }
1001

1002
                            QGCLabel {
1003 1004
                                text:                   qsTr("RTSP URL")
                                visible:                _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible
1005
                            }
1006
                            FactTextField {
1007 1008
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.rtspUrl
1009
                                visible:                _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible
1010
                            }
1011

1012
                            QGCLabel {
1013 1014
                                text:                   qsTr("TCP URL")
                                visible:                _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible
1015 1016
                            }
                            FactTextField {
1017 1018
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.tcpUrl
1019
                                visible:                _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible
1020
                            }
1021
                            QGCLabel {
1022
                                text:                   qsTr("Aspect Ratio")
1023
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
1024 1025
                            }
                            FactTextField {
1026 1027
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.aspectRatio
1028
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
1029
                            }
1030

1031
                            QGCLabel {
1032 1033
                                text:                   qsTr("Disable When Disarmed")
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible
1034
                            }
1035
                            FactCheckBox {
1036 1037 1038
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.disableWhenDisarmed
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible
1039
                            }
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049

                            QGCLabel {
                                text:                   qsTr("Low Latency Mode")
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.lowLatencyMode.visible
                            }
                            FactCheckBox {
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.lowLatencyMode
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.lowLatencyMode.visible
                            }
1050 1051
                        }
                    }
1052

1053
                    Item { width: 1; height: _margins }
1054

1055
                    QGCLabel {
1056 1057
                        id:                             videoRecSectionLabel
                        text:                           qsTr("Video Recording")
1058
                        visible:                        (QGroundControl.settingsManager.videoSettings.visible && _isGst) || QGroundControl.videoManager.autoStreamConfigured
1059
                    }
1060
                    Rectangle {
1061
                        Layout.preferredWidth:          videoRecCol.width  + (_margins * 2)
1062 1063 1064 1065
                        Layout.preferredHeight:         videoRecCol.height + (_margins * 2)
                        Layout.fillWidth:               true
                        color:                          qgcPal.windowShade
                        visible:                        videoRecSectionLabel.visible
1066 1067 1068 1069 1070 1071 1072 1073

                        GridLayout {
                            id:                         videoRecCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            Layout.fillWidth:           false
                            columns:                    2
1074

1075
                            QGCLabel {
1076 1077
                                text:                   qsTr("Auto-Delete Files")
                                visible:                QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
1078 1079
                            }
                            FactCheckBox {
1080 1081 1082
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.enableStorageLimit
                                visible:                QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
1083
                            }
1084

1085
                            QGCLabel {
1086 1087
                                text:                   qsTr("Max Storage Usage")
                                visible:                QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
1088 1089
                            }
                            FactTextField {
1090 1091 1092
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.maxVideoSize
                                visible:                QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
1093
                            }
1094

1095
                            QGCLabel {
1096 1097
                                text:                   qsTr("Video File Format")
                                visible:                QGroundControl.settingsManager.videoSettings.recordingFormat.visible
1098 1099
                            }
                            FactComboBox {
1100 1101 1102
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.recordingFormat
                                visible:                QGroundControl.settingsManager.videoSettings.recordingFormat.visible
1103
                            }
1104 1105 1106
                        }
                    }

1107 1108
                    Item { width: 1; height: _margins; visible: videoRecSectionLabel.visible }

1109
                    QGCLabel {
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127
                        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
1128 1129

                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
1130
                                text:           qsTr("Indoor Image")
1131
                                visible:        _userBrandImageIndoor.visible
1132 1133 1134
                            }
                            QGCTextField {
                                readOnly:           true
1135
                                Layout.fillWidth:   true
1136
                                text:               _userBrandImageIndoor.valueString.replace("file:///","")
1137 1138
                            }
                            QGCButton {
1139
                                text:       qsTr("Browse")
1140 1141
                                onClicked:  userBrandImageIndoorBrowseDialog.openForLoad()
                                QGCFileDialog {
1142 1143 1144 1145 1146 1147
                                    id:                 userBrandImageIndoorBrowseDialog
                                    title:              qsTr("Choose custom brand image file")
                                    folder:             _userBrandImageIndoor.rawValue.replace("file:///","")
                                    selectExisting:     true
                                    selectFolder:       false
                                    onAcceptedForLoad:  _userBrandImageIndoor.rawValue = "file:///" + file
1148
                                }
1149 1150
                            }

1151
                            QGCLabel {
1152
                                text:       qsTr("Outdoor Image")
1153
                                visible:    _userBrandImageOutdoor.visible
1154
                            }
1155 1156
                            QGCTextField {
                                readOnly:           true
1157
                                Layout.fillWidth:   true
1158
                                text:                _userBrandImageOutdoor.valueString.replace("file:///","")
1159 1160
                            }
                            QGCButton {
1161
                                text:       qsTr("Browse")
1162 1163
                                onClicked:  userBrandImageOutdoorBrowseDialog.openForLoad()
                                QGCFileDialog {
1164 1165 1166 1167 1168 1169
                                    id:                 userBrandImageOutdoorBrowseDialog
                                    title:              qsTr("Choose custom brand image file")
                                    folder:             _userBrandImageOutdoor.rawValue.replace("file:///","")
                                    selectExisting:     true
                                    selectFolder:       false
                                    onAcceptedForLoad:  _userBrandImageOutdoor.rawValue = "file:///" + file
1170 1171 1172
                                }
                            }
                            QGCButton {
1173 1174 1175
                                text:               qsTr("Reset Default Brand Image")
                                Layout.columnSpan:  3
                                Layout.alignment:   Qt.AlignHCenter
1176 1177 1178 1179
                                onClicked:  {
                                    _userBrandImageIndoor.rawValue = ""
                                    _userBrandImageOutdoor.rawValue = ""
                                }
1180 1181
                            }
                        }
1182
                    }
1183

1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
                    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
            }
1196 1197
    }
}