summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-18 09:02:22 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-19 11:02:44 +0200
commit925834d2f380dd85336f852795226e2ac6d8ec42 (patch)
tree60d19cd5146902556af6c3dd0fec5ec3c6428dbb /views
parent36e16798b4063e9174b21e7f70a5acc868a7c931 (diff)
downloadkube-925834d2f380dd85336f852795226e2ac6d8ec42.tar.gz
kube-925834d2f380dd85336f852795226e2ac6d8ec42.zip
Introduced an aborted hook to safe the draft before going down.
Diffstat (limited to 'views')
-rw-r--r--views/composer/qml/View.qml11
1 files changed, 9 insertions, 2 deletions
diff --git a/views/composer/qml/View.qml b/views/composer/qml/View.qml
index 85e8b559..9afc5316 100644
--- a/views/composer/qml/View.qml
+++ b/views/composer/qml/View.qml
@@ -39,7 +39,7 @@ Kube.View {
39 htmlBody: html.checked 39 htmlBody: html.checked
40 sign: signCheckbox.checked 40 sign: signCheckbox.checked
41 encrypt: encryptCheckbox.checked 41 encrypt: encryptCheckbox.checked
42 onDone: Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) 42 onDone: root.done()
43 43
44 property bool foundAllKeys: composerController.to.foundAllKeys && composerController.cc.foundAllKeys && composerController.bcc.foundAllKeys 44 property bool foundAllKeys: composerController.to.foundAllKeys && composerController.cc.foundAllKeys && composerController.bcc.foundAllKeys
45 45
@@ -55,6 +55,13 @@ Kube.View {
55 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"type": "contacts"}) 55 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"type": "contacts"})
56 } 56 }
57 57
58 onAborted: {
59 //Avoid loosing the message
60 if (composerController.saveAsDraftAction.enabled) {
61 composerController.saveAsDraftAction.execute()
62 }
63 }
64
58 function loadMessage(message, loadType) { 65 function loadMessage(message, loadType) {
59 if (message) { 66 if (message) {
60 switch(loadType) { 67 switch(loadType) {
@@ -488,7 +495,7 @@ Kube.View {
488 Kube.Button { 495 Kube.Button {
489 width: saveDraftButton.width 496 width: saveDraftButton.width
490 text: qsTr("Discard") 497 text: qsTr("Discard")
491 onClicked: Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) 498 onClicked: root.done()
492 } 499 }
493 500
494 Kube.Button { 501 Kube.Button {