GeneralSettings.qml 65.6 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
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 * 28
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 200
                                QGCLabel {
                                    text:       qsTr("Stream GCS Position")
201
                                    visible:    _followTarget.visible
202 203 204 205 206
                                }
                                FactComboBox {
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   _followTarget
                                    indexModel:             false
207
                                    visible:                _followTarget.visible
208
                                }
209
                            }
Gus Grubba's avatar
Gus Grubba committed
210
                        }
211

212 213 214 215 216 217 218
                        Item {
                            id:                 miscColItem
                            anchors.margins:    _margins
                            anchors.left:       parent.left
                            anchors.right:      parent.right
                            anchors.top:        comboGridItem.bottom
                            height:             miscCol.height
219

220 221 222 223
                            ColumnLayout {
                                id:                         miscCol
                                anchors.horizontalCenter:   parent.horizontalCenter
                                spacing:                    _margins
224

225 226 227
                                RowLayout {
                                    Layout.fillWidth:   false
                                    Layout.alignment:   Qt.AlignHCenter
228
                                    visible:             _appFontPointSize.visible
229 230 231 232 233 234 235 236 237 238 239 240 241

                                    QGCLabel {
                                        text:   qsTr("Font Size:")
                                    }
                                    QGCButton {
                                        Layout.preferredWidth:  height
                                        Layout.preferredHeight: baseFontEdit.height
                                        text:                   "-"
                                        onClicked: {
                                            if (_appFontPointSize.value > _appFontPointSize.min) {
                                                _appFontPointSize.value = _appFontPointSize.value - 1
                                            }
                                        }
242
                                    }
243 244 245 246 247 248 249 250 251 252 253 254 255 256
                                    FactTextField {
                                        id:                     baseFontEdit
                                        Layout.preferredWidth:  _valueFieldWidth
                                        fact:                   QGroundControl.settingsManager.appSettings.appFontPointSize
                                    }
                                    QGCButton {
                                        Layout.preferredWidth:  height
                                        Layout.preferredHeight: baseFontEdit.height
                                        text:                   "+"
                                        onClicked: {
                                            if (_appFontPointSize.value < _appFontPointSize.max) {
                                                _appFontPointSize.value = _appFontPointSize.value + 1
                                            }
                                        }
257 258 259
                                    }
                                }

Gus Grubba's avatar
Gus Grubba committed
260 261 262
                                FactCheckBox {
                                    text:       qsTr("Use Vehicle Pairing")
                                    fact:       _usePairing
263
                                    visible:    _usePairing.visible && QGroundControl.supportsPairing
Gus Grubba's avatar
Gus Grubba committed
264 265 266
                                    property Fact _usePairing: QGroundControl.settingsManager.appSettings.usePairing
                                }

267 268 269
                                FactCheckBox {
                                    text:       qsTr("Mute all audio output")
                                    fact:       _audioMuted
270
                                    visible:    _audioMuted.visible
271
                                    property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted
272
                                }
273

274 275 276
                                FactCheckBox {
                                    text:       qsTr("Check for Internet connection")
                                    fact:       _checkInternet
Gus Grubba's avatar
Gus Grubba committed
277
                                    visible:    _checkInternet && _checkInternet.visible
278 279 280
                                    property Fact _checkInternet: QGroundControl.settingsManager.appSettings.checkInternet
                                }

281 282 283
                                FactCheckBox {
                                    text:       qsTr("AutoLoad Missions")
                                    fact:       _autoLoad
Gus Grubba's avatar
Gus Grubba committed
284
                                    visible:    _autoLoad && _autoLoad.visible
285 286 287

                                    property Fact _autoLoad: QGroundControl.settingsManager.appSettings.autoLoadMissions
                                }
288 289

                                QGCCheckBox {
290 291 292
                                    id:         clearCheck
                                    text:       qsTr("Clear all settings on next start")
                                    checked:    false
293
                                    onClicked: {
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
                                        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
310 311
                                        }
                                    }
312
                                }
313

314 315 316 317 318 319
                                RowLayout {
                                    visible: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible

                                    QGCCheckBox {
                                        id:         announcePercentCheckbox
                                        text:       qsTr("Announce battery lower than")
320
                                        checked:    _percentRemainingAnnounce.value !== 0
321 322 323 324 325 326 327 328 329 330 331 332 333
                                        onClicked: {
                                            if (checked) {
                                                _percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString
                                            } else {
                                                _percentRemainingAnnounce.value = 0
                                            }
                                        }
                                    }
                                    FactTextField {
                                        fact:                   _percentRemainingAnnounce
                                        Layout.preferredWidth:  _valueFieldWidth
                                        enabled:                announcePercentCheckbox.checked
                                    }
334
                                }
335 336 337
                            }
                        }

