From df10583b42f49a58d27dd6dd322f22fd88ce1418 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 10 May 2016 15:53:06 +0200 Subject: Support for loading drafts --- components/mail/contents/ui/main.qml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'components/mail/contents/ui') diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 15a2b0b8..c2569cdc 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -38,7 +38,9 @@ ApplicationWindow { KubeAction.Context { id: maillistcontext property variant mail + property bool isDraft mail: mailListView.currentMail + isDraft: mailListView.isDraft } KubeAction.Context { @@ -53,6 +55,12 @@ ApplicationWindow { context: maillistcontext } + KubeAction.Action { + id: editAction + actionId: "org.kde.kube.actions.edit" + context: maillistcontext + } + KubeAction.Action { id: markAsReadAction actionId: "org.kde.kube.actions.mark-as-read" @@ -180,6 +188,17 @@ ApplicationWindow { } } + KubeAction.ActionHandler { + actionId: "org.kde.kube.actions.edit" + function isReady(context) { + return context.mail && context.isDraft; + } + + function handler(context) { + composerComponent.createObject(app, {"draftMessage": context.mail}) + } + } + ToolButton { id: newMailButton @@ -202,6 +221,16 @@ ApplicationWindow { } } + ToolButton { + Layout.fillHeight: true + iconName: "mail-message-edit" + text: "Edit" + enabled: editAction.ready + onClicked: { + editAction.execute() + } + } + Item { Layout.fillWidth: true } -- cgit v1.2.3