GeneralSettings.qml 68.3 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
    property Fact _percentRemainingAnnounce:    QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce
34
    property Fact _savePath:                    QGroundControl.settingsManager.appSettings.savePath
35
    property Fact _appFontPointSize:            QGroundControl.settingsManager.appSettings.appFontPointSize
36 37
    property Fact _userBrandImageIndoor:        QGroundControl.settingsManager.brandImageSettings.userBrandImageIndoor
    property Fact _userBrandImageOutdoor:       QGroundControl.settingsManager.brandImageSettings.userBrandImageOutdoor
38
    property real _labelWidth:                  ScreenTools.defaultFontPixelWidth * 20
39
    property real _comboFieldWidth:             ScreenTools.defaultFontPixelWidth * 30
40
    property real _valueFieldWidth:             ScreenTools.defaultFontPixelWidth * 10
41 42
    property string _mapProvider:               QGroundControl.settingsManager.flightMapSettings.mapProvider.value
    property string _mapType:                   QGroundControl.settingsManager.flightMapSettings.mapType.value
43
    property Fact _followTarget:                QGroundControl.settingsManager.appSettings.followTarget
44
    property real _panelWidth:                  _root.width * _internalWidthRatio
45
    property real _margins:                     ScreenTools.defaultFontPixelWidth
Don Gagne's avatar
Don Gagne committed
46

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

55 56 57
    property string gpsDisabled: "Disabled"
    property string gpsUdpPort:  "UDP Port"

58
    readonly property real _internalWidthRatio: 0.8
59

60 61 62
        QGCFlickable {
            clip:               true
            anchors.fill:       parent
63 64
            contentHeight:      outerItem.height
            contentWidth:       outerItem.width
65

66 67
            Item {
                id:     outerItem
68
            width:  Math.max(_root.width, settingsColumn.width)
69
                height: settingsColumn.height
70

71 72 73
                ColumnLayout {
                    id:                         settingsColumn
                    anchors.horizontalCenter:   parent.horizontalCenter
74

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

96 97 98
                            Repeater {
                                model: [ qsTr("Distance"), qsTr("Area"), qsTr("Speed"), qsTr("Temperature") ]
                                QGCLabel { text: modelData }
99
                            }
100 101
                            Repeater {
                                model:  [ QGroundControl.settingsManager.unitsSettings.distanceUnits, QGroundControl.settingsManager.unitsSettings.areaUnits, QGroundControl.settingsManager.unitsSettings.speedUnits, QGroundControl.settingsManager.unitsSettings.temperatureUnits ]
102
                                FactComboBox {
103 104 105
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   modelData
                                    indexModel:             false
106
                                }
107 108 109 110
                            }
                        }
                    }

111
                    Item { width: 1; height: _margins }
112

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

138
                                QGCLabel {
139 140 141 142 143 144 145 146 147
                                    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
                                }
148

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

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

199
                                QGCLabel {
200 201
                                    text:                   qsTr("Stream GCS Position")
                                    visible:                _followTarget.visible
202 203 204 205 206
                                }
                                FactComboBox {
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   _followTarget
                                    indexModel:             false
207
                                    visible:                _followTarget.visible
208
                                }
209 210 211 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
                                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
                                                }
                                            }
                                        }
                                    }
                                }
257
                            }
Gus Grubba's avatar
Gus Grubba committed
258
                        }
259

