Commit 36c30bff authored by Nate Weibley's avatar Nate Weibley

Clean up AppMessages QML

parent a552bc72
...@@ -31,14 +31,16 @@ import QGroundControl.Controls 1.0 ...@@ -31,14 +31,16 @@ import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
QGCView { Rectangle {
viewPanel: panel id: logwindow
id: logwindow anchors.fill: parent
anchors.margins: ScreenTools.defaultFontPixelWidth
color: qgcPal.window
property bool loaded: false property bool loaded: false
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
Connections { Connections {
target: debugMessageModel target: debugMessageModel
...@@ -70,78 +72,67 @@ QGCView { ...@@ -70,78 +72,67 @@ QGCView {
} }
} }
QGCViewPanel { ListView {
id: panel Component.onCompleted: {
anchors.fill: parent loaded = true
Rectangle {
anchors.fill: parent
color: qgcPal.window
}
ListView {
Component.onCompleted: {
loaded = true
}
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: followTail.top
id: listview
model: debugMessageModel
delegate: delegateItem
} }
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: followTail.top
anchors.bottomMargin: ScreenTools.defaultFontPixelWidth
clip: true
id: listview
model: debugMessageModel
delegate: delegateItem
}
FileDialog { FileDialog {
id: writeDialog id: writeDialog
folder: shortcuts.home folder: shortcuts.home
nameFilters: ["Log files (*.txt)", "All Files (*)"] nameFilters: ["Log files (*.txt)", "All Files (*)"]
selectExisting: false selectExisting: false
title: "Select log save file" title: "Select log save file"
onAccepted: { onAccepted: {
debugMessageModel.writeMessages(fileUrl); debugMessageModel.writeMessages(fileUrl);
visible = false; visible = false;
}
onRejected: visible = false
} }
onRejected: visible = false
}
Connections { Connections {
target: debugMessageModel target: debugMessageModel
onWriteStarted: writeButton.enabled = false; onWriteStarted: writeButton.enabled = false;
onWriteFinished: writeButton.enabled = true; onWriteFinished: writeButton.enabled = true;
} }
QGCButton { QGCButton {
id: writeButton id: writeButton
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.margins: ScreenTools.defaultFontPixelWidth onClicked: writeDialog.visible = true
onClicked: writeDialog.visible = true text: "Save App Log"
text: "Save App Log" }
}
BusyIndicator { BusyIndicator {
id: writeBusy id: writeBusy
anchors.bottom: writeButton.bottom anchors.bottom: writeButton.bottom
anchors.left: writeButton.right anchors.left: writeButton.right
height: writeButton.height height: writeButton.height
visible: !writeButton.enabled visible: !writeButton.enabled
} }
QGCButton { QGCButton {
id: followTail id: followTail
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.margins: ScreenTools.defaultFontPixelWidth text: "Show Latest"
text: "Show Latest" checkable: true
checkable: true checked: true
checked: true
onCheckedChanged: {
onCheckedChanged: { if (checked && loaded) {
if (checked && loaded) { listview.positionViewAtEnd();
listview.positionViewAtEnd();
}
} }
} }
} }
......
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