GeneralSettings.qml 63.3 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 Fact _mapProvider:                 QGroundControl.settingsManager.flightMapSettings.mapProvider
    property Fact _mapType:                     QGroundControl.settingsManager.flightMapSettings.mapType
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
Gus Grubba's avatar
Gus Grubba committed
163
                                    visible:    _mapProvider && _mapProvider.visible
164
                                }
165 166 167 168
                                FactComboBox {
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   _mapProvider
                                    indexModel:             false
Gus Grubba's avatar
Gus Grubba committed
169
                                    visible:                _mapProvider && _mapProvider.visible
170 171 172 173
                                }

                                QGCLabel {
                                    text:       qsTr("Map Type")
Gus Grubba's avatar
Gus Grubba committed
174
                                    visible:    _mapType && _mapType.visible
175 176 177 178 179 180
                                }
                                FactComboBox {
                                    id:                     mapTypes
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   _mapType
                                    indexModel:             false
Gus Grubba's avatar
Gus Grubba committed
181
                                    visible:                _mapType && _mapType.visible
182 183 184 185
                                    Connections {
                                        target: QGroundControl.settingsManager.flightMapSettings
                                        onMapTypeChanged: {
                                            mapTypes.model = _mapType.enumStrings
186 187
                                        }
                                    }
188 189
                                }

190 191
                                QGCLabel {
                                    text:       qsTr("Stream GCS Position")
Gus Grubba's avatar
Gus Grubba committed
192
                                    visible:    _followTarget ? _followTarget.visible : false
193 194 195 196 197
                                }
                                FactComboBox {
                                    Layout.preferredWidth:  _comboFieldWidth
                                    fact:                   _followTarget
                                    indexModel:             false
Gus Grubba's avatar
Gus Grubba committed
198
                                    visible:                _followTarget ? _followTarget.visible : false
199
                                }
200
                            }
Gus Grubba's avatar
Gus Grubba committed
201
                        }
202

203 204 205 206 207 208 209
                        Item {
                            id:                 miscColItem
                            anchors.margins:    _margins
                            anchors.left:       parent.left
                            anchors.right:      parent.right
                            anchors.top:        comboGridItem.bottom
                            height:             miscCol.height
210

211 212 213 214
                            ColumnLayout {
                                id:                         miscCol
                                anchors.horizontalCenter:   parent.horizontalCenter
                                spacing:                    _margins
215

216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
                                RowLayout {
                                    Layout.fillWidth:   false
                                    Layout.alignment:   Qt.AlignHCenter
                                    visible:            _appFontPointSize ? _appFontPointSize.visible : false

                                    QGCLabel {
                                        text:   qsTr("Font Size:")
                                    }
                                    QGCButton {
                                        Layout.preferredWidth:  height
                                        Layout.preferredHeight: baseFontEdit.height
                                        text:                   "-"
                                        onClicked: {
                                            if (_appFontPointSize.value > _appFontPointSize.min) {
                                                _appFontPointSize.value = _appFontPointSize.value - 1
                                            }
                                        }
233
                                    }
234 235 236 237 238 239 240 241 242 243 244 245 246 247
                                    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
                                            }
                                        }
248 249 250
                                    }
                                }

Gus Grubba's avatar
Gus Grubba committed
251 252 253
                                FactCheckBox {
                                    text:       qsTr("Use Vehicle Pairing")
                                    fact:       _usePairing
254
                                    visible:    _usePairing && _usePairing.visible && QGroundControl.supportsPairing
Gus Grubba's avatar
Gus Grubba committed
255 256 257
                                    property Fact _usePairing: QGroundControl.settingsManager.appSettings.usePairing
                                }

258 259 260
                                FactCheckBox {
                                    text:       qsTr("Mute all audio output")
                                    fact:       _audioMuted
Gus Grubba's avatar
Gus Grubba committed
261
                                    visible:    _audioMuted && _audioMuted.visible
262
                                    property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted
263
                                }
264

