Browse Source

Merge pull request #4859 from dogmaphobic/generalSettings

General Settings tweaks.
QGC4.4
Gus Grubba 8 years ago committed by GitHub
parent
commit
c2e3fa26e1
  1. 117
      src/ui/preferences/GeneralSettings.qml

117
src/ui/preferences/GeneralSettings.qml

@ -139,7 +139,7 @@ QGCView {
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Base UI Font Point Size //-- Base UI Font Point Size
Row { Row {
visible: _appFontPointSize.visible visible: _appFontPointSize ? _appFontPointSize.visible : false
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
id: baseFontLabel id: baseFontLabel
@ -188,15 +188,56 @@ QGCView {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible visible: QGroundControl.settingsManager.appSettings.indoorPalette.visible
QGCLabel { QGCLabel {
anchors.baseline: paletteCombo.baseline text: qsTr("Color scheme:")
text: qsTr("Color scheme:") 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:")
width: _labelWidth width: _labelWidth
anchors.verticalCenter: parent.verticalCenter
} }
FactComboBox { FactComboBox {
id: paletteCombo id: mapTypes
width: _editFieldWidth width: _editFieldWidth
fact: QGroundControl.settingsManager.appSettings.indoorPalette fact: _mapType
indexModel: false indexModel: false
anchors.verticalCenter: parent.verticalCenter
Connections {
target: QGroundControl.settingsManager.flightMapSettings
onMapTypeChanged: {
mapTypes.model = _mapType.enumStrings
}
}
} }
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------
@ -205,10 +246,8 @@ QGCView {
text: qsTr("Mute all audio output") text: qsTr("Mute all audio output")
fact: _audioMuted fact: _audioMuted
visible: _audioMuted.visible visible: _audioMuted.visible
property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted property Fact _audioMuted: QGroundControl.settingsManager.appSettings.audioMuted
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Save telemetry log //-- Save telemetry log
FactCheckBox { FactCheckBox {
@ -216,10 +255,8 @@ QGCView {
text: qsTr("Save telemetry log after each flight") text: qsTr("Save telemetry log after each flight")
fact: _telemetrySave fact: _telemetrySave
visible: !ScreenTools.isMobile && _telemetrySave.visible visible: !ScreenTools.isMobile && _telemetrySave.visible
property Fact _telemetrySave: QGroundControl.settingsManager.appSettings.telemetrySave property Fact _telemetrySave: QGroundControl.settingsManager.appSettings.telemetrySave
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Save even if not armed //-- Save even if not armed
FactCheckBox { FactCheckBox {
@ -227,10 +264,8 @@ QGCView {
fact: _telemetrySaveNotArmed fact: _telemetrySaveNotArmed
visible: !ScreenTools.isMobile && _telemetrySaveNotArmed.visible visible: !ScreenTools.isMobile && _telemetrySaveNotArmed.visible
enabled: promptSaveLog.checked enabled: promptSaveLog.checked
property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Clear settings //-- Clear settings
QGCCheckBox { QGCCheckBox {
@ -263,9 +298,10 @@ QGCView {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCCheckBox { QGCCheckBox {
id: announcePercentCheckbox id: announcePercentCheckbox
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Announce battery lower than:") text: qsTr("Announce battery lower than:")
checked: _percentRemainingAnnounce.value != 0 checked: _percentRemainingAnnounce.value !== 0
width: (_labelWidth + _editFieldWidth) * 0.65
anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
if (checked) { if (checked) {
_percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString _percentRemainingAnnounce.value = _percentRemainingAnnounce.defaultValueString
@ -277,6 +313,7 @@ QGCView {
FactTextField { FactTextField {
id: announcePercent id: announcePercent
fact: _percentRemainingAnnounce fact: _percentRemainingAnnounce
width: (_labelWidth + _editFieldWidth) * 0.35
enabled: announcePercentCheckbox.checked enabled: announcePercentCheckbox.checked
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
@ -296,12 +333,15 @@ QGCView {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude.visible visible: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude.visible
QGCLabel { QGCLabel {
anchors.baseline: defaultItemAltitudeField.baseline anchors.verticalCenter: parent.verticalCenter
text: qsTr("Default mission item altitude:") width: (_labelWidth + _editFieldWidth) * 0.65
text: qsTr("Default mission altitude:")
} }
FactTextField { FactTextField {
id: defaultItemAltitudeField id: defaultItemAltitudeField
width: (_labelWidth + _editFieldWidth) * 0.35
fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude
anchors.verticalCenter: parent.verticalCenter
} }
} }
@ -346,53 +386,6 @@ QGCView {
} }
} }
} }
//-----------------------------------------------------------------
//-- Map Provider
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _mapProvider.visible
QGCLabel {
anchors.baseline: mapProviders.baseline
text: qsTr("Map Provider:")
width: _labelWidth
}
FactComboBox {
id: mapProviders
width: _editFieldWidth
fact: _mapProvider
indexModel: false
}
}
//-----------------------------------------------------------------
//-- Map Type
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _mapType.visible
QGCLabel {
anchors.baseline: mapTypes.baseline
text: qsTr("Map Type:")
width: _labelWidth
}
FactComboBox {
id: mapTypes
width: _editFieldWidth
fact: _mapType
indexModel: false
Connections {
target: QGroundControl.settingsManager.flightMapSettings
onMapTypeChanged: {
mapTypes.model = _mapType.enumStrings
}
}
}
}
} }
} }

Loading…
Cancel
Save