From dac20ebf46c14c17981edce6401117914d5dcf5b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 10 May 2016 15:03:58 +0200 Subject: Reply as an action --- components/mail/contents/ui/main.qml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'components') diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 975e6a24..15a2b0b8 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -47,6 +47,12 @@ ApplicationWindow { folder: folderListView.currentFolder } + KubeAction.Action { + id: replyAction + actionId: "org.kde.kube.actions.reply" + context: maillistcontext + } + KubeAction.Action { id: markAsReadAction actionId: "org.kde.kube.actions.mark-as-read" @@ -163,6 +169,17 @@ ApplicationWindow { } } + KubeAction.ActionHandler { + actionId: "org.kde.kube.actions.reply" + function isReady(context) { + return context.mail ? true : false; + } + + function handler(context) { + composerComponent.createObject(app, {"originalMessage": context.mail}) + } + } + ToolButton { id: newMailButton @@ -179,9 +196,9 @@ ApplicationWindow { Layout.fillHeight: true iconName: "mail-message-reply" text: "Reply" + enabled: replyAction.ready onClicked: { - composerComponent.createObject(app) - composer.originalMessage = mailListView.currentMail + replyAction.execute() } } -- cgit v1.2.3