265 266 267
                                FactCheckBox {
                                    text:       qsTr("Check for Internet connection")
                                    fact:       _checkInternet
Gus Grubba's avatar
Gus Grubba committed
268
                                    visible:    _checkInternet && _checkInternet.visible
269 270 271
                                    property Fact _checkInternet: QGroundControl.settingsManager.appSettings.checkInternet
                                }

272 273 274
                                FactCheckBox {
                                    text:       qsTr("AutoLoad Missions")
                                    fact:       _autoLoad
Gus Grubba's avatar
Gus Grubba committed
275
                                    visible:    _autoLoad && _autoLoad.visible
276 277 278

                                    property Fact _autoLoad: QGroundControl.settingsManager.appSettings.autoLoadMissions
                                }
279 280

                                QGCCheckBox {
281 282 283
                                    id:         clearCheck
                                    text:       qsTr("Clear all settings on next start")
                                    checked:    false
284
                                    onClicked: {
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
                                        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
301 302
                                        }
                                    }
303
                                }
304

305 306 307 308 309 310
                                RowLayout {
                                    visible: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible

                                    QGCCheckBox {
                                        id:         announcePercentCheckbox
                                        text:       qsTr("Announce battery lower than")
Gus Grubba's avatar
Gus Grubba committed
311
                                        checked:    _percentRemainingAnnounce && _percentRemainingAnnounce.value !== 0
312 313 314 315 316 317 318 319 320 321 322 323 324
                                        onClicked: {
                                            if (checked) {
                                                _percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString
                                            } else {
                                                _percentRemainingAnnounce.value = 0
                                            }
                                        }
                                    }
                                    FactTextField {
                                        fact:                   _percentRemainingAnnounce
                                        Layout.preferredWidth:  _valueFieldWidth
                                        enabled:                announcePercentCheckbox.checked
                                    }
325
                                }
326 327 328
                            }
                        }

329 330
                        //-----------------------------------------------------------------
                        //-- Save path
Don Gagne's avatar
Don Gagne committed
331
                        RowLayout {
332 333 334 335 336
                            id:                 pathRow
                            anchors.margins:    _margins
                            anchors.left:       parent.left
                            anchors.right:      parent.right
                            anchors.top:        miscColItem.bottom
Gus Grubba's avatar
Gus Grubba committed
337
                            visible:            (_savePath && _savePath.visible) && !ScreenTools.isMobile
338 339 340 341 342

                            QGCLabel { text: qsTr("Application Load/Save Path") }
                            QGCTextField {
                                Layout.fillWidth:   true
                                readOnly:           true
Gus Grubba's avatar
Gus Grubba committed
343
                                text:               _savePath ? (_savePath.rawValue === "" ? qsTr("<not set>") : _savePath.value) : ""
344 345
                            }
                            QGCButton {
346
                                text:       qsTr("Browse")
347 348 349
                                onClicked:  savePathBrowseDialog.openForLoad()
                                QGCFileDialog {
                                    id:             savePathBrowseDialog
350
                                    title:          qsTr("Choose the location to save/load files")
Gus Grubba's avatar
Gus Grubba committed
351
                                    folder:         _savePath ? _savePath.rawValue : ""
352
                                    selectExisting: true
353
                                    selectFolder:   true
354
                                    onAcceptedForLoad: _savePath.rawValue = file
355
                                }
356 357
                            }
                        }
Don Gagne's avatar
Don Gagne committed
358
                    }
359

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

                    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
407 408
                            FactCheckBox {
                                id:         promptSaveLog
Gus Grubba's avatar
Gus Grubba committed
409
                                text:       qsTr("Save log after each flight")
410
                                fact:       _telemetrySave
Gus Grubba's avatar
Gus Grubba committed
411
                                visible:    _telemetrySave && _telemetrySave.visible
412
                                enabled:    !disableDataPersistence.checked
413 414 415 416
                                property Fact _telemetrySave: QGroundControl.settingsManager.appSettings.telemetrySave
                            }
                            FactCheckBox {
                                id:         logIfNotArmed
Gus Grubba's avatar
Gus Grubba committed
417
                                text:       qsTr("Save logs even if vehicle was not armed")
418
                                fact:       _telemetrySaveNotArmed
Gus Grubba's avatar
Gus Grubba committed
419
                                visible:    _telemetrySaveNotArmed && _telemetrySaveNotArmed.visible
420
                                enabled:    promptSaveLog.checked && !disableDataPersistence.checked
421 422
                                property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed
                            }
