diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-24 16:45:08 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-24 16:46:16 +0200 |
commit | b8962ee2d35772ab4f2bed1c415a386207067157 (patch) | |
tree | 2d26a70f1eed4c417f32119e03e8e067112938bb | |
parent | 74703d12ef6f72a057f11957181b6cf6f4730e2d (diff) | |
download | kube-b8962ee2d35772ab4f2bed1c415a386207067157.tar.gz kube-b8962ee2d35772ab4f2bed1c415a386207067157.zip |
Use the fabric to wire up search
-rw-r--r-- | components/kube/contents/ui/Kube.qml | 2 | ||||
-rw-r--r-- | framework/qml/MailListView.qml | 10 | ||||
-rw-r--r-- | framework/qml/Messages.qml | 1 |
3 files changed, 9 insertions, 4 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index cc149e66..81c678bd 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml | |||
@@ -342,7 +342,7 @@ Controls2.ApplicationWindow { | |||
342 | text: "Go" | 342 | text: "Go" |
343 | 343 | ||
344 | onClicked: { | 344 | onClicked: { |
345 | mailListView.filterString = searchField.text | 345 | Kube.Fabric.postMessage(Kube.Messages.search, {"filterString": searchField.text}) |
346 | search.close() | 346 | search.close() |
347 | } | 347 | } |
348 | } | 348 | } |
diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index 5adc3f98..570b92f8 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml | |||
@@ -25,8 +25,6 @@ import org.kube.framework 1.0 as Kube | |||
25 | 25 | ||
26 | Item { | 26 | Item { |
27 | id: root | 27 | id: root |
28 | //InterfaceProperties | ||
29 | property string filterString | ||
30 | //Private properties | 28 | //Private properties |
31 | property variant parentFolder: null | 29 | property variant parentFolder: null |
32 | property bool isDraft : false | 30 | property bool isDraft : false |
@@ -42,6 +40,13 @@ Item { | |||
42 | } | 40 | } |
43 | } | 41 | } |
44 | 42 | ||
43 | Kube.Listener { | ||
44 | filter: Kube.Messages.search | ||
45 | onMessageReceived: { | ||
46 | mailListModel.filter = message.filterString | ||
47 | } | ||
48 | } | ||
49 | |||
45 | Kube.MailController { | 50 | Kube.MailController { |
46 | id: mailController | 51 | id: mailController |
47 | unread: root.isUnread | 52 | unread: root.isUnread |
@@ -111,7 +116,6 @@ Item { | |||
111 | model: Kube.MailListModel { | 116 | model: Kube.MailListModel { |
112 | id: mailListModel | 117 | id: mailListModel |
113 | parentFolder: root.parentFolder | 118 | parentFolder: root.parentFolder |
114 | filter: root.filterString | ||
115 | } | 119 | } |
116 | 120 | ||
117 | delegate: Item { | 121 | delegate: Item { |
diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml index 3241af0b..b4b170ec 100644 --- a/framework/qml/Messages.qml +++ b/framework/qml/Messages.qml | |||
@@ -27,5 +27,6 @@ Item { | |||
27 | 27 | ||
28 | //Actions | 28 | //Actions |
29 | property string moveToTrash: "moveToTrash" | 29 | property string moveToTrash: "moveToTrash" |
30 | property string search: "search" | ||
30 | } | 31 | } |
31 | 32 | ||