diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-08-03 21:04:29 -0600 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-08-03 21:04:29 -0600 |
commit | 1f469a85e48c19b2fcb4f119bed8b2d56cff8629 (patch) | |
tree | db574167a23d9707af0044d1b1d8d77ccc7d7002 | |
parent | f70fb14b36c2d6af498f31c36b5fd5d8beb827f4 (diff) | |
download | kube-1f469a85e48c19b2fcb4f119bed8b2d56cff8629.tar.gz kube-1f469a85e48c19b2fcb4f119bed8b2d56cff8629.zip |
Send mail to option
This is mostly to demonstrate how this could work with additional menu
entries.
-rw-r--r-- | components/kube/contents/ui/ComposerView.qml | 4 | ||||
-rw-r--r-- | components/kube/contents/ui/Kube.qml | 8 | ||||
-rw-r--r-- | framework/qml/MailViewer.qml | 6 |
3 files changed, 13 insertions, 5 deletions
diff --git a/components/kube/contents/ui/ComposerView.qml b/components/kube/contents/ui/ComposerView.qml index ada7796b..d7751e1a 100644 --- a/components/kube/contents/ui/ComposerView.qml +++ b/components/kube/contents/ui/ComposerView.qml | |||
@@ -31,6 +31,7 @@ Kube.View { | |||
31 | property bool newMessage: false | 31 | property bool newMessage: false |
32 | property bool loadAsDraft: false | 32 | property bool loadAsDraft: false |
33 | property variant message: {} | 33 | property variant message: {} |
34 | property variant recipients: [] | ||
34 | 35 | ||
35 | //FIXME mean hack to unfuck hiding | 36 | //FIXME mean hack to unfuck hiding |
36 | property variant _composerController: Kube.ComposerController { | 37 | property variant _composerController: Kube.ComposerController { |
@@ -53,6 +54,9 @@ Kube.View { | |||
53 | } | 54 | } |
54 | } else if (newMessage) { | 55 | } else if (newMessage) { |
55 | composerController.clear() | 56 | composerController.clear() |
57 | for (var i = 0; i < root.recipients.length; ++i) { | ||
58 | composerController.addTo(root.recipients[i]) | ||
59 | } | ||
56 | subject.forceActiveFocus() | 60 | subject.forceActiveFocus() |
57 | } | 61 | } |
58 | } | 62 | } |
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index c4058a30..05f4fbc3 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml | |||
@@ -58,7 +58,7 @@ Controls2.ApplicationWindow { | |||
58 | 58 | ||
59 | Kube.Listener { | 59 | Kube.Listener { |
60 | filter: Kube.Messages.compose | 60 | filter: Kube.Messages.compose |
61 | onMessageReceived: kubeViews.openComposer(true) | 61 | onMessageReceived: kubeViews.openComposer(true, message.recipients) |
62 | } | 62 | } |
63 | 63 | ||
64 | //BEGIN Shortcuts | 64 | //BEGIN Shortcuts |
@@ -134,7 +134,7 @@ Controls2.ApplicationWindow { | |||
134 | Kube.IconButton { | 134 | Kube.IconButton { |
135 | id: composerButton | 135 | id: composerButton |
136 | iconName: Kube.Icons.edit_inverted | 136 | iconName: Kube.Icons.edit_inverted |
137 | onClicked: kubeViews.openComposer(false) | 137 | onClicked: kubeViews.openComposer(false, []) |
138 | activeFocusOnTab: true | 138 | activeFocusOnTab: true |
139 | checkable: true | 139 | checkable: true |
140 | Controls2.ButtonGroup.group: viewButtonGroup | 140 | Controls2.ButtonGroup.group: viewButtonGroup |
@@ -252,9 +252,9 @@ Controls2.ApplicationWindow { | |||
252 | } | 252 | } |
253 | } | 253 | } |
254 | 254 | ||
255 | function openComposer(newMessage) { | 255 | function openComposer(newMessage, recipients) { |
256 | composerButton.checked = true | 256 | composerButton.checked = true |
257 | kubeViews.push(composerView, {newMessage: newMessage}, Controls2.StackView.Immediate) | 257 | kubeViews.push(composerView, {newMessage: newMessage, recipients: recipients}, Controls2.StackView.Immediate) |
258 | } | 258 | } |
259 | function openComposerWithMail(mail, openAsDraft) { | 259 | function openComposerWithMail(mail, openAsDraft) { |
260 | composerButton.checked = true | 260 | composerButton.checked = true |
diff --git a/framework/qml/MailViewer.qml b/framework/qml/MailViewer.qml index ef78371e..d16fde7c 100644 --- a/framework/qml/MailViewer.qml +++ b/framework/qml/MailViewer.qml | |||
@@ -140,11 +140,15 @@ Rectangle { | |||
140 | Kube.SelectableLabel { | 140 | Kube.SelectableLabel { |
141 | width: parent.width - senderName.width - date_label.width - Kube.Units.largeSpacing | 141 | width: parent.width - senderName.width - date_label.width - Kube.Units.largeSpacing |
142 | 142 | ||
143 | |||
144 | text: root.sender | 143 | text: root.sender |
145 | elide: Text.ElideRight | 144 | elide: Text.ElideRight |
146 | opacity: 0.75 | 145 | opacity: 0.75 |
147 | clip: true | 146 | clip: true |
147 | |||
148 | Kube.TextButton { | ||
149 | text: qsTr("Send mail to") | ||
150 | onClicked: Kube.Fabric.postMessage(Kube.Messages.compose, {"recipients": [root.sender]}) | ||
151 | } | ||
148 | } | 152 | } |
149 | } | 153 | } |
150 | 154 | ||