423
                        }
424
                    }
425 426

                    Item { width: 1; height: _margins }
427 428 429 430 431 432 433 434 435 436 437
                    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
438

439 440 441 442 443 444
                        ColumnLayout {
                            id:                         flyViewCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
445

446
                            FactCheckBox {
447
                                text:       qsTr("Use Preflight Checklist")
448
                                fact:       _useChecklist
Gus Grubba's avatar
Gus Grubba committed
449
                                visible:    _useChecklist && _useChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
450

451
                                property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist
452
                            }
Don Gagne's avatar
Don Gagne committed
453

454 455 456
                            FactCheckBox {
                                text:       qsTr("Show Telemetry Log Replay Status Bar")
                                fact:       _showLogReplayStatusBar
Gus Grubba's avatar
Gus Grubba committed
457
                                visible:    _showLogReplayStatusBar && _showLogReplayStatusBar.visible
458 459 460 461

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

462 463
                            FactCheckBox {
                                text:       qsTr("Virtual Joystick")
Gus Grubba's avatar
Gus Grubba committed
464
                                visible:    _virtualJoystick && _virtualJoystick.visible
465 466 467
                                fact:       _virtualJoystick

                                property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick
468 469
                            }

470 471
                            FactCheckBox {
                                text:       qsTr("Auto-Center throttle")
Gus Grubba's avatar
Gus Grubba committed
472
                                visible:    _virtualJoystickCentralized && _virtualJoystickCentralized.visible && activeVehicle && (activeVehicle.sub || activeVehicle.rover)
473 474
                                fact:       _virtualJoystickCentralized
                                Layout.leftMargin: _margins
475

476 477
                                property Fact _virtualJoystickCentralized: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized
                            }
478
                            FactCheckBox {
479
                                text:       qsTr("Use Vertical Instrument Panel")
Gus Grubba's avatar
Gus Grubba committed
480
                                visible:    _alternateInstrumentPanel && _alternateInstrumentPanel.visible
481 482 483 484
                                fact:       _alternateInstrumentPanel

                                property Fact _alternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel
                            }
485
                            FactCheckBox {
486
                                text:       qsTr("Show additional heading indicators on Compass")
Gus Grubba's avatar
Gus Grubba committed
487
                                visible:    _showAdditionalIndicatorsCompass ? _showAdditionalIndicatorsCompass.visible : false
488
                                fact:       _showAdditionalIndicatorsCompass
489

490
                                property Fact _showAdditionalIndicatorsCompass: QGroundControl.settingsManager.flyViewSettings.showAdditionalIndicatorsCompass
491 492
                            }
                            FactCheckBox {
493
                                text:       qsTr("Lock Compass Nose-Up")
Gus Grubba's avatar
Gus Grubba committed
494
                                visible:    _lockNoseUpCompass ? _lockNoseUpCompass.visible : false
495
                                fact:       _lockNoseUpCompass
496

497
                                property Fact _lockNoseUpCompass: QGroundControl.settingsManager.flyViewSettings.lockNoseUpCompass
498
                            }
499

500

501 502 503
                            GridLayout {
                                columns: 2

504 505 506 507 508
                                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
509 510
                                    text:                   qsTr("Guided Minimum Altitude")
                                    visible:                parent._guidedMinimumAltitude && parent._guidedMinimumAltitude.visible
511
                                }
512 513
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
Gus Grubba's avatar
Gus Grubba committed
514
                                    visible:                parent._guidedMinimumAltitude && parent._guidedMinimumAltitude.visible
515
                                    fact:                   parent._guidedMinimumAltitude
516 517
                                }

518
                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
519 520
                                    text:                   qsTr("Guided Maximum Altitude")
                                    visible:                parent._guidedMaximumAltitude && parent._guidedMaximumAltitude.visible
521
                                }
