Alerts! Giving proper feedback to shortcut actions.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Ad5001 2021-07-22 23:50:21 +02:00
parent ef9610d4dd
commit 77787755b0
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160

View file

@ -41,6 +41,12 @@ ApplicationWindow {
About {id: about} About {id: about}
Alert {
id: alert
anchors.bottom: parent.bottom
anchors.bottomMargin: 5
z: 3
}
Drawer { Drawer {
id: sidebar id: sidebar
@ -166,10 +172,11 @@ ApplicationWindow {
"objects": objs, "objects": objs,
"type": "logplotv1" "type": "logplotv1"
})) }))
alert.show("Saved plot to " + filename)
} }
function loadDiagram(filename) { function loadDiagram(filename) {
console.log("Loading file '" + filename + "'.") alert.show("Loading file '" + filename + "'.")
var data = JSON.parse(Helper.load(filename)) var data = JSON.parse(Helper.load(filename))
var error = ""; var error = "";
if(Object.keys(data).includes("type") && data["type"] == "logplotv1") { if(Object.keys(data).includes("type") && data["type"] == "logplotv1") {
@ -226,10 +233,11 @@ ApplicationWindow {
} }
if(error != "") { if(error != "") {
console.log(error) console.log(error)
alert.show("Could not save file: " + error)
// TODO: Error handling // TODO: Error handling
} }
drawCanvas.requestPaint() drawCanvas.requestPaint()
console.log("Loaded file '" + filename + "'.") alert.show("Loaded file '" + filename + "'.")
} }
Timer { Timer {
@ -250,5 +258,6 @@ ApplicationWindow {
var file = Helper.gettmpfile() var file = Helper.gettmpfile()
drawCanvas.save(file) drawCanvas.save(file)
Helper.copyImageToClipboard() Helper.copyImageToClipboard()
alert.show("Copied plot to clipboard!")
} }
} }