260 261 262 263 264 265
                        Item {
                            id:                 miscColItem
                            anchors.margins:    _margins
                            anchors.left:       parent.left
                            anchors.right:      parent.right
                            anchors.top:        comboGridItem.bottom
266
                            anchors.topMargin:  ScreenTools.defaultFontPixelHeight
267
                            height:             miscCol.height
268

269 270 271 272
                            ColumnLayout {
                                id:                         miscCol
                                anchors.horizontalCenter:   parent.horizontalCenter
                                spacing:                    _margins
273

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

281 282 283
                                FactCheckBox {
                                    text:       qsTr("Mute all audio output")
                                    fact:       _audioMuted
284
                                    visible:    _audioMuted.visible
285
                                    property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted
286
                                }
287

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

295 296 297
                                FactCheckBox {
                                    text:       qsTr("AutoLoad Missions")
                                    fact:       _autoLoad
Gus Grubba's avatar
Gus Grubba committed
298
                                    visible:    _autoLoad && _autoLoad.visible
299 300 301

                                    property Fact _autoLoad: QGroundControl.settingsManager.appSettings.autoLoadMissions
                                }
302 303

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

328 329 330 331 332 333
                                RowLayout {
                                    visible: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible

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

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

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

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

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

                    Item { width: 1; height: _margins }
461 462 463 464 465 466 467 468 469 470 471
                    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
472

473 474 475 476 477 478
                        ColumnLayout {
                            id:                         flyViewCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
479

480
                            FactCheckBox {
481 482 483 484
                                id:             useCheckList
                                text:           qsTr("Use Preflight Checklist")
                                fact:           _useChecklist
                                visible:        _useChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
485

486
                                property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist
487
                            }
Don Gagne's avatar
Don Gagne committed
488

489 490 491 492 493 494 495 496 497
                            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
                            }

498 499 500 501 502 503 504 505
                            FactCheckBox {
                                text:       qsTr("Keep Map Centered On Vehicle")
                                fact:       _keepMapCenteredOnVehicle
                                visible:    _keepMapCenteredOnVehicle.visible

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

506 507 508
                            FactCheckBox {
                                text:       qsTr("Show Telemetry Log Replay Status Bar")
                                fact:       _showLogReplayStatusBar
509
                                visible:    _showLogReplayStatusBar.visible
510 511 512 513

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

514 515
                            FactCheckBox {
                                text:       qsTr("Virtual Joystick")
516
                                visible:    _virtualJoystick.visible
517 518 519
                                fact:       _virtualJoystick

                                property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick
520 521
                            }

522 523
                            FactCheckBox {
                                text:       qsTr("Auto-Center throttle")
524
                                visible:    _virtualJoystickCentralized.visible && activeVehicle && (activeVehicle.sub || activeVehicle.rover)
525 526
                                fact:       _virtualJoystickCentralized
                                Layout.leftMargin: _margins
527

528 529
                                property Fact _virtualJoystickCentralized: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized
                            }
530
                            FactCheckBox {
531
                                text:       qsTr("Use Vertical Instrument Panel")
532
                                visible:    _alternateInstrumentPanel.visible
533 534 535 536
                                fact:       _alternateInstrumentPanel

                                property Fact _alternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel
                            }
537
                            FactCheckBox {
538
                                text:       qsTr("Show additional heading indicators on Compass")
539
                                visible:    _showAdditionalIndicatorsCompass.visible
540
                                fact:       _showAdditionalIndicatorsCompass
541

542
                                property Fact _showAdditionalIndicatorsCompass: QGroundControl.settingsManager.flyViewSettings.showAdditionalIndicatorsCompass
543 544
                            }
                            FactCheckBox {
545
                                text:       qsTr("Lock Compass Nose-Up")
546
                                visible:    _lockNoseUpCompass.visible
547
                                fact:       _lockNoseUpCompass
548

549
                                property Fact _lockNoseUpCompass: QGroundControl.settingsManager.flyViewSettings.lockNoseUpCompass
550
                            }
551

552

553 554 555
                            GridLayout {
                                columns: 2

556 557 558 559 560
                                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
561
                                    text:                   qsTr("Guided Minimum Altitude")
562
                                    visible:                parent._guidedMinimumAltitude.visible
563
                                }
564 565
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
566
                                    visible:                parent._guidedMinimumAltitude.visible
567
                                    fact:                   parent._guidedMinimumAltitude
568 569
                                }

570
                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
571
                                    text:                   qsTr("Guided Maximum Altitude")
572
                                    visible:                parent._guidedMaximumAltitude.visible
573
                                }
574 575
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
576
                                    visible:                parent._guidedMaximumAltitude.visible
577 578 579 580
                                    fact:                   parent._guidedMaximumAltitude
                                }

                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
581
                                    text:                   qsTr("Go To Location Max Distance")
582
                                    visible:                parent._maxGoToLocationDistance.visible
583
                                }
584 585
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
586
                                    visible:                parent._maxGoToLocationDistance.visible
587
                                    fact:                   parent._maxGoToLocationDistance
588
                                }
589
                            }
590 591
                        }
                    }
592

593
                    Item { width: 1; height: _margins }
594

595 596 597 598 599 600 601 602 603 604 605
                    QGCLabel {
                        id:         planViewSectionLabel
                        text:       qsTr("Plan View")
                        visible:    QGroundControl.settingsManager.planViewSettings.visible
                    }
                    Rectangle {
                        Layout.preferredHeight: planViewCol.height + (_margins * 2)
                        Layout.preferredWidth:  planViewCol.width + (_margins * 2)
                        color:                  qgcPal.windowShade
                        visible:                planViewSectionLabel.visible
                        Layout.fillWidth:       true
606

607 608 609 610 611 612
                        ColumnLayout {
                            id:                         planViewCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
613

614 615 616 617 618 619 620 621
                            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
622
                                }
623
                            }