338 339
                        //-----------------------------------------------------------------
                        //-- Save path
Don Gagne's avatar
Don Gagne committed
340
                        RowLayout {
341 342 343 344 345
                            id:                 pathRow
                            anchors.margins:    _margins
                            anchors.left:       parent.left
                            anchors.right:      parent.right
                            anchors.top:        miscColItem.bottom
346
                            visible:            _savePath.visible && !ScreenTools.isMobile
347 348 349 350 351

                            QGCLabel { text: qsTr("Application Load/Save Path") }
                            QGCTextField {
                                Layout.fillWidth:   true
                                readOnly:           true
352
                                text:               _savePath.rawValue === "" ? qsTr("<not set>") : _savePath.value
353 354
                            }
                            QGCButton {
355
                                text:       qsTr("Browse")
356 357 358
                                onClicked:  savePathBrowseDialog.openForLoad()
                                QGCFileDialog {
                                    id:             savePathBrowseDialog
359
                                    title:          qsTr("Choose the location to save/load files")
360
                                    folder:         _savePath.rawValue
361
                                    selectExisting: true
362
                                    selectFolder:   true
363
                                    onAcceptedForLoad: _savePath.rawValue = file
364
                                }
365 366
                            }
                        }
Don Gagne's avatar
Don Gagne committed
367
                    }
368

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

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

                    Item { width: 1; height: _margins }
444 445 446 447 448 449 450 451 452 453 454
                    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
455

456 457 458 459 460 461
                        ColumnLayout {
                            id:                         flyViewCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
462

463
                            FactCheckBox {
464
                                text:       qsTr("Use Preflight Checklist")
465
                                fact:       _useChecklist
466
                                visible:    _useChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
467

468
                                property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist
469
                            }
Don Gagne's avatar
Don Gagne committed
470

471 472 473
                            FactCheckBox {
                                text:       qsTr("Show Telemetry Log Replay Status Bar")
                                fact:       _showLogReplayStatusBar
474
                                visible:    _showLogReplayStatusBar.visible
475 476 477 478

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

479 480
                            FactCheckBox {
                                text:       qsTr("Virtual Joystick")
481
                                visible:    _virtualJoystick.visible
482 483 484
                                fact:       _virtualJoystick

                                property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick
485 486
                            }

487 488
                            FactCheckBox {
                                text:       qsTr("Auto-Center throttle")
489
                                visible:    _virtualJoystickCentralized.visible && activeVehicle && (activeVehicle.sub || activeVehicle.rover)
490 491
                                fact:       _virtualJoystickCentralized
                                Layout.leftMargin: _margins
492

493 494
                                property Fact _virtualJoystickCentralized: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized
                            }
495
                            FactCheckBox {
496
                                text:       qsTr("Use Vertical Instrument Panel")
497
                                visible:    _alternateInstrumentPanel.visible
498 499 500 501
                                fact:       _alternateInstrumentPanel

                                property Fact _alternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel
                            }
502
                            FactCheckBox {
503
                                text:       qsTr("Show additional heading indicators on Compass")
504
                                visible:    _showAdditionalIndicatorsCompass.visible
505
                                fact:       _showAdditionalIndicatorsCompass
506

507
                                property Fact _showAdditionalIndicatorsCompass: QGroundControl.settingsManager.flyViewSettings.showAdditionalIndicatorsCompass
508 509
                            }
                            FactCheckBox {
510
                                text:       qsTr("Lock Compass Nose-Up")
511
                                visible:    _lockNoseUpCompass.visible
512
                                fact:       _lockNoseUpCompass
513

514
                                property Fact _lockNoseUpCompass: QGroundControl.settingsManager.flyViewSettings.lockNoseUpCompass
515
                            }
516

517

518 519 520
                            GridLayout {
                                columns: 2

521 522 523 524 525
                                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
526
                                    text:                   qsTr("Guided Minimum Altitude")
527
                                    visible:                parent._guidedMinimumAltitude.visible
528
                                }
529 530
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
531
                                    visible:                parent._guidedMinimumAltitude.visible
532
                                    fact:                   parent._guidedMinimumAltitude
533 534
                                }

535
                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
536
                                    text:                   qsTr("Guided Maximum Altitude")
537
                                    visible:                parent._guidedMaximumAltitude.visible
538
                                }
