summaryrefslogtreecommitdiffstats
path: root/applications
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-09 15:13:00 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-09 15:14:19 +0100
commit2dac72ae43f627340694d89db68184cb07e68650 (patch)
tree5397a5b6216bd05f9f48a219f379d59d64c8bde4 /applications
parentda079fe211094621fbcb89614e58b84caa9a603b (diff)
downloadkube-2dac72ae43f627340694d89db68184cb07e68650.tar.gz
kube-2dac72ae43f627340694d89db68184cb07e68650.zip
Moved application to components
Diffstat (limited to 'applications')
-rw-r--r--applications/CMakeLists.txt4
-rw-r--r--applications/kube-mail/package/contents/ui/Avatar.qml55
-rw-r--r--applications/kube-mail/package/contents/ui/ColorPalette.qml26
-rw-r--r--applications/kube-mail/package/contents/ui/Composer.qml221
-rw-r--r--applications/kube-mail/package/contents/ui/FocusComposer.qml81
-rw-r--r--applications/kube-mail/package/contents/ui/FolderListView.qml116
-rw-r--r--applications/kube-mail/package/contents/ui/FolderModel.qml36
-rw-r--r--applications/kube-mail/package/contents/ui/ListItem.qml63
-rw-r--r--applications/kube-mail/package/contents/ui/MailListModel.qml149
-rw-r--r--applications/kube-mail/package/contents/ui/MailListView.qml155
-rw-r--r--applications/kube-mail/package/contents/ui/MailViewer.qml43
-rw-r--r--applications/kube-mail/package/contents/ui/Settings.qml74
-rw-r--r--applications/kube-mail/package/contents/ui/SingleMailView.qml74
-rw-r--r--applications/kube-mail/package/contents/ui/example.qml64
-rw-r--r--applications/kube-mail/package/contents/ui/main.qml200
-rw-r--r--applications/kube-mail/package/metadata.desktop8
-rw-r--r--applications/mail/CMakeLists.txt (renamed from applications/kube-mail/CMakeLists.txt)3
-rw-r--r--applications/mail/main.cpp (renamed from applications/kube-mail/main.cpp)0
18 files changed, 2 insertions, 1370 deletions
diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt
index dd65a3e8..df78d62a 100644
--- a/applications/CMakeLists.txt
+++ b/applications/CMakeLists.txt
@@ -1,2 +1,2 @@
1add_subdirectory(kube-mail) 1add_subdirectory(mail)
2add_subdirectory(kube-accounts) 2#add_subdirectory(kube-accounts)
diff --git a/applications/kube-mail/package/contents/ui/Avatar.qml b/applications/kube-mail/package/contents/ui/Avatar.qml
deleted file mode 100644
index 33d6733c..00000000
--- a/applications/kube-mail/package/contents/ui/Avatar.qml
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.3
20import QtQuick.Layouts 1.1
21
22
23Rectangle {
24
25 property string name;
26
27 //colors taken from https://techbase.kde.org/Projects/Usability/HIG/Color
28 function calcColor(x)
29 {
30 switch (x % 5) {
31 case 0:
32 return "#16a085"
33 case 1:
34 return "#27ae60"
35 case 2:
36 return "#2980b9"
37 case 3:
38 return "#8e44ad"
39 case 4:
40 return "#c0392b"
41 }
42 }
43
44 radius: 2
45
46 color: calcColor(name.length)
47
48 Text {
49 anchors.centerIn: parent
50
51 text: name.charAt(0)
52
53 color: "#ecf0f1"
54 }
55}
diff --git a/applications/kube-mail/package/contents/ui/ColorPalette.qml b/applications/kube-mail/package/contents/ui/ColorPalette.qml
deleted file mode 100644
index db85cac6..00000000
--- a/applications/kube-mail/package/contents/ui/ColorPalette.qml
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19
20//TODO probably expose it from the Cpp side
21Item {
22 property string background: "#fcfcfc"
23 property string selected: "#3daee9"
24 property string read: "#232629"
25 property string border: "#232629"
26} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/Composer.qml b/applications/kube-mail/package/contents/ui/Composer.qml
deleted file mode 100644
index 1a6a4cc4..00000000
--- a/applications/kube-mail/package/contents/ui/Composer.qml
+++ /dev/null
@@ -1,221 +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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.4
20import QtQuick.Layouts 1.1
21import org.kde.plasma.components 2.0 as PlasmaComponents
22
23import org.kde.kube.mail 1.0 as Mail
24
25
26Item {
27 id: root
28 property variant originalMessage
29
30 function send() {
31 composer.send()
32 }
33
34 function saveAsDraft() {
35 composer.saveAsDraft()
36 }
37
38 function clear() {
39 composer.clear();
40 }
41
42 Mail.Retriever {
43 id: retriever
44 propertyName: "mimeMessage"
45 model: Mail.MailListModel {
46 id: mailListModel
47 mail: root.originalMessage
48 }
49 }
50
51 Mail.Composer {
52 id: composer
53 originalMessage: retriever.value
54 }
55
56 ColumnLayout {
57
58 anchors.fill: parent
59
60 GridLayout {
61
62 columns: 2
63
64 Label {
65 text: "From"
66 }
67
68 ComboBox {
69 model: composer.identityModel
70
71 Layout.fillWidth: true
72
73 currentIndex: composer.fromIndex
74
75 onCurrentIndexChanged: {
76 composer.fromIndex = currentIndex
77 }
78 }
79
80 Label {
81 text: "To"
82 }
83
84 RowLayout {
85 Layout.fillWidth: true
86
87 TextField {
88 id: to
89
90 Layout.fillWidth: true
91
92 text: composer.to
93
94 onTextChanged: {
95 composer.to = text;
96 }
97 }
98
99 PlasmaComponents.Button {
100 id: ccButton
101
102 text: "Cc"
103
104 onClicked: {
105 cc.visible = true
106 ccButton.visible = false
107 }
108 }
109
110 PlasmaComponents.Button {
111 id: bccButton
112
113 text: "Bcc"
114
115 onClicked: {
116 bcc.visible = true
117 bccButton.visible = false
118 }
119 }
120 }
121
122 Label {
123 text: "Cc"
124
125 visible: cc.visible
126 }
127
128 TextField {
129 id: cc
130
131 Layout.fillWidth: true
132
133 visible: false
134
135 text: composer.cc
136
137 onTextChanged: {
138 composer.cc = text;
139 }
140 }
141
142 Label {
143 text: "Bcc"
144
145 visible: bcc.visible
146 }
147
148 TextField {
149 id: bcc
150
151 Layout.fillWidth: true
152
153 visible : false
154
155 text: composer.bcc
156
157 onTextChanged: {
158 composer.bcc = text;
159 }
160 }
161 }
162
163 TextField {
164 id: subject
165
166 Layout.fillWidth: true
167
168 placeholderText: "Enter Subject"
169
170 text: composer.subject
171
172 onTextChanged: {
173 composer.subject = text;
174 }
175 }
176
177 Item {
178
179 Layout.fillWidth: true
180
181 height: subject.height * 1.5
182
183 PlasmaComponents.Button {
184
185 anchors {
186 bottom: parent.bottom
187 }
188
189 text: "Save as Draft"
190
191 onClicked: {
192 composer.saveAsDraft()
193 }
194 }
195
196 PlasmaComponents.Button {
197
198 anchors {
199 bottom: parent.bottom
200 right: parent.right
201 }
202
203 text: "Attach"
204 }
205 }
206
207 TextArea {
208 id: content
209
210 text: composer.body
211
212 onTextChanged: {
213 composer.body = text;
214 }
215
216 Layout.fillWidth: true
217 Layout.fillHeight: true
218
219 }
220 }
221}
diff --git a/applications/kube-mail/package/contents/ui/FocusComposer.qml b/applications/kube-mail/package/contents/ui/FocusComposer.qml
deleted file mode 100644
index 8ec01cc9..00000000
--- a/applications/kube-mail/package/contents/ui/FocusComposer.qml
+++ /dev/null
@@ -1,81 +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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.4
20import QtQuick.Layouts 1.1
21
22Rectangle {
23 id: root
24 property variant originalMessage
25
26 visible: false
27
28 color: colorPalette.border
29
30 opacity: 0.9
31
32 MouseArea {
33 anchors.fill: parent
34
35 onClicked: {
36 root.visible = false
37 }
38 }
39
40 Rectangle {
41 anchors.centerIn: parent
42
43 height: root.height * 0.8
44 width: root.width * 0.8
45
46 color: colorPalette.background
47
48 MouseArea {
49 anchors.fill: parent
50 }
51
52 ColumnLayout {
53
54 anchors {
55 fill: parent
56 margins: unit.size * 3
57 }
58
59 Composer {
60 id: composer
61
62 Layout.fillWidth: true
63 Layout.fillHeight: true
64 originalMessage: root.originalMessage
65 }
66
67 RowLayout {
68 Layout.alignment: Qt.AlignRight
69
70 Button {
71 text: "Send"
72
73 onClicked: {
74 composer.send()
75 root.visible = false
76 }
77 }
78 }
79 }
80 }
81} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/FolderListView.qml b/applications/kube-mail/package/contents/ui/FolderListView.qml
deleted file mode 100644
index 1934932c..00000000
--- a/applications/kube-mail/package/contents/ui/FolderListView.qml
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.4
20import QtQuick.Controls.Styles 1.4
21import QtQuick.Layouts 1.1
22
23import org.kde.plasma.core 2.0 as PlasmaCore
24import org.kde.plasma.components 2.0 as PlasmaComponents
25
26import org.kde.kube.mail 1.0 as Mail
27
28Item {
29 id: root
30 property variant currentFolder
31 SystemPalette { id: colorPalette; colorGroup: SystemPalette.Active }
32
33 Item {
34 id: searchBox
35
36 width: root.width
37 height: unit.size * 10
38
39 TextField {
40 anchors. centerIn: parent
41
42 width: parent.width * 0.9
43
44 placeholderText: "Search all email..."
45 }
46 }
47
48 TreeView {
49 id: treeView
50 anchors {
51 top: searchBox.bottom
52 left: parent.left
53 right: parent.right
54 bottom: parent.bottom
55 }
56 TableViewColumn {
57 title: "Name"
58 role: "name"
59 width: treeView.width - 5
60 }
61 model: Mail.FolderListModel { id: folderListModel }
62 onCurrentIndexChanged: {
63 model.fetchMore(currentIndex)
64 root.currentFolder = model.data(currentIndex, Mail.FolderListModel.DomainObject)
65 }
66 backgroundVisible: false
67 headerVisible: false
68 style: TreeViewStyle {
69 activateItemOnSingleClick: true
70 rowDelegate: Rectangle {
71 height: unit.size * 10
72 color: "transparent"
73 }
74 itemDelegate: Rectangle {
75 radius: 5
76 border.width: 1
77 border.color: "lightgrey"
78 color: styleData.selected ? colorPalette.highlight : colorPalette.button
79 PlasmaCore.IconItem {
80 id: iconItem
81 anchors {
82 verticalCenter: parent.verticalCenter
83 left: parent.left
84 leftMargin: unit.size * 3
85 }
86 source: model.icon
87 }
88 Label {
89 anchors {
90 verticalCenter: parent.verticalCenter
91 left: iconItem.right
92 leftMargin: unit.size * 3
93 }
94 renderType: Text.NativeRendering
95 text: styleData.value
96 font.pixelSize: 16
97 font.bold: true
98 color: styleData.selected ? colorPalette.highlightedText : colorPalette.text
99 }
100 }
101 branchDelegate: Item {
102 width: 16
103 height: 16
104 Text {
105 visible: styleData.column === 0 && styleData.hasChildren
106 text: styleData.isExpanded ? "\u25bc" : "\u25b6"
107 color: !control.activeFocus || styleData.selected ? styleData.textColor : "#666"
108 font.pointSize: 10
109 renderType: Text.NativeRendering
110 anchors.centerIn: parent
111 anchors.verticalCenterOffset: styleData.isExpanded ? 2 : 0
112 }
113 }
114 }
115 }
116}
diff --git a/applications/kube-mail/package/contents/ui/FolderModel.qml b/applications/kube-mail/package/contents/ui/FolderModel.qml
deleted file mode 100644
index b20a1606..00000000
--- a/applications/kube-mail/package/contents/ui/FolderModel.qml
+++ /dev/null
@@ -1,36 +0,0 @@
1import QtQuick 2.4
2
3ListModel {
4 ListElement {
5 icon: "mail-folder-inbox"
6 name: "Inbox"
7 }
8 ListElement {
9 icon: "mail-folder-sent"
10 name: "Sent"
11 }
12 ListElement {
13 icon: "user-trash"
14 name: "Trash"
15 }
16 ListElement {
17 icon: "document-edit"
18 name: "Drafts"
19 }
20 ListElement {
21 icon: "folder"
22 name: "cats"
23 }
24 ListElement {
25 icon: "folder"
26 name: "dogs"
27 }
28 ListElement {
29 icon: "folder"
30 name: "dragons"
31 }
32 ListElement {
33 icon: "folder"
34 name: "long tailed dragons"
35 }
36} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/ListItem.qml b/applications/kube-mail/package/contents/ui/ListItem.qml
deleted file mode 100644
index 5396645d..00000000
--- a/applications/kube-mail/package/contents/ui/ListItem.qml
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19
20Item {
21 id: delegateRoot
22
23 readonly property bool isCurrentItem: ListView.isCurrentItem
24
25 height: unit.width * 25
26 width: parent.width
27
28 MouseArea {
29 id: mouseArea
30
31 anchors.fill: parent
32 }
33
34 Rectangle {
35 anchors.fill: parent
36
37 color: colorPalette.background
38
39 //clickColor
40 Rectangle {
41 id: clickColor
42
43 anchors.fill: parent
44
45 color: colorPalette.selected
46 opacity: 0.4
47
48 visible: mouseArea.pressed
49 }
50
51 //border
52 Rectangle {
53
54 anchors.bottom: parent.bottom
55
56 height: 1
57 width: parent.width
58
59 color: colorPalette.border
60 opacity: 0.2
61 }
62 }
63} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/MailListModel.qml b/applications/kube-mail/package/contents/ui/MailListModel.qml
deleted file mode 100644
index bf0f70a2..00000000
--- a/applications/kube-mail/package/contents/ui/MailListModel.qml
+++ /dev/null
@@ -1,149 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19
20ListModel {
21 ListElement {
22 sender: "mighty@mail.com"
23 senderName: "Mighty Monkey"
24 subject: "I feel weak without my bananas"
25 date: "19:21"
26 unread: true
27 }
28 ListElement {
29 sender: "benni@bandana.org"
30 senderName: "Ben Bandana"
31 subject: "Check this out"
32 date: "16:01"
33 unread: true
34 }
35 ListElement {
36 sender: "alice@mail.com"
37 senderName: "Alice Cheng"
38 subject: "Re: We need more food"
39 date: "12:55"
40 unread: false
41 }
42 ListElement {
43 sender: "bob@bandana.org"
44 senderName: "Bob Ross"
45 subject: "KDE Rocks"
46 date: "Sat"
47 unread: true
48 }
49 ListElement {
50 sender: "tiny@mail.com"
51 senderName: "Tiny"
52 subject: "Huge success!!"
53 date: "Sat"
54 unread: false
55 }
56 ListElement {
57 sender: "bob@bandana.org"
58 senderName: "Bob Ross"
59 subject: "KDE Rocks"
60 date: "Fr"
61 unread: false
62 }
63 ListElement {
64 sender: "Laura@mail.com"
65 senderName: "Laura B"
66 subject: ":)"
67 date: "Thu"
68 unread: false
69 }
70 ListElement {
71 sender: "Andreas@stars.org"
72 senderName: "Andreas Rockstar"
73 subject: "KDE Rocks"
74 date: "Wed"
75 unread: false
76 }
77 ListElement {
78 sender: "alice@mail.com"
79 senderName: "Alice Cheng"
80 subject: "Re: We need more food"
81 date: "Wed"
82 }
83 ListElement {
84 sender: "bob@bandana.org"
85 senderName: "Bob Ross"
86 subject: "KDE Rocks"
87 date: "Mon"
88 }
89 ListElement {
90 sender: "mighty@mail.com"
91 senderName: "Mighty Monkey"
92 subject: "I feel weak without my bananas"
93 date: "Nov 20"
94 }
95 ListElement {
96 sender: "benni@bandana.org"
97 senderName: "Ben Bandana"
98 subject: "Check this out"
99 date: "Nov 15"
100 }
101 ListElement {
102 sender: "alice@mail.com"
103 senderName: "Alice Cheng"
104 subject: "Re: We need more food"
105 date: "Sep 29"
106 }
107 ListElement {
108 sender: "bob@bandana.org"
109 senderName: "Bob Ross"
110 subject: "KDE Rocks"
111 date: "Sep 14"
112 }
113 ListElement {
114 sender: "tiny@mail.com"
115 senderName: "Tiny"
116 subject: "Huge success!!"
117 date: "Sep 14"
118 }
119 ListElement {
120 sender: "bob@bandana.org"
121 senderName: "Bob Ross"
122 subject: "KDE Rocks"
123 date: "Sep 5"
124 }
125 ListElement {
126 sender: "Laura@mail.com"
127 senderName: "Laura B"
128 subject: ":)"
129 date: "Sep 4"
130 }
131 ListElement {
132 sender: "Andreas@stars.org"
133 senderName: "Andreas Rockstar"
134 subject: "KDE Rocks"
135 date: "May 25"
136 }
137 ListElement {
138 sender: "alice@mail.com"
139 senderName: "Alice Cheng"
140 subject: "Re: We need more food"
141 date: "May 3"
142 }
143 ListElement {
144 sender: "bob@bandana.org"
145 senderName: "Bob Ross"
146 subject: "Board Task: Write draft email to people with KDE accounts commiting to Qt repositories"
147 date: "Dec 2014"
148 }
149} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/MailListView.qml b/applications/kube-mail/package/contents/ui/MailListView.qml
deleted file mode 100644
index ff773e0e..00000000
--- a/applications/kube-mail/package/contents/ui/MailListView.qml
+++ /dev/null
@@ -1,155 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.4
20import QtQuick.Layouts 1.1
21
22import QtQml 2.2
23
24import org.kde.plasma.components 2.0 as PlasmaComponents
25
26import org.kde.kube.mail 1.0 as Mail
27
28ScrollView {
29 id: root
30 property variant parentFolder
31 property variant currentMail
32
33 ListView {
34 id: listView
35
36 model: Mail.MailListModel {
37 parentFolder: root.parentFolder
38 }
39
40 Keys.onDownPressed: {
41 incrementCurrentIndex()
42 }
43 Keys.onUpPressed: {
44 decrementCurrentIndex()
45 }
46 focus: true
47
48 delegate: PlasmaComponents.ListItem {
49 width: listView.width
50 height: unit.size * 12
51
52 enabled: true
53 checked: listView.currentIndex == index
54
55 Binding {
56 target: root
57 property: "currentMail"
58 when: listView.currentIndex == index
59 value: model.domainObject
60 }
61
62 MouseArea {
63 anchors.fill: parent
64
65 onClicked: {
66 listView.currentIndex = model.index
67 }
68 }
69
70 Rectangle {
71 id: unread
72
73 anchors.fill: parent
74
75 // color: colorPalette.read
76 color: "steelblue"
77 opacity: 0.1
78
79 visible: model.unread
80 }
81
82 Avatar {
83 id: avatar
84
85 anchors {
86 verticalCenter: parent.verticalCenter
87 left: parent.left
88 leftMargin: unit.size * 2
89 }
90
91 height: unit.size * 9
92 width: height
93
94 name: model.senderName
95 }
96
97 Label {
98 id: senderName
99
100 anchors {
101 top: avatar.top
102 left: avatar.right
103 leftMargin: unit.size * 3
104 }
105
106 text: model.senderName
107
108 font.weight: Font.DemiBold
109 }
110
111 //The name currently contains both name and address
112 // Label {
113 // id: sender
114 //
115 // anchors {
116 // top: avatar.top
117 // left: senderName.right
118 // leftMargin: unit.size
119 // right: date.left
120 // rightMargin: unit.size
121 // }
122 //
123 // text: "(" + model.sender +")"
124 //
125 // clip: true
126 // }
127
128 Label {
129 id: date
130
131 anchors {
132 top: avatar.top
133 right: parent.right
134 rightMargin: unit.size * 2
135 }
136
137 text: Qt.formatDateTime(model.date)
138
139 font.weight: Font.Light
140 }
141
142 Label {
143 id: subject
144
145 anchors {
146 bottom: avatar.bottom
147 left: avatar.right
148 leftMargin: unit.size * 3
149 }
150
151 text: model.subject
152 }
153 }
154 }
155}
diff --git a/applications/kube-mail/package/contents/ui/MailViewer.qml b/applications/kube-mail/package/contents/ui/MailViewer.qml
deleted file mode 100644
index 1d305297..00000000
--- a/applications/kube-mail/package/contents/ui/MailViewer.qml
+++ /dev/null
@@ -1,43 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Controls 1.3
3import QtQuick.Layouts 1.1
4import QtWebKit 3.0
5
6import org.kde.kube.mail 1.0 as Mail
7
8Item {
9 id: root
10 property variant message;
11 property string html;
12
13 WebView {
14 id: webview
15 anchors.fill: parent
16 onNavigationRequested: {
17 // detect URL scheme prefix, most likely an external link
18 var schemaRE = /^\w+:/;
19 if (schemaRE.test(request.url)) {
20 request.action = WebView.AcceptRequest;
21 } else {
22 request.action = WebView.IgnoreRequest;
23 // delegate request.url here
24 }
25 }
26 onLoadingChanged: {
27 console.warn("Error is ", loadRequest.errorString);
28 console.warn("Status is ", loadRequest.status);
29 }
30 }
31
32 onHtmlChanged: {
33 // console.warn("HTML is ", html);
34 // The file:/// argument is necessary so local icons are found
35 webview.loadHtml(html, "file:///");
36 }
37
38 Mail.MessageParser {
39 id: messageParser
40 message: root.message
41 }
42 html: messageParser.html
43}
diff --git a/applications/kube-mail/package/contents/ui/Settings.qml b/applications/kube-mail/package/contents/ui/Settings.qml
deleted file mode 100644
index da44d331..00000000
--- a/applications/kube-mail/package/contents/ui/Settings.qml
+++ /dev/null
@@ -1,74 +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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.4
20import QtQuick.Layouts 1.1
21
22import org.kde.kube.settings 1.0 as KubeSettings
23import org.kde.kube.accounts.maildir 1.0 as Maildir
24
25Rectangle {
26 id: root
27
28 visible: false
29
30 color: colorPalette.border
31
32 opacity: 0.9
33
34 MouseArea {
35 anchors.fill: parent
36
37 onClicked: {
38 root.visible = false
39 }
40 }
41
42 Rectangle {
43 anchors.centerIn: parent
44
45 height: root.height * 0.8
46 width: root.width * 0.8
47
48 color: colorPalette.background
49
50 MouseArea {
51 anchors.fill: parent
52 }
53
54 KubeSettings.Settings {
55 id: contextSettings
56 identifier: "applicationcontext"
57 property string currentAccountId: "current"
58 property var availableAccountTypes: ["maildir"]
59 property var accounts: ["current"]
60 }
61
62 Column {
63 spacing: 5
64 Repeater {
65 model: contextSettings.accounts
66 delegate: Maildir.AccountSettings { //This should be retrieved from the accounts plugin: KubeAccounts { identifier: modelData }.settingsUi
67 accountId: modelData
68 }
69 }
70 }
71
72 //TODO: Add possibility to add more accounts
73 }
74}
diff --git a/applications/kube-mail/package/contents/ui/SingleMailView.qml b/applications/kube-mail/package/contents/ui/SingleMailView.qml
deleted file mode 100644
index d6ae4bfa..00000000
--- a/applications/kube-mail/package/contents/ui/SingleMailView.qml
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.3
20import QtQuick.Layouts 1.1
21
22import org.kde.kube.mail 1.0 as Mail
23
24Item {
25 id: root
26 property variant mail;
27
28 Rectangle {
29 id: background
30
31 anchors.fill: parent
32
33 color: colorPalette.background
34 }
35
36 Repeater {
37 anchors.fill: parent
38
39 model: Mail.MailListModel {
40 mail: root.mail
41 }
42
43 delegate: Item {
44 anchors.fill: parent
45
46 ColumnLayout {
47 anchors.fill: parent
48
49 Label {
50 text: model.id
51 }
52
53 Label {
54 text: model.sender
55 }
56
57 Label {
58 text: model.senderName
59 }
60
61 Label {
62 text: model.subject
63 }
64
65 MailViewer {
66 message: model.mimeMessage
67 Layout.fillHeight: true
68 Layout.fillWidth: true
69 }
70
71 }
72 }
73 }
74}
diff --git a/applications/kube-mail/package/contents/ui/example.qml b/applications/kube-mail/package/contents/ui/example.qml
deleted file mode 100644
index e0c0a077..00000000
--- a/applications/kube-mail/package/contents/ui/example.qml
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.3
20import QtQuick.Layouts 1.1
21
22import org.kde.sink.mail 1.0
23
24Item {
25 id: root
26
27 MailList {
28 id: mailList
29
30 query: "Some Query"
31
32 }
33
34 Button {
35 id: button
36
37 anchors {
38 top: parent.top
39 right: parent.right
40 left: parent.left
41 }
42
43 text: "add mail"
44
45 onClicked: mailList.addMail("test test test");
46 }
47
48 ListView {
49
50 anchors {
51 top: button.bottom
52 left: parent.left
53 right: parent.right
54 bottom: parent.bottom
55 }
56
57 model: mailList.model
58
59 delegate: Label {
60
61 text: model.subject
62 }
63 }
64} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/main.qml b/applications/kube-mail/package/contents/ui/main.qml
deleted file mode 100644
index cf983dee..00000000
--- a/applications/kube-mail/package/contents/ui/main.qml
+++ /dev/null
@@ -1,200 +0,0 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.3
20import QtQuick.Layouts 1.1
21import org.kde.plasma.components 2.0 as PlasmaComponents
22
23import org.kde.kube.actions 1.0 as KubeAction
24import org.kde.kube.settings 1.0 as KubeSettings
25
26ApplicationWindow {
27 id: app
28
29 //FIXME remove fixed pixel hight
30 //for now just convinience during testing
31 height: 1080 * 0.7
32 width: 1920 * 0.7
33
34 visible: true
35
36 // Action.ActionHandler {
37 // actionId: "org.kde.kube.actions.mark-as-read"
38 // function isReady(context) {
39 // return context.mail ? true : false;
40 // }
41 //
42 // function handler(context) {
43 // console.warn("Got message:", context.mail)
44 // }
45 // }
46
47 KubeAction.Context {
48 id: maillistcontext
49 property variant mail
50 mail: mailListView.currentMail
51 }
52
53 KubeAction.Action {
54 id: markAsReadAction
55 actionId: "org.kde.kube.actions.mark-as-read"
56 context: maillistcontext
57 }
58
59 KubeAction.Action {
60 id: deleteAction
61 actionId: "org.kde.kube.actions.delete"
62 context: maillistcontext
63 }
64
65 //UI
66 toolBar: ToolBar {
67
68 Row {
69 anchors.fill: parent
70
71 PlasmaComponents.ToolButton {
72 height: parent.height
73 text: "Settings"
74 onClicked: {
75 settings.visible = true
76 }
77 }
78
79 PlasmaComponents.ToolButton {
80 height: parent.height
81 iconName: "mail-message-new"
82 text: "Compose"
83 onClicked: {
84 composer.visible = true
85 }
86 }
87
88 PlasmaComponents.ToolButton {
89 height: parent.height
90 iconName: "mail-message-reply"
91 text: "Reply"
92 onClicked: {
93 composer.originalMessage = mailListView.currentMail
94 composer.visible = true
95 }
96 }
97
98 PlasmaComponents.ToolButton {
99 height: parent.height
100 iconName: "mail-mark-unread"
101 text: "Mark As Read"
102 enabled: markAsReadAction.ready
103 onClicked: {
104 markAsReadAction.execute()
105 }
106 }
107
108 PlasmaComponents.ToolButton {
109 height: parent.height
110 iconName: "mail-mark-important"
111 text: "Mark Important"
112 enabled: false
113 onClicked: {
114 }
115 }
116
117 PlasmaComponents.ToolButton {
118 height: parent.height
119 iconName: "edit-delete"
120 text: "Delete Mail"
121 enabled: deleteAction.ready
122 onClicked: {
123 deleteAction.execute()
124 }
125 }
126
127
128 }
129 Rectangle {
130 anchors {
131 right: parent.right
132 }
133 height: parent.height
134 color: "transparent"
135 Image {
136 id: img
137 height: parent.height
138 fillMode: Image.PreserveAspectCrop
139 anchors {
140 verticalCenter: parent.verticalCenter
141 left: parent.left
142 leftMargin: -20
143 }
144 source: "image://kube/kube_logo"
145 sourceSize.height: parent.height * 2.5
146 }
147 width: img.width * 0.7
148 }
149 }
150
151 SplitView {
152 anchors.fill: parent
153
154 FolderListView {
155 id: folderListView
156 width: unit.size * 55
157 Layout.maximumWidth: unit.size * 150
158 Layout.minimumWidth: unit.size * 30
159 }
160
161 MailListView {
162 id: mailListView
163 parentFolder: folderListView.currentFolder
164 width: unit.size * 80
165 Layout.maximumWidth: unit.size * 250
166 Layout.minimumWidth: unit.size * 50
167 focus: true
168 }
169
170 SingleMailView {
171 id: mailView
172 mail: mailListView.currentMail
173 Layout.fillWidth: true
174 }
175
176 }
177
178 Settings {
179 id: settings
180
181 anchors.fill: parent
182 }
183
184 FocusComposer {
185 id: composer
186
187 anchors.fill: parent
188 }
189
190 //TODO find a better way to scale UI
191 Item {
192 id: unit
193 property int size: 5
194 }
195
196 ColorPalette {
197 id: colorPalette
198 }
199}
200
diff --git a/applications/kube-mail/package/metadata.desktop b/applications/kube-mail/package/metadata.desktop
deleted file mode 100644
index 630cc133..00000000
--- a/applications/kube-mail/package/metadata.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
1[Desktop Entry]
2Name=Kube Mail
3X-KDE-PluginInfo-Name=org.kde.kube.mail
4Exec=kpackagelauncherqml -a org.kde.kube.mail
5X-Plasma-MainScript=ui/main.qml
6X-KDE-ServiceTypes=KPackage/GenericQML
7Icon=kmail2
8Type=Service
diff --git a/applications/kube-mail/CMakeLists.txt b/applications/mail/CMakeLists.txt
index 1b1767ed..706be8aa 100644
--- a/applications/kube-mail/CMakeLists.txt
+++ b/applications/mail/CMakeLists.txt
@@ -22,9 +22,6 @@ find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Widgets)
22set (QT_MIN_VERSION "5.4.0") 22set (QT_MIN_VERSION "5.4.0")
23find_package(KF5 REQUIRED COMPONENTS Package) 23find_package(KF5 REQUIRED COMPONENTS Package)
24 24
25# install UI package
26kpackage_install_package(package org.kde.kube.mail "genericqml")
27
28# install executable 25# install executable
29add_executable(${PROJECT_NAME} main.cpp) 26add_executable(${PROJECT_NAME} main.cpp)
30qt5_use_modules(${PROJECT_NAME} Gui Quick Widgets) 27qt5_use_modules(${PROJECT_NAME} Gui Quick Widgets)
diff --git a/applications/kube-mail/main.cpp b/applications/mail/main.cpp
index 1ff4effb..1ff4effb 100644
--- a/applications/kube-mail/main.cpp
+++ b/applications/mail/main.cpp