522 523
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
Gus Grubba's avatar
Gus Grubba committed
524
                                    visible:                parent._guidedMaximumAltitude && parent._guidedMaximumAltitude.visible
525 526 527 528
                                    fact:                   parent._guidedMaximumAltitude
                                }

                                QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
529 530
                                    text:                   qsTr("Go To Location Max Distance")
                                    visible:                parent._maxGoToLocationDistance && parent._maxGoToLocationDistance.visible
531
                                }
532 533
                                FactTextField {
                                    Layout.preferredWidth:  _valueFieldWidth
Gus Grubba's avatar
Gus Grubba committed
534
                                    visible:                parent._maxGoToLocationDistance && parent._maxGoToLocationDistance.visible
535
                                    fact:                   parent._maxGoToLocationDistance
536
                                }
537
                            }
538 539
                        }
                    }
540

541
                    Item { width: 1; height: _margins }
542

543 544 545 546 547 548 549 550 551 552 553
                    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
554

555 556 557 558 559 560
                        ColumnLayout {
                            id:                         planViewCol
                            anchors.margins:            _margins
                            anchors.top:                parent.top
                            anchors.horizontalCenter:   parent.horizontalCenter
                            spacing:                    _margins
561

562 563 564 565 566 567 568 569
                            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
570
                                }
571
                            }
572
                        }
573
                    }
574

575
                    Item { width: 1; height: _margins }
576

577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616
                    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
                                    }
                                }
617
                            }
618

619 620 621 622 623 624 625 626 627 628
                            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")
629
                                }
630 631 632
                                QGCComboBox {
                                    id:                     nmeaPortCombo
                                    Layout.preferredWidth:  _comboFieldWidth
633

634 635 636 637 638 639 640 641 642
                                    model:  ListModel {
                                    }

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

646 647 648 649 650
                                        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;
651 652 653
                                        if (QGroundControl.linkManager.serialPorts.length === 0) {
                                            nmeaPortCombo.model.append({text: "Serial <none available>"})
                                        }
654 655 656
                                    }
                                }

657
                                QGCLabel {
658
                                    visible:          nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled
659 660 661
                                    text:             qsTr("NMEA GPS Baudrate")
                                }
                                QGCComboBox {
662
                                    visible:                nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled
663 664 665 666 667 668 669 670
                                    id:                     nmeaBaudCombo
                                    Layout.preferredWidth:  _comboFieldWidth
                                    model:                  [4800, 9600, 19200, 38400, 57600, 115200]

                                    onActivated: {
                                        if (index != -1) {
                                            QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.value = textAt(index);
                                        }
671
                                    }
672 673 674
                                    Component.onCompleted: {
                                        var index = nmeaBaudCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.valueString);
                                        nmeaBaudCombo.currentIndex = index;
675 676
                                    }
                                }
677 678 679 680 681 682 683 684 685 686

                                QGCLabel {
                                    text:       qsTr("NMEA stream UDP port")
                                    visible:    nmeaPortCombo.currentText === gpsUdpPort
                                }
                                FactTextField {
                                    visible:                nmeaPortCombo.currentText === gpsUdpPort
                                    Layout.preferredWidth:  _valueFieldWidth
                                    fact:                   QGroundControl.settingsManager.autoConnectSettings.nmeaUdpPort
                                }
687
                            }
688 689
                        }
                    }
690

691 692
                    Item { width: 1; height: _margins }

Don Gagne's avatar
Don Gagne committed
693
                    QGCLabel {
694
                        id:         rtkSectionLabel
695
                        text:       qsTr("RTK GPS")
696
                        visible:    QGroundControl.settingsManager.rtkSettings.visible
Don Gagne's avatar
Don Gagne committed
697
                    }