539 540
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
541
                                    visible:                parent._guidedMaximumAltitude.visible
542 543 544 545
                                    fact:                   parent._guidedMaximumAltitude
                                }

                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
546
                                    text:                   qsTr("Go To Location Max Distance")
547
                                    visible:                parent._maxGoToLocationDistance.visible
548
                                }
549 550
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
551
                                    visible:                parent._maxGoToLocationDistance.visible
552
                                    fact:                   parent._maxGoToLocationDistance
553
                                }
554
                            }
555 556
                        }
                    }
557

558
                    Item { width: 1; height: _margins }
559

560 561 562 563 564 565 566 567 568 569 570
                    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
571

572 573 574 575 576 577
                        ColumnLayout {
                            id:                         planViewCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
578

579 580 581 582 583 584 585 586
                            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
587
                                }
588
                            }
589
                        }
590
                    }
591

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

594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633
                    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
                                    }
                                }
634
                            }
635

636 637 638 639 640 641 642 643 644 645
                            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")
646
                                }
647 648 649
                                QGCComboBox {
                                    id:                     nmeaPortCombo
                                    Layout.preferredWidth:  _comboFieldWidth
650

651 652 653 654 655 656 657 658 659
                                    model:  ListModel {
                                    }

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

663 664 665 666 667
                                        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;
668 669 670
                                        if (QGroundControl.linkManager.serialPorts.length === 0) {
                                            nmeaPortCombo.model.append({text: "Serial <none available>"})
                                        }
671 672 673
                                    }
                                }

674
                                QGCLabel {
675
                                    visible:          nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled
676 677 678
                                    text:             qsTr("NMEA GPS Baudrate")
                                }
                                QGCComboBox {
679
                                    visible:                nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled
680 681 682 683 684 685 686 687
                                    id:                     nmeaBaudCombo
                                    Layout.preferredWidth:  _comboFieldWidth
                                    model:                  [4800, 9600, 19200, 38400, 57600, 115200]

                                    onActivated: {
                                        if (index != -1) {
                                            QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.value = textAt(index);
                                        }
688
                                    }
689 690 691
                                    Component.onCompleted: {
                                        var index = nmeaBaudCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.valueString);
                                        nmeaBaudCombo.currentIndex = index;
692 693
                                    }
                                }
694 695 696 697 698 699 700 701 702 703

                                QGCLabel {
                                    text:       qsTr("NMEA stream UDP port")
                                    visible:    nmeaPortCombo.currentText === gpsUdpPort
                                }
                                FactTextField {
                                    visible:                nmeaPortCombo.currentText === gpsUdpPort
                                    Layout.preferredWidth:  _valueFieldWidth
                                    fact:                   QGroundControl.settingsManager.autoConnectSettings.nmeaUdpPort
                                }
