From 47e0f0c14b4bbcc64cb8bf562c566d29313db7ad Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 24 Apr 2017 17:51:18 +0200 Subject: Ported more actions to the fabric --- components/kube/contents/ui/Kube.qml | 56 +++++++++++------------------------- 1 file changed, 16 insertions(+), 40 deletions(-) (limited to 'components') diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index 81c678bd..8092a073 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml @@ -36,59 +36,35 @@ Controls2.ApplicationWindow { visible: true - Kube.NotificationHandler { - id: notificationHandler - function handler(n) { - console.warn("We got a notification: ", n.message) - if (n.type == Kube.Notification.Warning) { - console.warn("And it's a warning!", n.type) + Kube.Listener { + filter: Kube.Messages.notification + onMessageReceived: { + console.warn("We got a notification: ", message.message) + if (message.type == Kube.Notification.Warning) { + console.warn("And it's a warning!", message.type) } - notificationPopup.notify(n.message); + notificationPopup.notify(message.message); } } - //BEGIN Actions - Kube.Context { - id: maillistcontext - property variant mail - property bool isDraft - mail: mailListView.currentMail - isDraft: mailListView.isDraft - } - - Kube.Action { - id: replyAction - actionId: "org.kde.kube.actions.reply" - context: maillistcontext - } - //END Actions - - //BEGIN ActionHandler - Kube.ActionHandler { - actionId: "org.kde.kube.actions.reply" - function isReady(context) { - return context.mail ? true : false; - } - - function handler(context) { - composer.loadMessage(context.mail, false) + Kube.Listener { + filter: Kube.Messages.reply + onMessageReceived: { + composer.loadMessage(message.mail, false) composer.open() } } - Kube.ActionHandler { - actionId: "org.kde.kube.actions.edit" - function isReady(context) { - return context.mail && context.isDraft; - } - function handler(context) { - composer.loadMessage(context.mail, true) + Kube.Listener { + filter: Kube.Messages.edit + onMessageReceived: { + composer.loadMessage(message.mail, true) composer.open() } } - //END ActionHandler //Controller + //TODO replace Kube.FolderController { id: folderController } -- cgit v1.2.3