summaryrefslogtreecommitdiffstats
path: root/components/mail
diff options
context:
space:
mode:
Diffstat (limited to 'components/mail')
-rw-r--r--components/mail/contents/ui/Mail.qml455
-rw-r--r--components/mail/contents/ui/main.qml24
-rw-r--r--components/mail/metadata.desktop8
-rw-r--r--components/mail/qmldir3
4 files changed, 0 insertions, 490 deletions
diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml
deleted file mode 100644
index 7cabf9a9..00000000
--- a/components/mail/contents/ui/Mail.qml
+++ /dev/null
@@ -1,455 +0,0 @@
1/*
2 * Copyright (C) 2017 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
20import QtQuick 2.7
21import QtQuick.Controls 1.3
22import QtQuick.Layouts 1.1
23
24import QtQuick.Controls 2.0 as Controls2
25
26import org.kube.framework 1.0 as Kube
27import org.kube.components.accounts 1.0 as KubeAccounts
28
29Controls2.ApplicationWindow {
30 id: app
31
32 //FIXME remove fixed pixel hight
33 //for now just convinience during testing
34 height: 1080 * 0.8
35 width: 1920 * 0.8
36
37 visible: true
38
39 Kube.NotificationHandler {
40 id: notificationHandler
41 function handler(n) {
42 console.warn("We got a notification: ", n.message)
43 if (n.type == Kube.Notification.Warning) {
44 console.warn("And it's a warning!", n.type)
45 }
46 notificationPopup.notify(n.message);
47 }
48 }
49
50 //BEGIN Actions
51 Kube.Context {
52 id: maillistcontext
53 property variant mail
54 property bool isDraft
55 mail: mailListView.currentMail
56 isDraft: mailListView.isDraft
57 }
58
59 Kube.Action {
60 id: replyAction
61 actionId: "org.kde.kube.actions.reply"
62 context: maillistcontext
63 }
64 //END Actions
65
66 //BEGIN ActionHandler
67 Kube.ActionHandler {
68 actionId: "org.kde.kube.actions.reply"
69 function isReady(context) {
70 return context.mail ? true : false;
71 }
72
73 function handler(context) {
74 composer.loadMessage(context.mail, false)
75 composer.open()
76 }
77 }
78
79 Kube.ActionHandler {
80 actionId: "org.kde.kube.actions.edit"
81 function isReady(context) {
82 return context.mail && context.isDraft;
83 }
84 function handler(context) {
85 composer.loadMessage(context.mail, true)
86 composer.open()
87 }
88 }
89 //END ActionHandler
90
91 //Controller
92 Kube.MailController {
93 id: mailController
94 Binding on threadLeader {
95 //!! checks for the availability of the type
96 when: !!mailListView.currentMail
97 value: mailListView.currentMail
98 }
99 }
100
101 Kube.FolderController {
102 id: folderController
103 Binding on folder {
104 //!! checks for the availability of the type
105 when: !!folderListView.currentFolder
106 value: folderListView.currentFolder
107 }
108 }
109
110 //Model
111 Kube.AccountsModel {
112 id: currentAccountModel
113 accountId: accountSwitcher.accountId
114 }
115
116 //BEGIN Shortcuts
117 Shortcut {
118 sequence: StandardKey.Refresh
119 onActivated: folderController.synchronizeAction.execute()
120 enabled: folderController.synchronizeAction.enabled
121 }
122 Shortcut {
123 sequence: StandardKey.Delete
124 onActivated: mailController.moveToTrashAction.execute()
125 enabled: mailController.moveToTrashAction.enabled
126 }
127 Shortcut {
128 sequence: StandardKey.MoveToNextLine
129 onActivated: mailListView.currentIndex++
130 }
131 Shortcut {
132 sequence: StandardKey.MoveToPreviousLine
133 onActivated: mailListView.currentIndex--
134 }
135 //END Shortcuts
136
137 //BEGIN background
138 Rectangle {
139 anchors.fill: parent
140
141 color: Kube.Colors.backgroundColor
142 }
143 //END background
144
145 //BEGIN Main content
146 SplitView {
147 anchors {
148 top: app.top
149 left: app.left
150 }
151
152 height: app.height
153 width: app.width
154
155 Rectangle {
156 width: Kube.Units.gridUnit * 10
157 Layout.maximumWidth: app.width * 0.25
158 Layout.minimumWidth: Kube.Units.gridUnit * 5
159
160 color: Kube.Colors.textColor
161
162 Controls2.ToolBar {
163 id: toolBar
164
165 anchors {
166 top: parent.top
167 left: parent.left
168 right: parent.right
169 }
170
171 RowLayout {
172 anchors.centerIn: parent
173
174 spacing: Kube.Units.largeSpacing
175
176 Kube.AccountSwitcher {
177 id: accountSwitcher
178 iconName: Kube.Icons.menu
179 height: Kube.Units.gridUnit * 1.5
180 width: height
181 }
182
183 ToolButton {
184 iconName: Kube.Icons.user
185 height: Kube.Units.gridUnit * 1.5
186 width: height
187
188 onClicked: {
189 people.open()
190 }
191 }
192
193 ToolButton {
194 iconName: Kube.Icons.search
195 height: Kube.Units.gridUnit * 1.5
196 width: height
197
198 onClicked: {
199 search.open()
200 }
201 }
202 }
203 }
204
205 Kube.PositiveButton {
206 id: newMailButton
207
208 anchors {
209 top: toolBar.bottom
210 left: parent.left
211 right: parent.right
212 margins: Kube.Units.largeSpacing
213 }
214
215 text: qsTr("New Email")
216
217 onClicked: {
218 composer.open()
219 }
220 }
221
222 Item {
223 id: accountName
224
225 Kube.FolderController {
226 id: accountNameFolderController
227 accountId: accountSwitcher.accountId
228 }
229
230 Menu {
231 id: contextMenu
232 title: "Edit"
233
234 MenuItem {
235 text: "Synchronize"
236 onTriggered: {
237 accountNameFolderController.synchronizeAction.execute()
238 }
239 }
240 }
241
242 anchors {
243 top: newMailButton.bottom
244 topMargin: Kube.Units.smallSpacing
245 }
246
247 width: parent.width
248 height: Kube.Units.gridUnit * 2
249
250 MouseArea {
251 anchors.fill: parent
252 acceptedButtons: Qt.RightButton
253 onClicked: {
254 contextMenu.popup()
255 }
256 }
257
258 Repeater {
259 model: currentAccountModel
260 Row {
261 spacing: Kube.Units.smallSpacing
262 anchors {
263 bottom: parent.bottom
264 left: parent.left
265 leftMargin: Kube.Units.smallSpacing
266 }
267 Layout.fillHeight: true
268
269 Text {
270 text: model.name
271 font.weight: Font.DemiBold
272 color: Kube.Colors.highlightedTextColor
273 }
274
275 Kube.Icon {
276 id: statusIcon
277 visible: false
278 iconName: ""
279 states: [
280 State {
281 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus
282 PropertyChanges { target: statusIcon; iconName: Kube.Icons.busy; visible: true }
283 },
284 State {
285 name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus
286 PropertyChanges { target: statusIcon; iconName: Kube.Icons.error; visible: true }
287 },
288 State {
289 name: "checkmark"; when: model.status == Kube.AccountsModel.ConnectedStatus
290 PropertyChanges { target: statusIcon; iconName: Kube.Icons.connected; visible: true }
291 },
292 State {
293 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
294 PropertyChanges { target: statusIcon; iconName: Kube.Icons.noNetworkConnection; visible: true }
295 }
296 ]
297 }
298 }
299 }
300 }
301
302 Kube.FolderListView {
303 id: folderListView
304
305 anchors {
306 top: accountName.bottom
307 topMargin: Kube.Units.smallSpacing
308 bottom: statusBar.top
309 left: parent.left
310 right: parent.right
311 }
312
313 focus: true
314 accountId: accountSwitcher.accountId
315 }
316
317 Item {
318 id: statusBar
319 anchors {
320 topMargin: Kube.Units.smallSpacing
321 bottom: outbox.top
322 left: parent.left
323 right: parent.right
324 }
325
326 height: Kube.Units.gridUnit
327
328 Repeater {
329 model: currentAccountModel
330 Text {
331 id: statusText
332 anchors.centerIn: parent
333 visible: false
334 color: Kube.Colors.highlightedTextColor
335 states: [
336 State {
337 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
338 PropertyChanges { target: statusText; text: "Offline"; visible: true }
339 }
340 ]
341 }
342 }
343 }
344
345 Kube.Outbox {
346 id: outbox
347
348 anchors {
349 bottom: parent.bottom
350 left: parent.left
351 right: parent.right
352 }
353 height: Kube.Units.gridUnit * 1.5
354 }
355 }
356
357 Kube.MailListView {
358 id: mailListView
359 parentFolder: folderListView.currentFolder
360 width: Kube.Units.gridUnit * 20
361 height: parent.height
362 Layout.maximumWidth: app.width * 0.4
363 Layout.minimumWidth: Kube.Units.gridUnit * 10
364 focus: true
365 }
366
367 Kube.ConversationView {
368 id: mailView
369 mail: mailListView.currentMail
370 Layout.fillWidth: true
371 }
372 }
373 //END Main content
374
375 //BEGIN Composer
376 Kube.FocusComposer {
377 id: composer
378
379 height: app.height * 0.85
380 width: app.width * 0.85
381
382 x: app.width * 0.075
383 y: app.height * 0.075
384 }
385 //END Composer
386
387 //BEGIN AccountWizard
388 KubeAccounts.AccountWizard {
389 id: accountWizard
390
391 height: app.height * 0.85
392 width: app.width * 0.85
393
394 x: app.width * 0.075
395 y: app.height * 0.075
396 }
397 //END AccountWizard
398
399 //BEGIN Notification
400 Kube.NotificationPopup {
401 id: notificationPopup
402
403 anchors {
404 top: parent.top
405 horizontalCenter: parent.horizontalCenter
406 }
407 }
408 //END Notification
409
410 //BEGIN Search
411 Controls2.Popup {
412 id: search
413
414 width: app.width * 0.6
415 height: Kube.Units.gridUnit * 3
416
417 x: app.width * 0.2
418 y: app.height * 0.2
419
420 modal: true
421 focus: true
422
423 RowLayout {
424 anchors.fill: parent
425
426 Controls2.TextField {
427 id: searchField
428 Layout.fillWidth: true
429 placeholderText: "Search... is not available in this beta"
430 }
431
432 Controls2.Button {
433 text: "Go"
434
435 onClicked: {
436 search.close()
437 }
438 }
439 }
440 }
441 //END Search
442
443 //BEGIN People
444 Kube.People {
445 id: people
446
447 height: app.height * 0.85
448 width: app.width * 0.85
449
450 x: app.width * 0.075
451 y: app.height * 0.075
452
453 }
454 //END People
455}
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml
deleted file mode 100644
index abf0465d..00000000
--- a/components/mail/contents/ui/main.qml
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2017 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
19import QtQuick 2.7
20import org.kube.components.mail 1.0 as MailComponent
21
22MailComponent.Mail {
23
24}
diff --git a/components/mail/metadata.desktop b/components/mail/metadata.desktop
deleted file mode 100644
index 470ad18c..00000000
--- a/components/mail/metadata.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
1[Desktop Entry]
2Name=Kube Mail
3X-KDE-PluginInfo-Name=org.kube.components.mail
4Exec=kpackagelauncherqml -a org.kube.components.mail
5X-Plasma-MainScript=ui/main.qml
6X-KDE-ServiceTypes=KPackage/GenericQML
7Icon=kmail2
8Type=Service
diff --git a/components/mail/qmldir b/components/mail/qmldir
deleted file mode 100644
index 2c0088f6..00000000
--- a/components/mail/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
1module org.kube.components.mail
2
3Mail 1.0 Mail.qml