704
                            }
705 706
                        }
                    }
707

708 709
                    Item { width: 1; height: _margins }

Don Gagne's avatar
Don Gagne committed
710
                    QGCLabel {
711
                        id:         rtkSectionLabel
712
                        text:       qsTr("RTK GPS")
713
                        visible:    QGroundControl.settingsManager.rtkSettings.visible
Don Gagne's avatar
Don Gagne committed
714
                    }
715 716 717 718 719 720 721 722 723 724 725
                    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
726
                            Layout.fillWidth:           true
727
                            anchors.horizontalCenter:   parent.horizontalCenter
728
                            columns:                    3
729

Gus Grubba's avatar
Gus Grubba committed
730
                            property var  rtkSettings:      QGroundControl.settingsManager.rtkSettings
731
                            property bool useFixedPosition: rtkSettings.useFixedBasePosition.rawValue
732
                            property real firstColWidth:    ScreenTools.defaultFontPixelWidth * 3
733

734 735
                            QGCRadioButton {
                                text:               qsTr("Perform Survey-In")
736 737
                                visible:            rtkGrid.rtkSettings.useFixedBasePosition.visible
                                checked:            rtkGrid.rtkSettings.useFixedBasePosition.value === false
738
                                Layout.columnSpan:  3
739
                                onClicked:          rtkGrid.rtkSettings.useFixedBasePosition.value = false
740
                            }
741

742
                            Item { width: rtkGrid.firstColWidth; height: 1 }
743
                            QGCLabel {
744 745
                                text:               rtkGrid.rtkSettings.surveyInAccuracyLimit.shortDescription
                                visible:            rtkGrid.rtkSettings.surveyInAccuracyLimit.visible
Gus Grubba's avatar
Gus Grubba committed
746
                                enabled:            !rtkGrid.useFixedPosition
747
                            }
748
                            FactTextField {
749 750
                                fact:               rtkGrid.rtkSettings.surveyInAccuracyLimit
                                visible:            rtkGrid.rtkSettings.surveyInAccuracyLimit.visible
Gus Grubba's avatar
Gus Grubba committed
751
                                enabled:            !rtkGrid.useFixedPosition
752
                                Layout.preferredWidth:  _valueFieldWidth
753
                            }
754

755
                            Item { width: rtkGrid.firstColWidth; height: 1 }
756
                            QGCLabel {
757 758
                                text:               rtkGrid.rtkSettings.surveyInMinObservationDuration.shortDescription
                                visible:            rtkGrid.rtkSettings.surveyInMinObservationDuration.visible
Gus Grubba's avatar
Gus Grubba committed
759
                                enabled:            !rtkGrid.useFixedPosition
760
                            }
761
                            FactTextField {
762 763
                                fact:               rtkGrid.rtkSettings.surveyInMinObservationDuration
                                visible:            rtkGrid.rtkSettings.surveyInMinObservationDuration.visible
Gus Grubba's avatar
Gus Grubba committed
764
                                enabled:            !rtkGrid.useFixedPosition
765
                                Layout.preferredWidth:  _valueFieldWidth
766
                            }
767

768 769
                            QGCRadioButton {
                                text:               qsTr("Use Specified Base Position")
770 771 772
                                visible:            rtkGrid.rtkSettings.useFixedBasePosition.visible
                                checked:            rtkGrid.rtkSettings.useFixedBasePosition.value === true
                                onClicked:          rtkGrid.rtkSettings.useFixedBasePosition.value = true
773
                                Layout.columnSpan:  3
774
                            }
775

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

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

802
                            Item { width: rtkGrid.firstColWidth; height: 1 }
