Alerts! Giving proper feedback to shortcut actions.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
ef9610d4dd
commit
77787755b0
1 changed files with 11 additions and 2 deletions
|
@ -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!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue