diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/package/contents/ui/FocusComposer.qml | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/components/package/contents/ui/FocusComposer.qml b/components/package/contents/ui/FocusComposer.qml index 07fb08b6..902309a8 100644 --- a/components/package/contents/ui/FocusComposer.qml +++ b/components/package/contents/ui/FocusComposer.qml | |||
@@ -23,37 +23,26 @@ import QtQuick.Controls 2.0 as Controls2 | |||
23 | import org.kde.kirigami 1.0 as Kirigami | 23 | import org.kde.kirigami 1.0 as Kirigami |
24 | 24 | ||
25 | import org.kube.framework.domain 1.0 as KubeFramework | 25 | import org.kube.framework.domain 1.0 as KubeFramework |
26 | import org.kube.framework.actions 1.0 as KubeAction | ||
27 | 26 | ||
28 | Controls2.Popup { | 27 | Controls2.Popup { |
29 | id: root | 28 | id: root |
30 | 29 | ||
31 | //Controller | 30 | //Controller |
32 | KubeFramework.ComposerController { | 31 | KubeFramework.ComposerController { |
33 | id: composer | 32 | id: composerController |
34 | onDone: { | 33 | onDone: { |
34 | clear(); | ||
35 | root.close() | 35 | root.close() |
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||
39 | //context | ||
40 | property variant mailcontext: composer.mailContext | ||
41 | |||
42 | //actions | 39 | //actions |
43 | property variant sendAction: composer.sendAction | 40 | property variant sendAction: composerController.sendAction |
44 | property variant saveAsDraftAction: composer.saveAsDraftAction | 41 | property variant saveAsDraftAction: composerController.saveAsDraftAction |
45 | 42 | ||
46 | //BEGIN functions | 43 | //BEGIN functions |
47 | function loadMessage(message, loadAsDraft) { | 44 | function loadMessage(message, loadAsDraft) { |
48 | composer.loadMessage(message, loadAsDraft) | 45 | composerController.loadMessage(message, loadAsDraft) |
49 | } | ||
50 | |||
51 | function saveAsDraft() { | ||
52 | composer.saveAsDraft() | ||
53 | } | ||
54 | |||
55 | function clear() { | ||
56 | composer.clear(); | ||
57 | } | 46 | } |
58 | //END functions | 47 | //END functions |
59 | 48 | ||
@@ -91,14 +80,14 @@ Controls2.Popup { | |||
91 | 80 | ||
92 | Layout.fillWidth: true | 81 | Layout.fillWidth: true |
93 | 82 | ||
94 | text: mailcontext.to | 83 | text: composerController.to |
95 | onTextChanged: { | 84 | onTextChanged: { |
96 | mailcontext.to = text; | 85 | composerController.to = text; |
97 | } | 86 | } |
98 | 87 | ||
99 | model: composer.recipientCompleter.model | 88 | model: composerController.recipientCompleter.model |
100 | onSearchTermChanged: { | 89 | onSearchTermChanged: { |
101 | composer.recipientCompleter.searchString = searchTerm | 90 | composerController.recipientCompleter.searchString = searchTerm |
102 | } | 91 | } |
103 | } | 92 | } |
104 | 93 | ||
@@ -116,15 +105,15 @@ Controls2.Popup { | |||
116 | 105 | ||
117 | visible: false | 106 | visible: false |
118 | 107 | ||
119 | text: mailcontext.cc | 108 | text: composerController.cc |
120 | 109 | ||
121 | onTextChanged: { | 110 | onTextChanged: { |
122 | mailcontext.cc = text; | 111 | composerController.cc = text; |
123 | } | 112 | } |
124 | 113 | ||
125 | model: composer.recipientCompleter.model | 114 | model: composerController.recipientCompleter.model |
126 | onSearchTermChanged: { | 115 | onSearchTermChanged: { |
127 | composer.recipientCompleter.searchString = searchTerm | 116 | composerController.recipientCompleter.searchString = searchTerm |
128 | } | 117 | } |
129 | } | 118 | } |
130 | 119 | ||
@@ -141,15 +130,15 @@ Controls2.Popup { | |||
141 | 130 | ||
142 | visible : false | 131 | visible : false |
143 | 132 | ||
144 | text: mailcontext.bcc | 133 | text: composerController.bcc |
145 | 134 | ||
146 | onTextChanged: { | 135 | onTextChanged: { |
147 | mailcontext.bcc = text; | 136 | composerController.bcc = text; |
148 | } | 137 | } |
149 | 138 | ||
150 | model: composer.recipientCompleter.model | 139 | model: composerController.recipientCompleter.model |
151 | onSearchTermChanged: { | 140 | onSearchTermChanged: { |
152 | composer.recipientCompleter.searchString = searchTerm | 141 | composerController.recipientCompleter.searchString = searchTerm |
153 | } | 142 | } |
154 | } | 143 | } |
155 | 144 | ||
@@ -161,13 +150,13 @@ Controls2.Popup { | |||
161 | 150 | ||
162 | Controls2.ComboBox { | 151 | Controls2.ComboBox { |
163 | id: identityCombo | 152 | id: identityCombo |
164 | model: composer.identitySelector.model | 153 | model: composerController.identitySelector.model |
165 | textRole: "displayName" | 154 | textRole: "displayName" |
166 | 155 | ||
167 | Layout.fillWidth: true | 156 | Layout.fillWidth: true |
168 | 157 | ||
169 | onCurrentIndexChanged: { | 158 | onCurrentIndexChanged: { |
170 | composer.identitySelector.currentIndex = currentIndex | 159 | composerController.identitySelector.currentIndex = currentIndex |
171 | } | 160 | } |
172 | } | 161 | } |
173 | 162 | ||
@@ -201,20 +190,20 @@ Controls2.Popup { | |||
201 | 190 | ||
202 | placeholderText: "Enter Subject..." | 191 | placeholderText: "Enter Subject..." |
203 | 192 | ||
204 | text: mailcontext.subject | 193 | text: composerController.subject |
205 | 194 | ||
206 | onTextChanged: { | 195 | onTextChanged: { |
207 | mailcontext.subject = text; | 196 | composerController.subject = text; |
208 | } | 197 | } |
209 | } | 198 | } |
210 | 199 | ||
211 | Controls2.TextArea { | 200 | Controls2.TextArea { |
212 | id: content | 201 | id: content |
213 | 202 | ||
214 | text: mailcontext.body | 203 | text: composerController.body |
215 | 204 | ||
216 | onTextChanged: { | 205 | onTextChanged: { |
217 | mailcontext.body = text; | 206 | composerController.body = text; |
218 | } | 207 | } |
219 | 208 | ||
220 | Layout.fillWidth: true | 209 | Layout.fillWidth: true |
@@ -242,7 +231,7 @@ Controls2.Popup { | |||
242 | Controls2.Button { | 231 | Controls2.Button { |
243 | text: "Save as Draft" | 232 | text: "Save as Draft" |
244 | 233 | ||
245 | enabled: saveAsDraftAction.ready | 234 | enabled: saveAsDraftAction.enabled |
246 | onClicked: { | 235 | onClicked: { |
247 | saveAsDraftAction.execute() | 236 | saveAsDraftAction.execute() |
248 | } | 237 | } |
@@ -251,7 +240,7 @@ Controls2.Popup { | |||
251 | Controls2.Button { | 240 | Controls2.Button { |
252 | text: "Send" | 241 | text: "Send" |
253 | 242 | ||
254 | enabled: sendAction.ready | 243 | enabled: sendAction.enabled |
255 | onClicked: { | 244 | onClicked: { |
256 | sendAction.execute() | 245 | sendAction.execute() |
257 | } | 246 | } |