698 699 700 701 702 703 704 705 706 707 708
                    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
709
                            Layout.fillWidth:           true
710
                            anchors.horizontalCenter:   parent.horizontalCenter
711
                            columns:                    3
712

Gus Grubba's avatar
Gus Grubba committed
713 714
                            property var  rtkSettings:      QGroundControl.settingsManager.rtkSettings
                            property bool useFixedPosition: rtkSettings && rtkSettings.useFixedBasePosition.rawValue
715
                            property real firstColWidth:    ScreenTools.defaultFontPixelWidth * 3
716

717 718
                            QGCRadioButton {
                                text:               qsTr("Perform Survey-In")
Gus Grubba's avatar
Gus Grubba committed
719 720 721 722 723 724
                                visible:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.useFixedBasePosition.visible
                                checked:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.useFixedBasePosition.value === false
                                onClicked: {
                                    if(rtkGrid.rtkSettings)
                                        rtkGrid.rtkSettings.useFixedBasePosition.value = false
                                }
725
                                Layout.columnSpan:  3
726
                            }
727

728
                            Item { width: rtkGrid.firstColWidth; height: 1 }
729
                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
730 731 732
                                text:               rtkGrid.rtkSettings ?  rtkGrid.rtkSettings.surveyInAccuracyLimit.shortDescription : ""
                                visible:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.surveyInAccuracyLimit.visible
                                enabled:            !rtkGrid.useFixedPosition
733
                            }
734
                            FactTextField {
Gus Grubba's avatar
Gus Grubba committed
735 736 737
                                fact:               rtkGrid.rtkSettings ?  rtkGrid.rtkSettings.surveyInAccuracyLimit : null
                                visible:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.surveyInAccuracyLimit.visible
                                enabled:            !rtkGrid.useFixedPosition
738
                                Layout.preferredWidth:  _valueFieldWidth
739
                            }
740

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

754 755
                            QGCRadioButton {
                                text:               qsTr("Use Specified Base Position")
Gus Grubba's avatar
Gus Grubba committed
756 757 758 759 760 761
                                visible:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.useFixedBasePosition.visible
                                checked:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.useFixedBasePosition.value === true
                                onClicked: {
                                    if(rtkGrid.rtkSettings)
                                        rtkGrid.rtkSettings.useFixedBasePosition.value = true
                                }
762
                                Layout.columnSpan:  3
763
                            }
764

765
                            Item { width: rtkGrid.firstColWidth; height: 1 }
766
                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
767 768 769
                                text:               rtkGrid.rtkSettings ?  rtkGrid.rtkSettings.fixedBasePositionLatitude.shortDescription : ""
                                visible:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.fixedBasePositionLatitude.visible
                                enabled:            rtkGrid.useFixedPosition
770 771
                            }
                            FactTextField {
Gus Grubba's avatar
Gus Grubba committed
772 773
                                fact:               rtkGrid.rtkSettings ?  rtkGrid.rtkSettings.fixedBasePositionLatitude : null
                                visible:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.fixedBasePositionLatitude.visible
774 775 776
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
777

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

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

804
                            Item { width: rtkGrid.firstColWidth; height: 1 }
805
                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
806 807
                                text:           rtkGrid.rtkSettings ?  rtkGrid.rtkSettings.fixedBasePositionAccuracy.shortDescription : ""
                                visible:        rtkGrid.rtkSettings && rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible
808
                                enabled:        rtkGrid.useFixedPosition
809 810
                            }
                            FactTextField {
Gus Grubba's avatar
Gus Grubba committed
811 812
                                fact:               rtkGrid.rtkSettings ?  rtkGrid.rtkSettings.fixedBasePositionAccuracy : null
                                visible:            rtkGrid.rtkSettings && rtkGrid.rtkSettings.fixedBasePositionAccuracy.visible
813 814 815
                                enabled:            rtkGrid.useFixedPosition
                                Layout.fillWidth:   true
                            }
816

817
                            Item { width: rtkGrid.firstColWidth; height: 1 }