803
                            QGCLabel {
804 805
                                text:           rtkGrid.rtkSettings.fixedBasePositionAltitude.shortDescription
                                visible:        rtkGrid.rtkSettings.fixedBasePositionAltitude.visible
806
                                enabled:        rtkGrid.useFixedPosition
807 808
                            }
                            FactTextField {
809 810
                                fact:               rtkGrid.rtkSettings.fixedBasePositionAltitude
                                visible:            rtkGrid.rtkSettings.fixedBasePositionAltitude.visible
811 812 813
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
814

815
                            Item { width: rtkGrid.firstColWidth; height: 1 }
816
                            QGCLabel {
817 818
                                text:           rtkGrid.rtkSettings.fixedBasePositionAccuracy.shortDescription
                                visible:        rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible
819
                                enabled:        rtkGrid.useFixedPosition
820 821
                            }
                            FactTextField {
822 823
                                fact:               rtkGrid.rtkSettings.fixedBasePositionAccuracy
                                visible:            rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible
824 825 826
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
827

828
                            Item { width: rtkGrid.firstColWidth; height: 1 }
829 830
                            QGCButton {
                                text:               qsTr("Save Current Base Position")
831
                                enabled:            QGroundControl.gpsRtk && QGroundControl.gpsRtk.valid.value
832
                                Layout.columnSpan:  2
833 834 835 836 837 838
                                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
                                }
839
                            }
840
                        }
841
                    }
842 843

                    Item { width: 1; height: _margins }
844

845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897
                    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 }

898
                    QGCLabel {
899 900
                        id:         videoSectionLabel
                        text:       qsTr("Video")
901
                        visible:    QGroundControl.settingsManager.videoSettings.visible && !QGroundControl.videoManager.autoStreamConfigured
902
                    }
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917
                    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
918
                            QGCLabel {
919 920
                                text:                   qsTr("Video Source")
                                visible:                QGroundControl.settingsManager.videoSettings.videoSource.visible
921
                            }
922
                            FactComboBox {
923 924 925 926 927
                                id:                     videoSource
                                Layout.preferredWidth:  _comboFieldWidth
                                indexModel:             false
                                fact:                   QGroundControl.settingsManager.videoSettings.videoSource
                                visible:                QGroundControl.settingsManager.videoSettings.videoSource.visible
928
                            }
929

930
                            QGCLabel {
931
                                text:                   qsTr("UDP Port")
932
                                visible:                (_isUDP264 || _isUDP265 || _isMPEGTS)  && QGroundControl.settingsManager.videoSettings.udpPort.visible
933
                            }
934
                            FactTextField {
935 936
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.udpPort
937
                                visible:                (_isUDP264 || _isUDP265 || _isMPEGTS) && QGroundControl.settingsManager.videoSettings.udpPort.visible
938
                            }
939

940
                            QGCLabel {
941 942
                                text:                   qsTr("RTSP URL")
                                visible:                _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible
943
                            }
944
                            FactTextField {
945 946
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.rtspUrl
947
                                visible:                _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible
948
                            }
949

950
                            QGCLabel {
951 952
                                text:                   qsTr("TCP URL")
                                visible:                _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible
953 954
                            }
                            FactTextField {
955 956
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.tcpUrl
957
                                visible:                _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible
958
                            }
959
                            QGCLabel {
960
                                text:                   qsTr("Aspect Ratio")
961
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
962 963
                            }
                            FactTextField {
964 965
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.aspectRatio
966
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
967
                            }
968

969
                            QGCLabel {
970 971
                                text:                   qsTr("Disable When Disarmed")
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible
972
                            }
973
                            FactCheckBox {
974 975 976
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.disableWhenDisarmed
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible
977
                            }
978 979
                        }
                    }
980

981
                    Item { width: 1; height: _margins }
982

983
                    QGCLabel {
984 985
                        id:                             videoRecSectionLabel
                        text:                           qsTr("Video Recording")
986
                        visible:                        (QGroundControl.settingsManager.videoSettings.visible && _isGst) || QGroundControl.videoManager.autoStreamConfigured
987
                    }
