diff --git a/src/QmlControls/AppMessages.qml b/src/QmlControls/AppMessages.qml index 95015b4327a9e98d7ad54da5f0336064790bbb57..7588366a367dd1cecdd47e839339f4461eb5a230 100644 --- a/src/QmlControls/AppMessages.qml +++ b/src/QmlControls/AppMessages.qml @@ -27,75 +27,59 @@ Item { property bool loaded: false Component { - id: filtersDialogComponent - QGCViewDialog { - QGCFlickable { - anchors.fill: parent - - contentHeight: categoryColumn.height - clip: true - - ColumnLayout { - anchors.fill: parent - RowLayout { - spacing: ScreenTools.defaultFontPixelHeight / 2 - Layout.alignment: Qt.AlignVCenter - Layout.fillHeight: true - Layout.fillWidth: true + id: filtersPopupDialog - QGCLabel { - text: qsTr("Search:") - } + QGCPopupDialog { + title: qsTr("Turn on logging categories") + buttons: StandardButton.Close - QGCTextField { - id: searchText - text: "" - Layout.fillWidth: true - enabled: true - } + ColumnLayout { + RowLayout { + spacing: ScreenTools.defaultFontPixelHeight / 2 + Layout.fillWidth: true - QGCButton { - text: qsTr("Clear") - onClicked: searchText.text = "" - } + QGCLabel { text: qsTr("Search:") } + + QGCTextField { + id: searchText + text: "" + Layout.fillWidth: true + enabled: true } - Row { - spacing: ScreenTools.defaultFontPixelHeight / 2 - QGCButton { - text: qsTr("Clear All") - onClicked: categoryRepeater.setAllLogs(false) + 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() } - 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() - } - } + QGCCheckBox { + text: modelData + visible: searchText.text ? text.match(`(${searchText.text})`, "i") : true + checked: QGroundControl.categoryLoggingOn(modelData) + onClicked: { + QGroundControl.setCategoryLoggingOn(modelData, checked) + QGroundControl.updateLoggingFilterRules() } } } @@ -225,7 +209,7 @@ Item { anchors.bottom: parent.bottom anchors.right: parent.right text: qsTr("Set Logging") - onClicked: mainWindow.showComponentDialog(filtersDialogComponent, qsTr("Turn on logging categories"), mainWindow.showDialogDefaultWidth, StandardButton.Close) + onClicked: mainWindow.showPopupDialogFromComponent(filtersPopupDialog) } } }