818 819
                            QGCButton {
                                text:               qsTr("Save Current Base Position")
820
                                enabled:            QGroundControl.gpsRtk && QGroundControl.gpsRtk.valid.value
821
                                Layout.columnSpan:  2
822 823 824 825 826 827
                                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
                                }
828
                            }
829
                        }
830
                    }
831 832

                    Item { width: 1; height: _margins }
833

834
                    QGCLabel {
835 836
                        id:         videoSectionLabel
                        text:       qsTr("Video")
837
                        visible:    QGroundControl.settingsManager.videoSettings.visible && !QGroundControl.videoManager.autoStreamConfigured
838
                    }
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853
                    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
854
                            QGCLabel {
855 856
                                text:                   qsTr("Video Source")
                                visible:                QGroundControl.settingsManager.videoSettings.videoSource.visible
857
                            }
858
                            FactComboBox {
859 860 861 862 863
                                id:                     videoSource
                                Layout.preferredWidth:  _comboFieldWidth
                                indexModel:             false
                                fact:                   QGroundControl.settingsManager.videoSettings.videoSource
                                visible:                QGroundControl.settingsManager.videoSettings.videoSource.visible
864
                            }
865

866
                            QGCLabel {
867
                                text:                   qsTr("UDP Port")
868
                                visible:                (_isUDP264 || _isUDP265 || _isMPEGTS)  && QGroundControl.settingsManager.videoSettings.udpPort.visible
869
                            }
870
                            FactTextField {
871 872
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.udpPort
873
                                visible:                (_isUDP264 || _isUDP265 || _isMPEGTS) && QGroundControl.settingsManager.videoSettings.udpPort.visible
874
                            }
875

876
                            QGCLabel {
877 878
                                text:                   qsTr("RTSP URL")
                                visible:                _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible
879
                            }
880
                            FactTextField {
881 882
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.rtspUrl
883
                                visible:                _isRTSP && QGroundControl.settingsManager.videoSettings.rtspUrl.visible
884
                            }
885

886
                            QGCLabel {
887 888
                                text:                   qsTr("TCP URL")
                                visible:                _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible
889 890
                            }
                            FactTextField {
891 892
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.tcpUrl
893
                                visible:                _isTCP && QGroundControl.settingsManager.videoSettings.tcpUrl.visible
894
                            }
895
                            QGCLabel {
896
                                text:                   qsTr("Aspect Ratio")
897
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
898 899
                            }
                            FactTextField {
900 901
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.aspectRatio
902
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
903
                            }
904

905
                            QGCLabel {
906 907
                                text:                   qsTr("Disable When Disarmed")
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible
908
                            }
909
                            FactCheckBox {
910 911 912
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.disableWhenDisarmed
                                visible:                _isGst && QGroundControl.settingsManager.videoSettings.disableWhenDisarmed.visible
913
                            }
914 915
                        }
                    }
916

917
                    Item { width: 1; height: _margins }
918

919
                    QGCLabel {
920 921
                        id:                             videoRecSectionLabel
                        text:                           qsTr("Video Recording")
922
                        visible:                        (QGroundControl.settingsManager.videoSettings.visible && _isGst) || QGroundControl.videoManager.autoStreamConfigured
923
                    }
924
                    Rectangle {
925
                        Layout.preferredWidth:          videoRecCol.width  + (_margins * 2)
926 927 928 929
                        Layout.preferredHeight:         videoRecCol.height + (_margins * 2)
                        Layout.fillWidth:               true
                        color:                          qgcPal.windowShade
                        visible:                        videoRecSectionLabel.visible
930 931 932 933 934 935 936 937

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

939
                            QGCLabel {
940 941
                                text:                   qsTr("Auto-Delete Files")
                                visible:                QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
942 943
                            }
                            FactCheckBox {
944 945 946
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.enableStorageLimit
                                visible:                QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
947
                            }
948

949
                            QGCLabel {
950 951
                                text:                   qsTr("Max Storage Usage")
                                visible:                QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
952 953
                            }
                            FactTextField {
954 955 956
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.maxVideoSize
                                visible:                QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
957
                            }
958

959
                            QGCLabel {
960 961
                                text:                   qsTr("Video File Format")
                                visible:                QGroundControl.settingsManager.videoSettings.recordingFormat.visible
962 963
                            }
                            FactComboBox {
964 965 966
                                Layout.preferredWidth:  _comboFieldWidth
                                fact:                   QGroundControl.settingsManager.videoSettings.recordingFormat
                                visible:                QGroundControl.settingsManager.videoSettings.recordingFormat.visible
967
                            }
968 969 970
                        }
                    }