624
                        }
625
                    }
626

627
                    Item { width: 1; height: _margins }
628

629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 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
                    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
                                    }
                                }
669
                            }
670

671 672 673 674 675 676 677 678 679 680
                            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")
681
                                }
682 683 684
                                QGCComboBox {
                                    id:                     nmeaPortCombo
                                    Layout.preferredWidth:  _comboFieldWidth
685

686 687 688 689 690 691 692 693 694
                                    model:  ListModel {
                                    }

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

698 699 700 701 702
                                        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;
703 704 705
                                        if (QGroundControl.linkManager.serialPorts.length === 0) {
                                            nmeaPortCombo.model.append({text: "Serial <none available>"})
                                        }
706 707 708
                                    }
                                }

709
                                QGCLabel {
710
                                    visible:          nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled
711 712 713
                                    text:             qsTr("NMEA GPS Baudrate")
                                }
                                QGCComboBox {
714
                                    visible:                nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled
715 716 717 718 719 720 721 722
                                    id:                     nmeaBaudCombo
                                    Layout.preferredWidth:  _comboFieldWidth
                                    model:                  [4800, 9600, 19200, 38400, 57600, 115200]

                                    onActivated: {
                                        if (index != -1) {
                                            QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.value = textAt(index);
                                        }
723
                                    }
724 725 726
                                    Component.onCompleted: {
                                        var index = nmeaBaudCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.valueString);
                                        nmeaBaudCombo.currentIndex = index;
727 728
                                    }
                                }
729 730 731 732 733 734 735 736 737 738

                                QGCLabel {
                                    text:       qsTr("NMEA stream UDP port")
                                    visible:    nmeaPortCombo.currentText === gpsUdpPort
                                }
                                FactTextField {
                                    visible:                nmeaPortCombo.currentText === gpsUdpPort
                                    Layout.preferredWidth:  _valueFieldWidth
                                    fact:                   QGroundControl.settingsManager.autoConnectSettings.nmeaUdpPort
                                }
739
                            }
740 741
                        }
                    }
742

743 744
                    Item { width: 1; height: _margins }

Don Gagne's avatar
Don Gagne committed
745
                    QGCLabel {
746
                        id:         rtkSectionLabel
747
                        text:       qsTr("RTK GPS")
748
                        visible:    QGroundControl.settingsManager.rtkSettings.visible
Don Gagne's avatar
Don Gagne committed
749
                    }
750 751 752 753 754 755 756 757 758 759 760
                    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
761
                            Layout.fillWidth:           true
762
                            anchors.horizontalCenter:   parent.horizontalCenter
763
                            columns:                    3
764

Gus Grubba's avatar
Gus Grubba committed
765
                            property var  rtkSettings:      QGroundControl.settingsManager.rtkSettings
766
                            property bool useFixedPosition: rtkSettings.useFixedBasePosition.rawValue
767
                            property real firstColWidth:    ScreenTools.defaultFontPixelWidth * 3
768

769 770
                            QGCRadioButton {
                                text:               qsTr("Perform Survey-In")
771 772
                                visible:            rtkGrid.rtkSettings.useFixedBasePosition.visible
                                checked:            rtkGrid.rtkSettings.useFixedBasePosition.value === false
773
                                Layout.columnSpan:  3
774
                                onClicked:          rtkGrid.rtkSettings.useFixedBasePosition.value = false
775
                            }
776

777
                            Item { width: rtkGrid.firstColWidth; height: 1 }
778
                            QGCLabel {
779 780
                                text:               rtkGrid.rtkSettings.surveyInAccuracyLimit.shortDescription
                                visible:            rtkGrid.rtkSettings.surveyInAccuracyLimit.visible
Gus Grubba's avatar
Gus Grubba committed
781
                                enabled:            !rtkGrid.useFixedPosition
782
                            }
783
                            FactTextField {
784 785
                                fact:               rtkGrid.rtkSettings.surveyInAccuracyLimit
                                visible:            rtkGrid.rtkSettings.surveyInAccuracyLimit.visible
Gus Grubba's avatar
Gus Grubba committed
786
                                enabled:            !rtkGrid.useFixedPosition
787
                                Layout.preferredWidth:  _valueFieldWidth
788
                            }
789

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

803 804
                            QGCRadioButton {
                                text:               qsTr("Use Specified Base Position")
805 806 807
                                visible:            rtkGrid.rtkSettings.useFixedBasePosition.visible
                                checked:            rtkGrid.rtkSettings.useFixedBasePosition.value === true
                                onClicked:          rtkGrid.rtkSettings.useFixedBasePosition.value = true
808
                                Layout.columnSpan:  3
809
                            }