988
                    Rectangle {
989
                        Layout.preferredWidth:          videoRecCol.width  + (_margins * 2)
990 991 992 993
                        Layout.preferredHeight:         videoRecCol.height + (_margins * 2)
                        Layout.fillWidth:               true
                        color:                          qgcPal.windowShade
                        visible:                        videoRecSectionLabel.visible
994 995 996 997 998 999 1000 1001

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

1003
                            QGCLabel {
1004 1005
                                text:                   qsTr("Auto-Delete Files")
                                visible:                QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
1006 1007
                            }
                            FactCheckBox {
1008 1009 1010
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.enableStorageLimit
                                visible:                QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
1011
                            }
1012

1013
                            QGCLabel {
1014 1015
                                text:                   qsTr("Max Storage Usage")
                                visible:                QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
1016 1017
                            }
                            FactTextField {
1018 1019 1020
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.maxVideoSize
                                visible:                QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
1021
                            }
1022

1023
                            QGCLabel {
1024 1025
                                text:                   qsTr("Video File Format")
                                visible:                QGroundControl.settingsManager.videoSettings.recordingFormat.visible
1026 1027
                            }
                            FactComboBox {
1028 1029 1030
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.recordingFormat
                                visible:                QGroundControl.settingsManager.videoSettings.recordingFormat.visible
1031
                            }
1032 1033 1034
                        }
                    }

1035 1036
                    Item { width: 1; height: _margins; visible: videoRecSectionLabel.visible }

1037
                    QGCLabel {
1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
                        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
1056 1057

                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
1058
                                text:           qsTr("Indoor Image")
1059
                                visible:        _userBrandImageIndoor.visible
1060 1061 1062
                            }
                            QGCTextField {
                                readOnly:           true
1063
                                Layout.fillWidth:   true
1064
                                text:               _userBrandImageIndoor.valueString.replace("file:///","")
1065 1066
                            }
                            QGCButton {
1067
                                text:       qsTr("Browse")
1068 1069
                                onClicked:  userBrandImageIndoorBrowseDialog.openForLoad()
                                QGCFileDialog {
1070 1071 1072 1073 1074 1075
                                    id:                 userBrandImageIndoorBrowseDialog
                                    title:              qsTr("Choose custom brand image file")
                                    folder:             _userBrandImageIndoor.rawValue.replace("file:///","")
                                    selectExisting:     true
                                    selectFolder:       false
                                    onAcceptedForLoad:  _userBrandImageIndoor.rawValue = "file:///" + file
1076
                                }
1077 1078
                            }

1079
                            QGCLabel {
1080
                                text:       qsTr("Outdoor Image")
1081
                                visible:    _userBrandImageOutdoor.visible
1082
                            }
1083 1084
                            QGCTextField {
                                readOnly:           true
1085
                                Layout.fillWidth:   true
1086
                                text:                _userBrandImageOutdoor.valueString.replace("file:///","")
1087 1088
                            }
                            QGCButton {
1089
                                text:       qsTr("Browse")
1090 1091
                                onClicked:  userBrandImageOutdoorBrowseDialog.openForLoad()
                                QGCFileDialog {
1092 1093 1094 1095 1096 1097
                                    id:                 userBrandImageOutdoorBrowseDialog
                                    title:              qsTr("Choose custom brand image file")
                                    folder:             _userBrandImageOutdoor.rawValue.replace("file:///","")
                                    selectExisting:     true
                                    selectFolder:       false
                                    onAcceptedForLoad:  _userBrandImageOutdoor.rawValue = "file:///" + file
1098 1099 1100
                                }
                            }
                            QGCButton {
1101 1102 1103
                                text:               qsTr("Reset Default Brand Image")
                                Layout.columnSpan:  3
                                Layout.alignment:   Qt.AlignHCenter
1104 1105 1106 1107
                                onClicked:  {
                                    _userBrandImageIndoor.rawValue = ""
                                    _userBrandImageOutdoor.rawValue = ""
                                }
1108 1109
                            }
                        }
1110
                    }
1111

1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
                    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
            }
1124 1125
    }
}