summaryrefslogtreecommitdiffstats
path: root/applications
diff options
context:
space:
mode:
Diffstat (limited to 'applications')
-rw-r--r--applications/kube-mail/package/contents/ui/main.qml29
1 files changed, 28 insertions, 1 deletions
diff --git a/applications/kube-mail/package/contents/ui/main.qml b/applications/kube-mail/package/contents/ui/main.qml
index 200328f3..33744157 100644
--- a/applications/kube-mail/package/contents/ui/main.qml
+++ b/applications/kube-mail/package/contents/ui/main.qml
@@ -20,6 +20,8 @@ import QtQuick.Controls 1.3
20import QtQuick.Layouts 1.1 20import QtQuick.Layouts 1.1
21import org.kde.plasma.components 2.0 as PlasmaComponents 21import org.kde.plasma.components 2.0 as PlasmaComponents
22 22
23import org.kde.kube.actions 1.0 as Action
24
23ApplicationWindow { 25ApplicationWindow {
24 id: app 26 id: app
25 27
@@ -30,6 +32,29 @@ ApplicationWindow {
30 32
31 visible: true 33 visible: true
32 34
35 Action.ActionHandler {
36 actionId: "org.kde.kube.actions.mark-as-read"
37 function isReady(context) {
38 return context.mail ? true : false;
39 }
40
41 function handler(context) {
42 console.warn("Got message:", context.mail)
43 }
44 }
45
46 Action.Context {
47 id: "maillistcontext"
48 property variant mail
49 mail: mailListView.currentMail
50 }
51
52 Action.Action {
53 id: "markAsReadAction"
54 actionId: "org.kde.kube.actions.mark-as-read"
55 context: maillistcontext
56 }
57
33 //UI 58 //UI
34 toolBar: ToolBar { 59 toolBar: ToolBar {
35 60
@@ -51,9 +76,10 @@ ApplicationWindow {
51 76
52 iconName: "mail-mark-unread" 77 iconName: "mail-mark-unread"
53 text: "Mark Unread" 78 text: "Mark Unread"
79 enabled: markAsReadAction.ready
54 80
55 onClicked: { 81 onClicked: {
56 mailList.markMailUnread(true) 82 markAsReadAction.execute()
57 } 83 }
58 } 84 }
59 85
@@ -109,6 +135,7 @@ ApplicationWindow {
109 135
110 Layout.fillWidth: true 136 Layout.fillWidth: true
111 } 137 }
138
112 } 139 }
113 140
114 //TODO find a better way to scale UI 141 //TODO find a better way to scale UI