810

811
                            Item { width: rtkGrid.firstColWidth; height: 1 }
812
                            QGCLabel {
813 814
                                text:               rtkGrid.rtkSettings.fixedBasePositionLatitude.shortDescription
                                visible:            rtkGrid.rtkSettings.fixedBasePositionLatitude.visible
Gus Grubba's avatar
Gus Grubba committed
815
                                enabled:            rtkGrid.useFixedPosition
816 817
                            }
                            FactTextField {
818 819
                                fact:               rtkGrid.rtkSettings.fixedBasePositionLatitude
                                visible:            rtkGrid.rtkSettings.fixedBasePositionLatitude.visible
820 821 822
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
823

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

837
                            Item { width: rtkGrid.firstColWidth; height: 1 }
838
                            QGCLabel {
839 840
                                text:           rtkGrid.rtkSettings.fixedBasePositionAltitude.shortDescription
                                visible:        rtkGrid.rtkSettings.fixedBasePositionAltitude.visible
841
                                enabled:        rtkGrid.useFixedPosition
842 843
                            }
                            FactTextField {
844 845
                                fact:               rtkGrid.rtkSettings.fixedBasePositionAltitude
                                visible:            rtkGrid.rtkSettings.fixedBasePositionAltitude.visible
846 847 848
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
849

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

863
                            Item { width: rtkGrid.firstColWidth; height: 1 }
864 865
                            QGCButton {
                                text:               qsTr("Save Current Base Position")
866
                                enabled:            QGroundControl.gpsRtk && QGroundControl.gpsRtk.valid.value
867
                                Layout.columnSpan:  2
868 869 870 871 872 873
                                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
                                }
874
                            }
875
                        }
876
                    }
877 878

                    Item { width: 1; height: _margins }
879

880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932
                    QGCLabel {
                        id:         adsbSectionLabel
                        text:       qsTr("ADSB Server")
                        visible:    QGroundControl.settingsManager.adsbVehicleManagerSettings.visible
                    }
                    Rectangle {
                        Layout.preferredHeight: adsbGrid.height + (_margins * 2)
                        Layout.preferredWidth:  adsbGrid.width + (_margins * 2)
                        color:                  qgcPal.windowShade
                        visible:                adsbSectionLabel.visible
                        Layout.fillWidth:       true

                        GridLayout {
                            id:                         adsbGrid
                            anchors.topMargin:          _margins
                            anchors.top:                parent.top
                            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 }

933
                    QGCLabel {
934 935
                        id:         videoSectionLabel
                        text:       qsTr("Video")
936
                        visible:    QGroundControl.settingsManager.videoSettings.visible && !QGroundControl.videoManager.autoStreamConfigured
937
                    }
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
                    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
953
                            QGCLabel {
954 955
                                text:                   qsTr("Video Source")
                                visible:                QGroundControl.settingsManager.videoSettings.videoSource.visible
956
                            }
957
                            FactComboBox {
958 959 960 961 962
                                id:                     videoSource
                                Layout.preferredWidth:  _comboFieldWidth
                                indexModel:             false
                                fact:                   QGroundControl.settingsManager.videoSettings.videoSource
                                visible:                QGroundControl.settingsManager.videoSettings.videoSource.visible
963
                            }
964

965
                            QGCLabel {
966
                                text:                   qsTr("UDP Port")
967
                                visible:                (_isUDP264 || _isUDP265 || _isMPEGTS)  && QGroundControl.settingsManager.videoSettings.udpPort.visible
968
                            }
969
                            FactTextField {
970 971
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.udpPort
972
                                visible:                (_isUDP264 || _isUDP265 || _isMPEGTS) && QGroundControl.settingsManager.videoSettings.udpPort.visible
973
                            }
974

975
                            QGCLabel {
976 977
                                text:                   qsTr("RTSP URL")
                                visible:                _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible
978
                            }
979
                            FactTextField {
980 981
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.rtspUrl
982
                                visible:                _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible
983
                            }
984

985
                            QGCLabel {
986 987
                                text:                   qsTr("TCP URL")
                                visible:                _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible
988 989
                            }
                            FactTextField {
990 991
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.tcpUrl
992
                                visible:                _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible
993
                            }
994
                            QGCLabel {
995
                                text:                   qsTr("Aspect Ratio")
996
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
997 998
                            }
                            FactTextField {
999 1000
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.aspectRatio
1001
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
1002
                            }
1003

1004
                            QGCLabel {
1005 1006
                                text:                   qsTr("Disable When Disarmed")
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible
1007
                            }
1008
                            FactCheckBox {
1009 1010 1011
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.disableWhenDisarmed
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible
1012
                            }
1013 1014
                        }
                    }
