GeneralSettings.qml 48.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 16
import QtMultimedia             5.5
import QtQuick.Layouts          1.2
dogmaphobic's avatar
dogmaphobic committed
17 18 19

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

28
QGCView {
29
    id:                 _qgcView
30
    viewPanel:          panel
31
    color:              qgcPal.window
32 33
    anchors.fill:       parent
    anchors.margins:    ScreenTools.defaultFontPixelWidth
dogmaphobic's avatar
dogmaphobic committed
34

35
    property Fact _percentRemainingAnnounce:    QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce
36
    property Fact _savePath:                    QGroundControl.settingsManager.appSettings.savePath
37
    property Fact _appFontPointSize:            QGroundControl.settingsManager.appSettings.appFontPointSize
38 39
    property Fact _userBrandImageIndoor:        QGroundControl.settingsManager.brandImageSettings.userBrandImageIndoor
    property Fact _userBrandImageOutdoor:       QGroundControl.settingsManager.brandImageSettings.userBrandImageOutdoor
40 41
    property real _labelWidth:                  ScreenTools.defaultFontPixelWidth * 15
    property real _editFieldWidth:              ScreenTools.defaultFontPixelWidth * 30
42 43
    property Fact _mapProvider:                 QGroundControl.settingsManager.flightMapSettings.mapProvider
    property Fact _mapType:                     QGroundControl.settingsManager.flightMapSettings.mapType
44 45

    readonly property string _requiresRestart:  qsTr("(Requires Restart)")
46

47
    QGCPalette { id: qgcPal }
dogmaphobic's avatar
dogmaphobic committed
48

49 50 51 52 53 54 55 56 57 58
    QGCViewPanel {
        id:             panel
        anchors.fill:   parent
        QGCFlickable {
            clip:               true
            anchors.fill:       parent
            contentHeight:      settingsColumn.height
            contentWidth:       settingsColumn.width
            Column {
                id:                 settingsColumn
59
                width:              _qgcView.width
60
                spacing:            ScreenTools.defaultFontPixelHeight * 0.5
61
                anchors.margins:    ScreenTools.defaultFontPixelWidth
62

63
                //-----------------------------------------------------------------
64 65
                //-- Units
                Item {
66
                    width:                      _qgcView.width * 0.8
67 68 69 70
                    height:                     unitLabel.height
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.unitsSettings.visible
71
                    QGCLabel {
72 73 74
                        id:             unitLabel
                        text:           qsTr("Units (Requires Restart)")
                        font.family:    ScreenTools.demiboldFontFamily
75
                    }
76 77
                }
                Rectangle {
78
                    height:                     unitsCol.height + (ScreenTools.defaultFontPixelHeight * 2)
79
                    width:                      _qgcView.width * 0.8
80 81 82 83
                    color:                      qgcPal.windowShade
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.unitsSettings.visible
84 85 86 87
                    Column {
                        id:         unitsCol
                        spacing:    ScreenTools.defaultFontPixelWidth
                        anchors.centerIn: parent
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

                        Repeater {
                            id:     unitsRepeater
                            model:  [ QGroundControl.settingsManager.unitsSettings.distanceUnits, QGroundControl.settingsManager.unitsSettings.areaUnits, QGroundControl.settingsManager.unitsSettings.speedUnits ]

                            property var names: [ qsTr("Distance:"), qsTr("Area:"), qsTr("Speed:") ]

                            Row {
                                spacing:    ScreenTools.defaultFontPixelWidth
                                visible:    modelData.visible

                                QGCLabel {
                                    width:              _labelWidth
                                    anchors.baseline:   factCombo.baseline
                                    text:               unitsRepeater.names[index]
                                }
                                FactComboBox {
                                    id:                 factCombo
                                    width:              _editFieldWidth
                                    fact:               modelData
                                    indexModel:         false
                                }
110 111 112 113
                            }
                        }
                    }
                }
114

115
                //-----------------------------------------------------------------
Patrick José Pereira's avatar
Patrick José Pereira committed
116
                //-- Miscellaneous
117
                Item {
118
                    width:                      _qgcView.width * 0.8
119 120 121 122
                    height:                     miscLabel.height
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.appSettings.visible
123
                    QGCLabel {
124
                        id:             miscLabel
125
                        text:           qsTr("Miscellaneous")
126
                        font.family:    ScreenTools.demiboldFontFamily
127
                    }
128 129
                }
                Rectangle {
130
                    height:                     miscCol.height + (ScreenTools.defaultFontPixelHeight * 2)
131
                    width:                      _qgcView.width * 0.8
132 133 134 135
                    color:                      qgcPal.windowShade
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.appSettings.visible
136 137 138 139 140 141 142
                    Column {
                        id:         miscCol
                        spacing:    ScreenTools.defaultFontPixelWidth
                        anchors.centerIn: parent
                        //-----------------------------------------------------------------
                        //-- Base UI Font Point Size
                        Row {
Gus Grubba's avatar
Gus Grubba committed
143
                            visible: _appFontPointSize ? _appFontPointSize.visible : false
144 145 146
                            spacing: ScreenTools.defaultFontPixelWidth
                            QGCLabel {
                                id:     baseFontLabel
147
                                text:   qsTr("Font Size:")
148 149 150 151 152 153 154 155 156 157 158 159
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            Row {
                                id:         baseFontRow
                                spacing:    ScreenTools.defaultFontPixelWidth / 2
                                anchors.verticalCenter: parent.verticalCenter
                                QGCButton {
                                    id:     decrementButton
                                    width:  height
                                    height: baseFontEdit.height
                                    text:   "-"
                                    onClicked: {
160 161
                                        if (_appFontPointSize.value > _appFontPointSize.min) {
                                            _appFontPointSize.value = _appFontPointSize.value - 1
162 163 164
                                        }
                                    }
                                }
165 166 167 168
                                FactTextField {
                                    id:     baseFontEdit
                                    width:  _editFieldWidth - (decrementButton.width * 2) - (baseFontRow.spacing * 2)
                                    fact:   QGroundControl.settingsManager.appSettings.appFontPointSize
169 170 171 172 173 174
                                }
                                QGCButton {
                                    width:  height
                                    height: baseFontEdit.height
                                    text:   "+"
                                    onClicked: {
175 176
                                        if (_appFontPointSize.value < _appFontPointSize.max) {
                                            _appFontPointSize.value = _appFontPointSize.value + 1
177 178 179 180 181 182
                                        }
                                    }
                                }
                            }
                            QGCLabel {
                                anchors.verticalCenter: parent.verticalCenter
183
                                text:                   _requiresRestart
184 185 186
                            }
                        }
                        //-----------------------------------------------------------------
187 188 189
                        //-- Palette Styles
                        Row {
                            spacing: ScreenTools.defaultFontPixelWidth
190
                            visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible
191
                            QGCLabel {
192
                                text:           qsTr("Color Scheme:")
Gus Grubba's avatar
Gus Grubba committed
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
                                width:          _labelWidth
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            FactComboBox {
                                width:          _editFieldWidth
                                fact:           QGroundControl.settingsManager.appSettings.indoorPalette
                                indexModel:     false
                                anchors.verticalCenter: parent.verticalCenter
                            }
                        }
                        //-----------------------------------------------------------------
                        //-- Map Provider
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            visible:    _mapProvider.visible
                            QGCLabel {
                                text:       qsTr("Map Provider:")
                                width:      _labelWidth
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            FactComboBox {
                                width:      _editFieldWidth
                                fact:       _mapProvider
                                indexModel: false
                                anchors.verticalCenter: parent.verticalCenter
                            }
                        }
                        //-----------------------------------------------------------------
                        //-- Map Type
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            visible:    _mapType.visible
                            QGCLabel {
                                text:               qsTr("Map Type:")
227
                                width:              _labelWidth
Gus Grubba's avatar
Gus Grubba committed
228
                                anchors.verticalCenter: parent.verticalCenter
229
                            }
230
                            FactComboBox {
Gus Grubba's avatar
Gus Grubba committed
231
                                id:         mapTypes
232
                                width:      _editFieldWidth
Gus Grubba's avatar
Gus Grubba committed
233
                                fact:       _mapType
234
                                indexModel: false
Gus Grubba's avatar
Gus Grubba committed
235 236 237 238 239 240 241
                                anchors.verticalCenter: parent.verticalCenter
                                Connections {
                                    target: QGroundControl.settingsManager.flightMapSettings
                                    onMapTypeChanged: {
                                        mapTypes.model = _mapType.enumStrings
                                    }
                                }
242 243 244
                            }
                        }
                        //-----------------------------------------------------------------
245
                        //-- Audio preferences
246
                        FactCheckBox {
247 248 249 250
                            text:       qsTr("Mute all audio output")
                            fact:       _audioMuted
                            visible:    _audioMuted.visible
                            property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted
251 252
                        }
                        //-----------------------------------------------------------------
253
                        //-- Save telemetry log
254
                        FactCheckBox {
255
                            id:         promptSaveLog
256 257
                            text:       qsTr("Save telemetry log after each flight")
                            fact:       _telemetrySave
258
                            visible:    _telemetrySave.visible
259
                            property Fact _telemetrySave: QGroundControl.settingsManager.appSettings.telemetrySave
260 261
                        }
                        //-----------------------------------------------------------------
262
                        //-- Save even if not armed
263
                        FactCheckBox {
264 265
                            text:       qsTr("Save telemetry log even if vehicle was not armed")
                            fact:       _telemetrySaveNotArmed
266
                            visible:    _telemetrySaveNotArmed.visible
267
                            enabled:    promptSaveLog.checked
268
                            property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
                        }
                        //-----------------------------------------------------------------
                        //-- Clear settings
                        QGCCheckBox {
                            id:         clearCheck
                            text:       qsTr("Clear all settings on next start")
                            checked:    false
                            onClicked: {
                                checked ? clearDialog.visible = true : QGroundControl.clearDeleteAllSettingsNextBoot()
                            }
                            MessageDialog {
                                id:         clearDialog
                                visible:    false
                                icon:       StandardIcon.Warning
                                standardButtons: StandardButton.Yes | StandardButton.No
                                title:      qsTr("Clear Settings")
285
                                text:       qsTr("All saved settings will be reset the next time you start %1. Is this really what you want?").arg(QGroundControl.appName)
286 287 288 289 290 291 292 293 294 295 296 297 298
                                onYes: {
                                    QGroundControl.deleteAllSettingsNextBoot()
                                    clearDialog.visible = false
                                }
                                onNo: {
                                    clearCheck.checked  = false
                                    clearDialog.visible = false
                                }
                            }
                        }
                        //-----------------------------------------------------------------
                        //-- Battery talker
                        Row {
299 300
                            spacing:    ScreenTools.defaultFontPixelWidth
                            visible:    QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible
301 302 303
                            QGCCheckBox {
                                id:                 announcePercentCheckbox
                                text:               qsTr("Announce battery lower than:")
Gus Grubba's avatar
Gus Grubba committed
304 305 306
                                checked:            _percentRemainingAnnounce.value !== 0
                                width:              (_labelWidth + _editFieldWidth) * 0.65
                                anchors.verticalCenter: parent.verticalCenter
307 308 309 310 311 312 313 314 315 316 317
                                onClicked: {
                                    if (checked) {
                                        _percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString
                                    } else {
                                        _percentRemainingAnnounce.value = 0
                                    }
                                }
                            }
                            FactTextField {
                                id:                 announcePercent
                                fact:               _percentRemainingAnnounce
Gus Grubba's avatar
Gus Grubba committed
318
                                width:              (_labelWidth + _editFieldWidth) * 0.35
319 320 321 322 323 324
                                enabled:            announcePercentCheckbox.checked
                                anchors.verticalCenter: parent.verticalCenter
                            }
                        }
                        //-----------------------------------------------------------------
                        //-- Virtual joystick settings
325
                        FactCheckBox {
326
                            text:       qsTr("Virtual Joystick")
327 328 329 330
                            visible:    _virtualJoystick.visible
                            fact:       _virtualJoystick

                            property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick
331 332
                        }
                        //-----------------------------------------------------------------
333 334 335
                        //-- Default mission item altitude
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
Donald Gagne's avatar
Donald Gagne committed
336
                            visible:    QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude.visible
337
                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
338 339
                                anchors.verticalCenter: parent.verticalCenter
                                width:  (_labelWidth + _editFieldWidth) * 0.65
340
                                text:   qsTr("Default Mission Altitude:")
341 342 343
                            }
                            FactTextField {
                                id:     defaultItemAltitudeField
Gus Grubba's avatar
Gus Grubba committed
344
                                width:  (_labelWidth + _editFieldWidth) * 0.35
345
                                fact:   QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude
Gus Grubba's avatar
Gus Grubba committed
346
                                anchors.verticalCenter: parent.verticalCenter
347 348
                            }
                        }
349

350
                        //-----------------------------------------------------------------
351
                        //-- Mission AutoLoad
352
                        FactCheckBox {
353
                            text:       qsTr("AutoLoad Missions")
354 355 356 357 358 359 360 361
                            fact:       _autoLoad
                            visible:    _autoLoad.visible

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

                        //-----------------------------------------------------------------
                        //-- Save path
Don Gagne's avatar
Don Gagne committed
362
                        Row {
DonLakeFlyer's avatar
DonLakeFlyer committed
363
                            spacing:    ScreenTools.defaultFontPixelWidth
364
                            visible:    _savePath.visible && !ScreenTools.isMobile
DonLakeFlyer's avatar
DonLakeFlyer committed
365

366 367
                            QGCLabel {
                                anchors.baseline:   savePathBrowse.baseline
368
                                text:               qsTr("File Save Path:")
Don Gagne's avatar
Don Gagne committed
369
                            }
370 371 372
                            QGCLabel {
                                anchors.baseline:   savePathBrowse.baseline
                                text:               _savePath.rawValue === "" ? qsTr("<not set>") : _savePath.value
373 374
                            }
                            QGCButton {
375 376 377 378 379 380 381 382 383 384
                                id:         savePathBrowse
                                text:       "Browse"
                                onClicked:  savePathBrowseDialog.openForLoad()

                                QGCFileDialog {
                                    id:             savePathBrowseDialog
                                    qgcView:        _qgcView
                                    title:          qsTr("Choose the location to save files:")
                                    folder:         _savePath.rawValue
                                    selectExisting: true
385
                                    selectFolder:   true
386 387

                                    onAcceptedForLoad: _savePath.rawValue = file
388
                                }
Don Gagne's avatar
Don Gagne committed
389 390
                            }
                        }
dogmaphobic's avatar
dogmaphobic committed
391 392
                    }
                }
393

Don Gagne's avatar
Don Gagne committed
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429
                //-----------------------------------------------------------------
                //-- RTK GPS
                Item {
                    width:                      _qgcView.width * 0.8
                    height:                     unitLabel.height
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.rtkSettings.visible
                    QGCLabel {
                        id:             rtkLabel
                        text:           qsTr("RTK GPS (Requires Restart)")
                        font.family:    ScreenTools.demiboldFontFamily
                    }
                }
                Rectangle {
                    height:                     rtkGrid.height + (ScreenTools.defaultFontPixelHeight * 2)
                    width:                      _qgcView.width * 0.8
                    color:                      qgcPal.windowShade
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.rtkSettings.visible
                    GridLayout {
                        id:                 rtkGrid
                        anchors.centerIn:   parent
                        columns:            2
                        rowSpacing:         ScreenTools.defaultFontPixelWidth
                        columnSpacing:      ScreenTools.defaultFontPixelWidth

                        QGCLabel {
                            text:               qsTr("Survey in accuracy:")
                        }
                        FactTextField {
                            fact:               QGroundControl.settingsManager.rtkSettings.surveyInAccuracyLimit
                        }

                        QGCLabel {
Patrick José Pereira's avatar
Patrick José Pereira committed
430
                            text:               qsTr("Minimum observation duration:")
Don Gagne's avatar
Don Gagne committed
431 432 433 434 435 436 437
                        }
                        FactTextField {
                            fact:               QGroundControl.settingsManager.rtkSettings.surveyInMinObservationDuration
                        }
                    }
                }

438 439 440
                //-----------------------------------------------------------------
                //-- Autoconnect settings
                Item {
441
                    width:                      _qgcView.width * 0.8
442 443 444 445
                    height:                     autoConnectLabel.height
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.autoConnectSettings.visible
446
                    QGCLabel {
447
                        id:             autoConnectLabel
Don Gagne's avatar
Don Gagne committed
448
                        text:           qsTr("AutoConnect to the following devices:")
449
                        font.family:    ScreenTools.demiboldFontFamily
450 451
                    }
                }
452
                Rectangle {
453
                    height:                     autoConnectCol.height + (ScreenTools.defaultFontPixelHeight * 2)
454
                    width:                      _qgcView.width * 0.8
455 456 457 458
                    color:                      qgcPal.windowShade
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.autoConnectSettings.visible
459

460 461 462 463
                    Column {
                        id:         autoConnectCol
                        spacing:    ScreenTools.defaultFontPixelWidth
                        anchors.centerIn: parent
464

465 466
                        Row {
                            spacing: ScreenTools.defaultFontPixelWidth * 2
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484

                            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:    !ScreenTools.isiOS && modelData.visible
                                }
485 486
                            }
                        }
487 488
                    }
                }
489

490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
                //-----------------------------------------------------------------
                //-- AirMap
                Item {
                    width:                      _qgcView.width * 0.8
                    height:                     unitLabel.height
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.rtkSettings.visible
                    QGCLabel {
                        text:                   qsTr("AirMap")
                        font.family:            ScreenTools.demiboldFontFamily
                    }
                }
                Rectangle {
                    height:                     airMapCol.height + (ScreenTools.defaultFontPixelHeight * 2)
                    width:                      _qgcView.width * 0.8
                    color:                      qgcPal.windowShade
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.airMapSettings.visible
                    Column {
                        id:         airMapCol
                        spacing:    ScreenTools.defaultFontPixelWidth
                        anchors.centerIn: parent
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            QGCLabel        {text: qsTr("API Key:");  width: _labelWidth; anchors.verticalCenter: parent.verticalCenter }
                            FactTextField   {fact: QGroundControl.settingsManager.airMapSettings.apiKey; width: _editFieldWidth; anchors.verticalCenter: parent.verticalCenter }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            QGCLabel        {text: qsTr("Client ID:");  width: _labelWidth; anchors.verticalCenter: parent.verticalCenter }
                            FactTextField   {fact: QGroundControl.settingsManager.airMapSettings.clientID; width: _editFieldWidth; anchors.verticalCenter: parent.verticalCenter }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            QGCLabel        {text: qsTr("User Name:");  width: _labelWidth; anchors.verticalCenter: parent.verticalCenter }
                            FactTextField   {fact: QGroundControl.settingsManager.airMapSettings.userName; width: _editFieldWidth; anchors.verticalCenter: parent.verticalCenter }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            QGCLabel        {text: qsTr("Password:");  width: _labelWidth; anchors.verticalCenter: parent.verticalCenter }
                            FactTextField   {fact: QGroundControl.settingsManager.airMapSettings.password; width: _editFieldWidth; anchors.verticalCenter: parent.verticalCenter; echoMode: TextInput.Password }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            QGCLabel        {text: qsTr("SITA UAV Reg:");  width: _labelWidth; anchors.verticalCenter: parent.verticalCenter }
                            FactTextField   {fact: QGroundControl.settingsManager.airMapSettings.sitaUavReg; width: _editFieldWidth; anchors.verticalCenter: parent.verticalCenter }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            QGCLabel        {text: qsTr("SITA User Reg:");  width: _labelWidth; anchors.verticalCenter: parent.verticalCenter }
                            FactTextField   {fact: QGroundControl.settingsManager.airMapSettings.sitaUserReg; width: _editFieldWidth; anchors.verticalCenter: parent.verticalCenter }
                        }
                    }
                }
546 547 548
                //-----------------------------------------------------------------
                //-- Video Source
                Item {
549
                    width:                      _qgcView.width * 0.8
550 551 552 553
                    height:                     videoLabel.height
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.videoSettings.visible
554 555
                    QGCLabel {
                        id:             videoLabel
556
                        text:           qsTr("Video")
557 558 559 560
                        font.family:    ScreenTools.demiboldFontFamily
                    }
                }
                Rectangle {
561
                    height:                     videoCol.height + (ScreenTools.defaultFontPixelHeight * 2)
562
                    width:                      _qgcView.width * 0.8
563 564 565 566
                    color:                      qgcPal.windowShade
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.videoSettings.visible
567

568 569 570 571
                    Column {
                        id:         videoCol
                        spacing:    ScreenTools.defaultFontPixelWidth
                        anchors.centerIn: parent
572

573 574
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
575
                            visible:    QGroundControl.settingsManager.videoSettings.videoSource.visible
576 577 578
                            QGCLabel {
                                text:               qsTr("Video Source:")
                                width:              _labelWidth
579
                                anchors.verticalCenter: parent.verticalCenter
580
                            }
581 582 583 584 585
                            FactComboBox {
                                id:         videoSource
                                width:      _editFieldWidth
                                indexModel: false
                                fact:       QGroundControl.settingsManager.videoSettings.videoSource
586
                                anchors.verticalCenter: parent.verticalCenter
587 588 589 590
                            }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
591
                            visible:    QGroundControl.settingsManager.videoSettings.udpPort.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 1
592 593 594
                            QGCLabel {
                                text:               qsTr("UDP Port:")
                                width:              _labelWidth
595
                                anchors.verticalCenter: parent.verticalCenter
596
                            }
597
                            FactTextField {
598
                                width:              _editFieldWidth
599
                                fact:               QGroundControl.settingsManager.videoSettings.udpPort
600
                                anchors.verticalCenter: parent.verticalCenter
601 602 603 604
                            }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
605
                            visible:    QGroundControl.settingsManager.videoSettings.rtspUrl.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 2
606
                            QGCLabel {
607
                                anchors.verticalCenter: parent.verticalCenter
608 609 610
                                text:               qsTr("RTSP URL:")
                                width:              _labelWidth
                            }
611
                            FactTextField {
612
                                width:              _editFieldWidth
613
                                fact:               QGroundControl.settingsManager.videoSettings.rtspUrl
614
                                anchors.verticalCenter: parent.verticalCenter
615 616
                            }
                        }
617 618 619 620 621 622 623 624 625 626 627 628 629 630
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            visible:    QGroundControl.settingsManager.videoSettings.tcpUrl.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 3
                            QGCLabel {
                                text:               qsTr("TCP URL:")
                                width:              _labelWidth
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            FactTextField {
                                width:              _editFieldWidth
                                fact:               QGroundControl.settingsManager.videoSettings.tcpUrl
                                anchors.verticalCenter: parent.verticalCenter
                            }
                        }
631
                        Row {
632
                            spacing:    ScreenTools.defaultFontPixelWidth
633
                            visible:    QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 3 && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
634 635 636
                            QGCLabel {
                                text:               qsTr("Aspect Ratio:")
                                width:              _labelWidth
637
                                anchors.verticalCenter: parent.verticalCenter
638 639 640 641
                            }
                            FactTextField {
                                width:              _editFieldWidth
                                fact:               QGroundControl.settingsManager.videoSettings.aspectRatio
642
                                anchors.verticalCenter: parent.verticalCenter
643 644 645
                            }
                        }
                        Row {
646
                            spacing:    ScreenTools.defaultFontPixelWidth
647
                            visible:    QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 3 && QGroundControl.settingsManager.videoSettings.gridLines.visible
648 649 650
                            QGCLabel {
                                text:               qsTr("Grid Lines:")
                                width:              _labelWidth
651
                                anchors.verticalCenter: parent.verticalCenter
652 653 654 655
                            }
                            FactComboBox {
                                width:              _editFieldWidth
                                fact:               QGroundControl.settingsManager.videoSettings.gridLines
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688
                                anchors.verticalCenter: parent.verticalCenter
                            }
                        }
                    }
                } // Video Source - Rectangle
                //-----------------------------------------------------------------
                //-- Video Source
                Item {
                    width:                      _qgcView.width * 0.8
                    height:                     videoRecLabel.height
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.videoSettings.visible
                    QGCLabel {
                        id:             videoRecLabel
                        text:           qsTr("Video Recording")
                        font.family:    ScreenTools.demiboldFontFamily
                    }
                }
                Rectangle {
                    height:                     videoRecCol.height + (ScreenTools.defaultFontPixelHeight * 2)
                    width:                      _qgcView.width * 0.8
                    color:                      qgcPal.windowShade
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
                    visible:                    QGroundControl.settingsManager.videoSettings.visible

                    Column {
                        id:         videoRecCol
                        spacing:    ScreenTools.defaultFontPixelWidth
                        anchors.centerIn: parent
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703
                            visible:    QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 4 && QGroundControl.settingsManager.videoSettings.enableStorageLimit.visible
                            QGCLabel {
                                text:               qsTr("Auto-Delete Files:")
                                width:              _labelWidth
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            FactCheckBox {
                                text:                   ""
                                fact:                   QGroundControl.settingsManager.videoSettings.enableStorageLimit
                                anchors.verticalCenter: parent.verticalCenter
                            }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            visible:    QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 4 && QGroundControl.settingsManager.videoSettings.maxVideoSize.visible && QGroundControl.settingsManager.videoSettings.enableStorageLimit.value
704 705 706 707 708 709 710 711 712 713 714 715 716
                            QGCLabel {
                                text:               qsTr("Max Storage Usage:")
                                width:              _labelWidth
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            FactTextField {
                                width:              _editFieldWidth
                                fact:               QGroundControl.settingsManager.videoSettings.maxVideoSize
                                anchors.verticalCenter: parent.verticalCenter
                            }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
717
                            visible:    QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 4 && QGroundControl.settingsManager.videoSettings.recordingFormat.visible
718 719 720 721 722 723 724 725 726
                            QGCLabel {
                                text:               qsTr("Video File Format:")
                                width:              _labelWidth
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            FactComboBox {
                                width:              _editFieldWidth
                                fact:               QGroundControl.settingsManager.videoSettings.recordingFormat
                                anchors.verticalCenter: parent.verticalCenter
727 728
                            }
                        }
729
                    }
730
                }
731

732 733 734 735 736 737 738
                //-----------------------------------------------------------------
                //-- Custom Brand Image
                Item {
                    width:                      _qgcView.width * 0.8
                    height:                     userBrandImageLabel.height
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
739
                    visible:                    QGroundControl.settingsManager.brandImageSettings.visible && !ScreenTools.isMobile
740 741 742 743 744 745 746 747 748 749 750 751
                    QGCLabel {
                        id:             userBrandImageLabel
                        text:           qsTr("Brand Image")
                        font.family:    ScreenTools.demiboldFontFamily
                    }
                }
                Rectangle {
                    height:                     userBrandImageCol.height + (ScreenTools.defaultFontPixelHeight * 2)
                    width:                      _qgcView.width * 0.8
                    color:                      qgcPal.windowShade
                    anchors.margins:            ScreenTools.defaultFontPixelWidth
                    anchors.horizontalCenter:   parent.horizontalCenter
752
                    visible:                    QGroundControl.settingsManager.brandImageSettings.visible && !ScreenTools.isMobile
753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770

                    Column {
                        id:         userBrandImageCol
                        spacing:    ScreenTools.defaultFontPixelWidth
                        anchors.centerIn: parent
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            visible:    _userBrandImageIndoor.visible

                            QGCLabel {
                                anchors.baseline:   userBrandImageIndoorBrowse.baseline
                                width:              _labelWidth*1.5
                                text:               qsTr("Indoor Brand Image Path:")
                            }
                            QGCTextField {
                                anchors.baseline:   userBrandImageIndoorBrowse.baseline
                                readOnly:           true
                                width:              _editFieldWidth
771
                                text:               _userBrandImageIndoor.valueString.replace("file:///","")
772 773 774 775 776 777 778 779 780 781 782 783 784 785
                            }
                            QGCButton {
                                id:         userBrandImageIndoorBrowse
                                text:       "Browse"
                                onClicked:  userBrandImageIndoorBrowseDialog.openForLoad()

                                QGCFileDialog {
                                    id:             userBrandImageIndoorBrowseDialog
                                    qgcView:        _qgcView
                                    title:          qsTr("Choose custom brand image file:")
                                    folder:         _userBrandImageIndoor.rawValue.replace("file:///","")
                                    selectExisting: true
                                    selectFolder:   false

786
                                    onAcceptedForLoad: _userBrandImageIndoor.rawValue = "file:///" + file
787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802
                                }
                            }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            visible:    _userBrandImageOutdoor.visible

                            QGCLabel {
                                anchors.baseline:   userBrandImageOutdoorBrowse.baseline
                                width:              _labelWidth*1.5
                                text:               qsTr("Outdoor Brand Image Path:")
                            }
                            QGCTextField {
                                anchors.baseline:   userBrandImageOutdoorBrowse.baseline
                                readOnly:           true
                                width:              _editFieldWidth
803
                                text:               _userBrandImageOutdoor.valueString.replace("file:///","")
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
                            }
                            QGCButton {
                                id:         userBrandImageOutdoorBrowse
                                text:       "Browse"
                                onClicked:  userBrandImageOutdoorBrowseDialog.openForLoad()

                                QGCFileDialog {
                                    id:             userBrandImageOutdoorBrowseDialog
                                    qgcView:        _qgcView
                                    title:          qsTr("Choose custom brand image file:")
                                    folder:         _userBrandImageOutdoor.rawValue.replace("file:///","")
                                    selectExisting: true
                                    selectFolder:   false

                                    onAcceptedForLoad: _userBrandImageOutdoor.rawValue = "file:///" + file
                                }
                            }
                        }
                        Row {
                            spacing:    ScreenTools.defaultFontPixelWidth
                            visible:    _userBrandImageIndoor.visible

                            QGCButton {
                                id:         userBrandImageReset
                                text:       "Reset Default Brand Image"
                                onClicked:  {
                                    _userBrandImageIndoor.rawValue = ""
                                    _userBrandImageOutdoor.rawValue = ""
                                }
                            }
                        }
                    }
                }

838 839
                QGCLabel {
                    anchors.horizontalCenter:   parent.horizontalCenter
840
                    text:                       qsTr("%1 Version: %2").arg(QGroundControl.appName).arg(QGroundControl.qgcVersion)
841
                }
842 843
            } // settingsColumn
        } // QGCFlickable
844 845
    } // QGCViewPanel
} // QGCView