971 972
                    Item { width: 1; height: _margins; visible: videoRecSectionLabel.visible }

973
                    QGCLabel {
974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991
                        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
992 993

                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
994 995
                                text:           qsTr("Indoor Image")
                                visible:        _userBrandImageIndoor ? _userBrandImageIndoor.visible : false
996 997 998
                            }
                            QGCTextField {
                                readOnly:           true
999
                                Layout.fillWidth:   true
Gus Grubba's avatar
Gus Grubba committed
1000
                                text:               _userBrandImageIndoor ? _userBrandImageIndoor.valueString.replace("file:///","") : ""
1001 1002
                            }
                            QGCButton {
1003
                                text:       qsTr("Browse")
1004 1005 1006
                                onClicked:  userBrandImageIndoorBrowseDialog.openForLoad()
                                QGCFileDialog {
                                    id:             userBrandImageIndoorBrowseDialog
1007
                                    title:          qsTr("Choose custom brand image file")
Gus Grubba's avatar
Gus Grubba committed
1008
                                    folder:         _userBrandImageIndoor ? _userBrandImageIndoor.rawValue.replace("file:///","") : ""
1009 1010
                                    selectExisting: true
                                    selectFolder:   false
Gus Grubba's avatar
Gus Grubba committed
1011 1012 1013 1014
                                    onAcceptedForLoad: {
                                        if(_userBrandImageIndoor)
                                            _userBrandImageIndoor.rawValue = "file:///" + file
                                    }
1015
                                }
1016 1017
                            }

1018
                            QGCLabel {
1019
                                text:       qsTr("Outdoor Image")
Gus Grubba's avatar
Gus Grubba committed
1020
                                visible:    _userBrandImageOutdoor && _userBrandImageOutdoor.visible
1021
                            }
1022 1023
                            QGCTextField {
                                readOnly:           true
1024
                                Layout.fillWidth:   true
Gus Grubba's avatar
Gus Grubba committed
1025
                                text:               _userBrandImageOutdoor ? _userBrandImageOutdoor.valueString.replace("file:///","") : ""
1026 1027
                            }
                            QGCButton {
1028
                                text:       qsTr("Browse")
1029 1030 1031
                                onClicked:  userBrandImageOutdoorBrowseDialog.openForLoad()
                                QGCFileDialog {
                                    id:             userBrandImageOutdoorBrowseDialog
1032
                                    title:          qsTr("Choose custom brand image file")
Gus Grubba's avatar
Gus Grubba committed
1033
                                    folder:         _userBrandImageOutdoor ? _userBrandImageOutdoor.rawValue.replace("file:///","") : ""
1034 1035 1036 1037 1038 1039
                                    selectExisting: true
                                    selectFolder:   false
                                    onAcceptedForLoad: _userBrandImageOutdoor.rawValue = "file:///" + file
                                }
                            }
                            QGCButton {
1040 1041 1042
                                text:               qsTr("Reset Default Brand Image")
                                Layout.columnSpan:  3
                                Layout.alignment:   Qt.AlignHCenter
1043 1044 1045 1046
                                onClicked:  {
                                    _userBrandImageIndoor.rawValue = ""
                                    _userBrandImageOutdoor.rawValue = ""
                                }
1047 1048
                            }
                        }
1049
                    }
1050

1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062
                    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
            }
1063 1064
    }
}