1015

1016
                    Item { width: 1; height: _margins }
1017

1018
                    QGCLabel {
1019 1020
                        id:                             videoRecSectionLabel
                        text:                           qsTr("Video Recording")
1021
                        visible:                        (QGroundControl.settingsManager.videoSettings.visible && _isGst) || QGroundControl.videoManager.autoStreamConfigured
1022
                    }
1023
                    Rectangle {
1024
                        Layout.preferredWidth:          videoRecCol.width  + (_margins * 2)
1025 1026 1027 1028
                        Layout.preferredHeight:         videoRecCol.height + (_margins * 2)
                        Layout.fillWidth:               true
                        color:                          qgcPal.windowShade
                        visible:                        videoRecSectionLabel.visible
1029 1030 1031 1032 1033 1034 1035 1036

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

1038
                            QGCLabel {
1039 1040
                                text:                   qsTr("Auto-Delete Files")
                                visible:                QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
1041 1042
                            }
                            FactCheckBox {
1043 1044 1045
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.enableStorageLimit
                                visible:                QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
1046
                            }
1047

1048
                            QGCLabel {
1049 1050
                                text:                   qsTr("Max Storage Usage")
                                visible:                QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
1051 1052
                            }
                            FactTextField {
1053 1054 1055
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.maxVideoSize
                                visible:                QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
1056
                            }
1057

1058
                            QGCLabel {
1059 1060
                                text:                   qsTr("Video File Format")
                                visible:                QGroundControl.settingsManager.videoSettings.recordingFormat.visible
1061 1062
                            }
                            FactComboBox {
1063 1064 1065
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.recordingFormat
                                visible:                QGroundControl.settingsManager.videoSettings.recordingFormat.visible
1066
                            }
1067 1068 1069
                        }
                    }

1070 1071
                    Item { width: 1; height: _margins; visible: videoRecSectionLabel.visible }

1072
                    QGCLabel {
1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090
                        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
1091 1092

                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
1093
                                text:           qsTr("Indoor Image")
1094
                                visible:        _userBrandImageIndoor.visible
1095 1096 1097
                            }
                            QGCTextField {
                                readOnly:           true
1098
                                Layout.fillWidth:   true
1099
                                text:               _userBrandImageIndoor.valueString.replace("file:///","")
1100 1101
                            }
                            QGCButton {
1102
                                text:       qsTr("Browse")
1103 1104
                                onClicked:  userBrandImageIndoorBrowseDialog.openForLoad()
                                QGCFileDialog {
1105 1106 1107 1108 1109 1110
                                    id:                 userBrandImageIndoorBrowseDialog
                                    title:              qsTr("Choose custom brand image file")
                                    folder:             _userBrandImageIndoor.rawValue.replace("file:///","")
                                    selectExisting:     true
                                    selectFolder:       false
                                    onAcceptedForLoad:  _userBrandImageIndoor.rawValue = "file:///" + file
1111
                                }
1112 1113
                            }

1114
                            QGCLabel {
1115
                                text:       qsTr("Outdoor Image")
1116
                                visible:    _userBrandImageOutdoor.visible
1117
                            }
1118 1119
                            QGCTextField {
                                readOnly:           true
1120
                                Layout.fillWidth:   true
1121
                                text:                _userBrandImageOutdoor.valueString.replace("file:///","")
1122 1123
                            }
                            QGCButton {
1124
                                text:       qsTr("Browse")
1125 1126
                                onClicked:  userBrandImageOutdoorBrowseDialog.openForLoad()
                                QGCFileDialog {
1127 1128 1129 1130 1131 1132
                                    id:                 userBrandImageOutdoorBrowseDialog
                                    title:              qsTr("Choose custom brand image file")
                                    folder:             _userBrandImageOutdoor.rawValue.replace("file:///","")
                                    selectExisting:     true
                                    selectFolder:       false
                                    onAcceptedForLoad:  _userBrandImageOutdoor.rawValue = "file:///" + file
1133 1134 1135
                                }
                            }
                            QGCButton {
1136 1137 1138
                                text:               qsTr("Reset Default Brand Image")
                                Layout.columnSpan:  3
                                Layout.alignment:   Qt.AlignHCenter
1139 1140 1141 1142
                                onClicked:  {
                                    _userBrandImageIndoor.rawValue = ""
                                    _userBrandImageOutdoor.rawValue = ""
                                }
1143 1144
                            }
                        }
1145
                    }
1146

1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158
                    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
            }
1159 1160
    }
}