7import QGroundControl.Controls
8import QGroundControl.FactControls
13 property bool listViewLoadCompleted: false
22 anchors.margins: ScreenTools.defaultFontPixelWidth
28 color: index % 2 == 0 ? qgcPal.window : qgcPal.windowShade
29 height: Math.round(ScreenTools.defaultFontPixelHeight * 0.5 + field.height)
37 anchors.verticalCenter: parent.verticalCenter
44 anchors.top: parent.top
45 anchors.left: parent.left
46 anchors.right: parent.right
47 anchors.bottom: followTail.top
48 anchors.bottomMargin: ScreenTools.defaultFontPixelWidth
50 model: debugMessageModel
51 delegate: delegateItem
53 function scrollToEnd() {
54 if (listViewLoadCompleted) {
55 if (followTail.checked) {
56 listView.positionViewAtEnd();
61 Component.onCompleted: {
62 listViewLoadCompleted = true
63 listView.scrollToEnd()
67 target: debugMessageModel
68 function onDataChanged(topLeft, bottomRight, roles) { listView.scrollToEnd() }
74 folder: QGroundControl.settingsManager.appSettings.logSavePath
75 nameFilters: [qsTr("Log files (*.txt)"), qsTr("All Files (*)")]
76 title: qsTr("Select log save file")
77 onAcceptedForSave: (file) => {
78 debugMessageModel.writeMessages(file);
84 target: debugMessageModel
85 function onWriteStarted() { writeButton.enabled = false }
86 function onWriteFinished(success) { writeButton.enabled = true }
91 anchors.bottom: parent.bottom
92 anchors.left: parent.left
93 onClicked: writeDialog.openForSave()
94 text: qsTr("Save App Log")
99 anchors.left: writeButton.right
100 anchors.leftMargin: ScreenTools.defaultFontPixelWidth
101 anchors.verticalCenter: gstCombo.verticalCenter
102 text: qsTr("GStreamer Debug Level")
103 visible: QGroundControl.settingsManager.appSettings.gstDebugLevel.visible
108 anchors.left: gstLabel.right
109 anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2
110 anchors.bottom: parent.bottom
111 fact: QGroundControl.settingsManager.appSettings.gstDebugLevel
112 visible: QGroundControl.settingsManager.appSettings.gstDebugLevel.visible
118 anchors.right: filterButton.left
119 anchors.rightMargin: ScreenTools.defaultFontPixelWidth
120 anchors.bottom: parent.bottom
121 text: qsTr("Show Latest")
126 if (checked && listViewLoadCompleted) {
127 listView.positionViewAtEnd();
134 anchors.bottom: parent.bottom
135 anchors.right: parent.right
136 text: qsTr("Set Logging")
137 onClicked: filtersDialogFactory.open()
142 QGCPopupDialogFactory {
143 id: filtersDialogFactory
145 dialogComponent: filtersDialogComponent
149 id: filtersDialogComponent
152 title: qsTr("Logging")
153 buttons: Dialog.Close
156 width: maxContentAvailableWidth
158 SettingsGroupLayout {
159 heading: qsTr("Search")
160 Layout.fillWidth: true
163 Layout.fillWidth: true
164 spacing: ScreenTools.defaultFontPixelHeight / 2
167 Layout.fillWidth: true
175 onClicked: searchText.text = ""
180 SettingsGroupLayout {
181 heading: qsTr("Enabled Categories")
182 Layout.fillWidth: true
185 Layout.fillWidth: true
186 spacing: ScreenTools.defaultFontPixelHeight / 2
189 model: QGroundControl.flatLoggingCategoriesModel()
192 Layout.fillWidth: true
193 Layout.maximumHeight: visible ? implicitHeight : 0
194 text: object.fullCategory
195 visible: object.enabled
196 checked: object.enabled
197 onClicked: object.enabled = checked
202 text: qsTr("Disable All")
203 onClicked: QGroundControl.disableAllLoggingCategories()
208 // Shown when not filtered
210 Layout.fillWidth: true
211 spacing: ScreenTools.defaultFontPixelHeight / 2
212 visible: searchText.text === ""
215 model: QGroundControl.treeLoggingCategoriesModel()
218 spacing: ScreenTools.defaultFontPixelHeight / 2
221 spacing: ScreenTools.defaultFontPixelWidth
224 Layout.preferredWidth: ScreenTools.defaultFontPixelWidth
225 text: object.expanded ? qsTr("-") : qsTr("+")
226 horizontalAlignment: Text.AlignLeft
227 visible: object.children
231 onClicked: object.expanded = !object.expanded
236 Layout.fillWidth: true
237 text: object.shortCategory
238 checked: object.enabled
239 onClicked: object.enabled = checked
244 model: object.expanded ? object.children : undefined
247 Layout.fillWidth: true
248 text: " " + object.shortCategory
249 checked: object.enabled
250 onClicked: object.enabled = checked
257 // Shown when filtered
259 Layout.fillWidth: true
260 spacing: ScreenTools.defaultFontPixelHeight / 2
261 visible: searchText.text !== ""
264 model: QGroundControl.flatLoggingCategoriesModel()
267 Layout.fillWidth: true
268 Layout.maximumHeight: visible ? implicitHeight : 0
269 text: object.fullCategory
270 visible: text.match(`(${searchText.text})`, "i")
271 checked: object.enabled
272 onClicked: object.enabled = checked