diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-24 15:34:31 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-24 15:34:31 +0200 |
commit | 74703d12ef6f72a057f11957181b6cf6f4730e2d (patch) | |
tree | a9126fd02863243e26fdc2881b3910b163d59c87 /framework/qml/MailListView.qml | |
parent | 68ed477e34756beb5b152f8077c2e2527bba4708 (diff) | |
download | kube-74703d12ef6f72a057f11957181b6cf6f4730e2d.tar.gz kube-74703d12ef6f72a057f11957181b6cf6f4730e2d.zip |
Added the Fabric as an in application message bus
Diffstat (limited to 'framework/qml/MailListView.qml')
-rw-r--r-- | framework/qml/MailListView.qml | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index 96e266bb..5adc3f98 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml | |||
@@ -25,26 +25,25 @@ import org.kube.framework 1.0 as Kube | |||
25 | 25 | ||
26 | Item { | 26 | Item { |
27 | id: root | 27 | id: root |
28 | property variant parentFolder | 28 | //InterfaceProperties |
29 | property variant currentMail: null | 29 | property string filterString |
30 | //Private properties | ||
31 | property variant parentFolder: null | ||
30 | property bool isDraft : false | 32 | property bool isDraft : false |
31 | property bool isImportant : false | 33 | property bool isImportant : false |
32 | property bool isTrash : false | 34 | property bool isTrash : false |
33 | property bool isUnread : false | 35 | property bool isUnread : false |
34 | property int currentIndex | ||
35 | property string filterString | ||
36 | 36 | ||
37 | onParentFolderChanged: { | 37 | Kube.Listener { |
38 | currentMail = null | 38 | filter: Kube.Messages.folderSelection |
39 | onMessageReceived: { | ||
40 | parentFolder = message.folder | ||
41 | Kube.Fabric.postMessage(Kube.Messages.mailSelection, {"mail":null}) | ||
42 | } | ||
39 | } | 43 | } |
40 | 44 | ||
41 | Kube.MailController { | 45 | Kube.MailController { |
42 | id: mailController | 46 | id: mailController |
43 | Binding on mail { | ||
44 | //!! checks for the availability of the type | ||
45 | when: !!root.currentMail | ||
46 | value: root.currentMail | ||
47 | } | ||
48 | unread: root.isUnread | 47 | unread: root.isUnread |
49 | trash: root.isTrash | 48 | trash: root.isTrash |
50 | important: root.isImportant | 49 | important: root.isImportant |
@@ -52,6 +51,14 @@ Item { | |||
52 | operateOnThreads: mailListModel.isThreaded | 51 | operateOnThreads: mailListModel.isThreaded |
53 | } | 52 | } |
54 | 53 | ||
54 | Kube.Listener { | ||
55 | id: controllerListener | ||
56 | filter: Kube.Messages.mailSelection | ||
57 | onMessageReceived: { | ||
58 | mailController.mail = message.mail | ||
59 | } | ||
60 | } | ||
61 | |||
55 | Shortcut { | 62 | Shortcut { |
56 | sequence: StandardKey.Delete | 63 | sequence: StandardKey.Delete |
57 | onActivated: mailController.moveToTrashAction.execute() | 64 | onActivated: mailController.moveToTrashAction.execute() |
@@ -93,9 +100,8 @@ Item { | |||
93 | } | 100 | } |
94 | //END keyboard nav | 101 | //END keyboard nav |
95 | 102 | ||
96 | currentIndex: root.currentIndex | ||
97 | onCurrentItemChanged: { | 103 | onCurrentItemChanged: { |
98 | root.currentMail = currentItem.currentData.domainObject; | 104 | Kube.Fabric.postMessage(Kube.Messages.mailSelection, {"mail":currentItem.currentData.mail}) |
99 | root.isDraft = currentItem.currentData.draft; | 105 | root.isDraft = currentItem.currentData.draft; |
100 | root.isTrash = currentItem.currentData.trash; | 106 | root.isTrash = currentItem.currentData.trash; |
101 | root.isImportant = currentItem.currentData.important; | 107 | root.isImportant = currentItem.currentData.important; |