diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-24 21:22:18 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-24 21:22:18 +0200 |
commit | 1d0717f90712c298e93d61dd7312498303b5db0f (patch) | |
tree | 45a12d03d47470ee93a4dfca2cd1e9aec1905cc2 /framework/qml/ConversationView.qml | |
parent | cefcf7707eb6b077d7496f0655405f357a508357 (diff) | |
download | kube-1d0717f90712c298e93d61dd7312498303b5db0f.tar.gz kube-1d0717f90712c298e93d61dd7312498303b5db0f.zip |
Removed controller in conversation view
Diffstat (limited to 'framework/qml/ConversationView.qml')
-rw-r--r-- | framework/qml/ConversationView.qml | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml index d7d33c78..d0906068 100644 --- a/framework/qml/ConversationView.qml +++ b/framework/qml/ConversationView.qml | |||
@@ -26,7 +26,6 @@ import org.kube.framework 1.0 as Kube | |||
26 | import QtQml 2.2 as QtQml | 26 | import QtQml 2.2 as QtQml |
27 | 27 | ||
28 | 28 | ||
29 | |||
30 | Rectangle { | 29 | Rectangle { |
31 | id: root | 30 | id: root |
32 | 31 | ||
@@ -37,7 +36,6 @@ Rectangle { | |||
37 | property bool hideTrash: true; | 36 | property bool hideTrash: true; |
38 | property bool hideNonTrash: false; | 37 | property bool hideNonTrash: false; |
39 | 38 | ||
40 | |||
41 | Kube.Listener { | 39 | Kube.Listener { |
42 | filter: Kube.Messages.mailSelection | 40 | filter: Kube.Messages.mailSelection |
43 | onMessageReceived: { | 41 | onMessageReceived: { |
@@ -161,25 +159,13 @@ Rectangle { | |||
161 | //which will break lot's of things. | 159 | //which will break lot's of things. |
162 | cacheBuffer: 100000 | 160 | cacheBuffer: 100000 |
163 | 161 | ||
164 | Kube.MailController { | ||
165 | id: mailController | ||
166 | Binding on mail { | ||
167 | //!! checks for the availability of the type | ||
168 | when: !!root.currentMail | ||
169 | value: root.currentMail | ||
170 | } | ||
171 | operateOnThreads: false | ||
172 | } | ||
173 | |||
174 | Timer { | 162 | Timer { |
175 | id: markAsReadTimer | 163 | id: markAsReadTimer |
176 | interval: 2000 | 164 | interval: 2000 |
177 | running: false | 165 | running: false |
178 | repeat: false | 166 | repeat: false |
179 | onTriggered: { | 167 | onTriggered: { |
180 | if (mailController.markAsReadAction.enabled) { | 168 | Kube.Fabric.postMessage(Kube.Messages.markAsRead, {"mail": root.currentMail}) |
181 | mailController.markAsReadAction.execute(); | ||
182 | } | ||
183 | } | 169 | } |
184 | } | 170 | } |
185 | 171 | ||
@@ -519,22 +505,16 @@ Rectangle { | |||
519 | leftMargin: Kube.Units.largeSpacing | 505 | leftMargin: Kube.Units.largeSpacing |
520 | } | 506 | } |
521 | 507 | ||
522 | Kube.MailController { | ||
523 | id: mailController | ||
524 | mail: model.mail | ||
525 | } | ||
526 | |||
527 | text: model.trash ? qsTr("Delete Mail") : qsTr("Move to trash") | 508 | text: model.trash ? qsTr("Delete Mail") : qsTr("Move to trash") |
528 | opacity: 0.5 | 509 | opacity: 0.5 |
529 | enabled: model.trash ? mailController.removeAction.enabled : mailController.moveToTrashAction.enabled | ||
530 | MouseArea { | 510 | MouseArea { |
531 | anchors.fill: parent | 511 | anchors.fill: parent |
532 | enabled: parent.enabled | 512 | enabled: parent.enabled |
533 | onClicked: { | 513 | onClicked: { |
534 | if (model.trash) { | 514 | if (model.trash) { |
535 | mailController.removeAction.execute(); | 515 | Kube.Fabric.postMessage(Kube.Messages.remove, {"mail": model.mail}) |
536 | } else { | 516 | } else { |
537 | mailController.moveToTrashAction.execute(); | 517 | Kube.Fabric.postMessage(Kube.Messages.moveToTrash, {"mail": model.mail}) |
538 | } | 518 | } |
539 | } | 519 | } |
540 | } | 520 | } |