Commit cd7a5f81 authored by Patrick José Pereira's avatar Patrick José Pereira

AppMessages: Add Set all categories buttom

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent 8300cdc5
......@@ -36,22 +36,33 @@ Item {
id: categoryColumn
spacing: ScreenTools.defaultFontPixelHeight / 2
QGCButton {
text: qsTr("Clear All")
onClicked: {
var logCats = QGroundControl.loggingCategories()
for (var i=0; i<logCats.length; i++) {
QGroundControl.setCategoryLoggingOn(logCats[i], false)
}
QGroundControl.updateLoggingFilterRules()
categoryRepeater.model = undefined
categoryRepeater.model = QGroundControl.loggingCategories()
Row {
spacing: ScreenTools.defaultFontPixelHeight / 2
QGCButton {
text: qsTr("Set All")
onClicked: categoryRepeater.setAllLogs(true)
}
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
checked: QGroundControl.categoryLoggingOn(modelData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment