Browse Source

Fix up GST Debug Level UI (#9289)

* Fix up GST Debug Level UI

* Switch to QGCPopupDialog
QGC4.4
Don Gagne 4 years ago committed by GitHub
parent
commit
3ba9a5c643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 151
      src/QmlControls/AppMessages.qml
  2. 13
      src/Settings/App.SettingsGroup.json

151
src/QmlControls/AppMessages.qml

@ -26,67 +26,6 @@ Item { @@ -26,67 +26,6 @@ Item {
property bool loaded: false
Component {
id: filtersPopupDialog
QGCPopupDialog {
title: qsTr("Turn on logging categories")
buttons: StandardButton.Close
ColumnLayout {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight / 2
Layout.fillWidth: true
QGCLabel { text: qsTr("Search:") }
QGCTextField {
id: searchText
text: ""
Layout.fillWidth: true
enabled: true
}
QGCButton {
text: qsTr("Clear")
onClicked: searchText.text = ""
}
}
QGCButton {
text: qsTr("Clear All")
onClicked: categoryRepeater.setAllLogs(false)
}
Repeater {
id: categoryRepeater
model: QGroundControl.loggingCategories()
function setAllLogs(value) {
var logCategories = QGroundControl.loggingCategories()
for (var category of logCategories) {
QGroundControl.setCategoryLoggingOn(category, value)
}
QGroundControl.updateLoggingFilterRules()
// Update model for repeater
categoryRepeater.model = undefined
categoryRepeater.model = QGroundControl.loggingCategories()
}
QGCCheckBox {
text: modelData
visible: searchText.text ? text.match(`(${searchText.text})`, "i") : true
checked: QGroundControl.categoryLoggingOn(modelData)
onClicked: {
QGroundControl.setCategoryLoggingOn(modelData, checked)
QGroundControl.updateLoggingFilterRules()
}
}
}
}
}
}
Item {
id: panel
anchors.fill: parent
@ -169,12 +108,12 @@ Item { @@ -169,12 +108,12 @@ Item {
}
QGCLabel {
id: gstLabel
anchors.left: writeButton.right
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.baseline: gstCombo.baseline
text: qsTr("GStreamer Debug")
visible: QGroundControl.settingsManager.appSettings.gstDebugLevel.visible
id: gstLabel
anchors.left: writeButton.right
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: gstCombo.verticalCenter
text: qsTr("GStreamer Debug Level")
visible: QGroundControl.settingsManager.appSettings.gstDebugLevel.visible
}
FactComboBox {
@ -182,10 +121,9 @@ Item { @@ -182,10 +121,9 @@ Item {
anchors.left: gstLabel.right
anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.bottom: parent.bottom
width: ScreenTools.defaultFontPixelWidth * 10
model: ["Disabled", "1", "2", "3", "4", "5", "6", "7", "8"]
fact: QGroundControl.settingsManager.appSettings.gstDebugLevel
visible: QGroundControl.settingsManager.appSettings.gstDebugLevel.visible
sizeToContents: true
}
QGCButton {
@ -209,7 +147,80 @@ Item { @@ -209,7 +147,80 @@ Item {
anchors.bottom: parent.bottom
anchors.right: parent.right
text: qsTr("Set Logging")
onClicked: mainWindow.showPopupDialogFromComponent(filtersPopupDialog)
onClicked: mainWindow.showPopupDialogFromComponent(filtersDialogComponent)
}
}
}
Component {
id: filtersDialogComponent
QGCPopupDialog {
title: qsTr("Logging categories")
buttons: StandardButton.Close
ColumnLayout {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight / 2
Layout.alignment: Qt.AlignVCenter
Layout.fillHeight: true
Layout.fillWidth: true
QGCLabel {
text: qsTr("Search:")
}
QGCTextField {
id: searchText
text: ""
Layout.fillWidth: true
enabled: true
}
QGCButton {
text: qsTr("Clear")
onClicked: searchText.text = ""
}
}
Row {
spacing: ScreenTools.defaultFontPixelHeight / 2
QGCButton {
text: qsTr("Clear All")
onClicked: categoryRepeater.setAllLogs(false)
}
}
Column {
id: categoryColumn
spacing: ScreenTools.defaultFontPixelHeight / 2
Repeater {
id: categoryRepeater
model: QGroundControl.loggingCategories()
function setAllLogs(value) {
var logCategories = QGroundControl.loggingCategories()
for (var category of logCategories) {
QGroundControl.setCategoryLoggingOn(category, value)
}
QGroundControl.updateLoggingFilterRules()
// Update model for repeater
categoryRepeater.model = undefined
categoryRepeater.model = QGroundControl.loggingCategories()
}
QGCCheckBox {
text: modelData
visible: searchText.text ? text.match(`(${searchText.text})`, "i") : true
checked: QGroundControl.categoryLoggingOn(modelData)
onClicked: {
QGroundControl.setCategoryLoggingOn(modelData, checked)
QGroundControl.updateLoggingFilterRules()
}
}
}
}
}
}
}

13
src/Settings/App.SettingsGroup.json

@ -122,11 +122,14 @@ @@ -122,11 +122,14 @@
"default": true
},
{
"name": "gstDebugLevel",
"shortDesc": "Video streaming debug",
"longDesc": "Sets the environment variable GST_DEBUG for all pipeline elements on boot.",
"type": "uint8",
"default": 0
"name": "gstDebugLevel",
"shortDesc": "Video streaming debug",
"longDesc": "Sets the environment variable GST_DEBUG for all pipeline elements on boot.",
"type": "uint8",
"enumStrings": "Disabled,Error,Warning,FixMe,Info,Debug,Log,Trace",
"enumValues": "0,1,2,3,4,5,6,7",
"default": 0,
"qgcRebootRequired": true
},
{
"name": "useChecklist",

Loading…
Cancel
Save