diff options
Diffstat (limited to 'components/package/contents/ui/Composer.qml')
-rw-r--r-- | components/package/contents/ui/Composer.qml | 243 |
1 files changed, 0 insertions, 243 deletions
diff --git a/components/package/contents/ui/Composer.qml b/components/package/contents/ui/Composer.qml deleted file mode 100644 index ebc414f7..00000000 --- a/components/package/contents/ui/Composer.qml +++ /dev/null | |||
@@ -1,243 +0,0 @@ | |||
1 | /* | ||
2 | Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License along | ||
15 | with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | import QtQuick.Controls 1.4 | ||
21 | import QtQuick.Layouts 1.1 | ||
22 | import QtQuick.Dialogs 1.0 | ||
23 | |||
24 | import org.kde.kirigami 1.0 as Kirigami | ||
25 | |||
26 | import org.kube.framework.domain 1.0 as KubeFramework | ||
27 | |||
28 | |||
29 | Item { | ||
30 | id: root | ||
31 | |||
32 | function loadMessage(message, loadAsDraft) { | ||
33 | composer.loadMessage(message, loadAsDraft) | ||
34 | } | ||
35 | |||
36 | function send() { | ||
37 | composer.send() | ||
38 | } | ||
39 | |||
40 | function saveAsDraft() { | ||
41 | composer.saveAsDraft() | ||
42 | } | ||
43 | |||
44 | function clear() { | ||
45 | composer.clear(); | ||
46 | } | ||
47 | |||
48 | KubeFramework.ComposerController { | ||
49 | id: composer | ||
50 | } | ||
51 | |||
52 | ColumnLayout { | ||
53 | |||
54 | anchors.fill: parent | ||
55 | |||
56 | TextField { | ||
57 | id: subject | ||
58 | |||
59 | Layout.fillWidth: true | ||
60 | |||
61 | placeholderText: "Enter Subject..." | ||
62 | |||
63 | text: composer.subject | ||
64 | |||
65 | onTextChanged: { | ||
66 | composer.subject = text; | ||
67 | } | ||
68 | } | ||
69 | |||
70 | GridLayout { | ||
71 | |||
72 | columns: 2 | ||
73 | |||
74 | Kirigami.Label { | ||
75 | text: "To" | ||
76 | } | ||
77 | |||
78 | RowLayout { | ||
79 | Layout.fillWidth: true | ||
80 | |||
81 | TextField { | ||
82 | id: to | ||
83 | |||
84 | Layout.fillWidth: true | ||
85 | |||
86 | text: composer.to | ||
87 | |||
88 | onTextChanged: { | ||
89 | composer.to = text; | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | |||
94 | Kirigami.Label { | ||
95 | text: "Cc" | ||
96 | |||
97 | visible: cc.visible | ||
98 | } | ||
99 | |||
100 | TextField { | ||
101 | id: cc | ||
102 | |||
103 | Layout.fillWidth: true | ||
104 | |||
105 | visible: false | ||
106 | |||
107 | text: composer.cc | ||
108 | |||
109 | onTextChanged: { | ||
110 | composer.cc = text; | ||
111 | } | ||
112 | } | ||
113 | |||
114 | Kirigami.Label { | ||
115 | text: "Bcc" | ||
116 | |||
117 | visible: bcc.visible | ||
118 | } | ||
119 | |||
120 | TextField { | ||
121 | id: bcc | ||
122 | |||
123 | Layout.fillWidth: true | ||
124 | |||
125 | visible : false | ||
126 | |||
127 | text: composer.bcc | ||
128 | |||
129 | onTextChanged: { | ||
130 | composer.bcc = text; | ||
131 | } | ||
132 | } | ||
133 | } | ||
134 | |||
135 | RowLayout { | ||
136 | Kirigami.Label { | ||
137 | text: "Sending as" | ||
138 | } | ||
139 | |||
140 | ComboBox { | ||
141 | id: identityCombo | ||
142 | model: composer.identityModel | ||
143 | textRole: "displayName" | ||
144 | |||
145 | Layout.fillWidth: true | ||
146 | |||
147 | onCurrentIndexChanged: { | ||
148 | composer.currentIdentityIndex = currentIndex | ||
149 | } | ||
150 | } | ||
151 | |||
152 | Button { | ||
153 | id: ccButton | ||
154 | |||
155 | text: "Cc" | ||
156 | |||
157 | onClicked: { | ||
158 | cc.visible = true | ||
159 | ccButton.visible = false | ||
160 | } | ||
161 | } | ||
162 | |||
163 | Button { | ||
164 | id: bccButton | ||
165 | |||
166 | text: "Bcc" | ||
167 | |||
168 | onClicked: { | ||
169 | bcc.visible = true | ||
170 | bccButton.visible = false | ||
171 | } | ||
172 | } | ||
173 | } | ||
174 | |||
175 | Item { | ||
176 | |||
177 | Layout.fillWidth: true | ||
178 | |||
179 | height: subject.height * 1.5 | ||
180 | |||
181 | Button { | ||
182 | |||
183 | anchors { | ||
184 | bottom: parent.bottom | ||
185 | right: parent.right | ||
186 | } | ||
187 | |||
188 | text: "Attach" | ||
189 | |||
190 | onClicked: { | ||
191 | fileDialog.open(); | ||
192 | } | ||
193 | } | ||
194 | } | ||
195 | |||
196 | RowLayout { | ||
197 | |||
198 | Layout.fillWidth: true | ||
199 | |||
200 | Repeater { | ||
201 | |||
202 | model: composer.attachments | ||
203 | |||
204 | delegate: Kirigami.Label { | ||
205 | id: name | ||
206 | |||
207 | text: modelData | ||
208 | |||
209 | Rectangle { | ||
210 | |||
211 | anchors.fill: parent | ||
212 | |||
213 | color: "lightsteelblue" | ||
214 | } | ||
215 | } | ||
216 | } | ||
217 | } | ||
218 | |||
219 | TextArea { | ||
220 | id: content | ||
221 | |||
222 | text: composer.body | ||
223 | |||
224 | onTextChanged: { | ||
225 | composer.body = text; | ||
226 | } | ||
227 | |||
228 | Layout.fillWidth: true | ||
229 | Layout.fillHeight: true | ||
230 | } | ||
231 | } | ||
232 | |||
233 | FileDialog { | ||
234 | id: fileDialog | ||
235 | |||
236 | title: "Please choose a file" | ||
237 | |||
238 | onAccepted: { | ||
239 | console.log("You chose: " + fileDialog.fileUrl) | ||
240 | composer.addAttachment(fileDialog.fileUrl); | ||
241 | } | ||
242 | } | ||
243 | } | ||