diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-20 16:52:00 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-20 16:52:00 +0100 |
commit | a0c48081516f8fd6adae16c57a4f851bb139e36d (patch) | |
tree | 04528b7ccd2191a17f36f59b1aaaa9804c8cec9a | |
parent | eb5dd31512b26d3240e2d07b29e976270f028297 (diff) | |
download | kube-a0c48081516f8fd6adae16c57a4f851bb139e36d.tar.gz kube-a0c48081516f8fd6adae16c57a4f851bb139e36d.zip |
Normalize the component package structure
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | components/CMakeLists.txt | 14 | ||||
-rw-r--r-- | components/accounts/contents/ui/AccountWizard.qml (renamed from components/accounts/AccountWizard.qml) | 0 | ||||
-rw-r--r-- | components/accounts/contents/ui/CreateGmail.qml (renamed from components/accounts/CreateGmail.qml) | 0 | ||||
-rw-r--r-- | components/accounts/contents/ui/CreateImap.qml (renamed from components/accounts/CreateImap.qml) | 0 | ||||
-rw-r--r-- | components/accounts/contents/ui/CreateKolabNow.qml (renamed from components/accounts/CreateKolabNow.qml) | 0 | ||||
-rw-r--r-- | components/accounts/contents/ui/CreateMaildir.qml (renamed from components/accounts/CreateMaildir.qml) | 0 | ||||
-rw-r--r-- | components/accounts/contents/ui/EditImap.qml (renamed from components/accounts/EditImap.qml) | 0 | ||||
-rw-r--r-- | components/accounts/contents/ui/EditKolabNow.qml (renamed from components/accounts/EditKolabNow.qml) | 0 | ||||
-rw-r--r-- | components/accounts/contents/ui/EditMaildir.qml (renamed from components/accounts/EditMaildir.qml) | 0 | ||||
-rw-r--r-- | components/accounts/contents/ui/main.qml (renamed from components/accounts/main.qml) | 0 | ||||
-rw-r--r-- | components/accounts/metadata.desktop | 8 | ||||
-rw-r--r-- | components/accounts/qmldir | 4 | ||||
-rw-r--r-- | components/mail/contents/ui/Mail.qml | 343 | ||||
-rw-r--r-- | components/mail/contents/ui/main.qml | 323 | ||||
-rw-r--r-- | components/mail/qmldir | 3 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 31 | ||||
-rw-r--r-- | tests/kubetestrunner.cpp | 6 | ||||
-rw-r--r-- | tests/tst_applicationstart.qml | 38 |
19 files changed, 445 insertions, 327 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a3784ad6..c4de411a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -8,3 +8,5 @@ add_subdirectory(components) | |||
8 | add_subdirectory(accounts) | 8 | add_subdirectory(accounts) |
9 | add_subdirectory(icons) | 9 | add_subdirectory(icons) |
10 | add_subdirectory(applications) | 10 | add_subdirectory(applications) |
11 | |||
12 | add_subdirectory(tests) | ||
diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index dd710975..07a5eb83 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt | |||
@@ -22,14 +22,20 @@ find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Widgets) | |||
22 | set (QT_MIN_VERSION "5.4.0") | 22 | set (QT_MIN_VERSION "5.4.0") |
23 | find_package(KF5 REQUIRED COMPONENTS Package) | 23 | find_package(KF5 REQUIRED COMPONENTS Package) |
24 | 24 | ||
25 | |||
26 | macro(install_component name) | ||
27 | install(DIRECTORY ${name}/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components/${name}) | ||
28 | install(FILES ${name}/qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/components/${name}) | ||
29 | kpackage_install_package(${name} org.kube.components.${name} "genericqml") | ||
30 | endmacro(auto_tests) | ||
31 | |||
25 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/components) | 32 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/components) |
26 | install(DIRECTORY package/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components) | 33 | install(DIRECTORY package/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components) |
34 | |||
27 | install(DIRECTORY mailviewer/qml/ DESTINATION ${QML_INSTALL_DIR}/org/kube/mailviewer) | 35 | install(DIRECTORY mailviewer/qml/ DESTINATION ${QML_INSTALL_DIR}/org/kube/mailviewer) |
28 | 36 | ||
29 | install(DIRECTORY accounts/ DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts) | 37 | install_component(mail) |
38 | install_component(accounts) | ||
30 | 39 | ||
31 | include(${CMAKE_SOURCE_DIR}/KF5KirigamiMacros.cmake) | 40 | include(${CMAKE_SOURCE_DIR}/KF5KirigamiMacros.cmake) |
32 | kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-cancel document-decrypt mail-reply-sender bookmarks folder) | 41 | kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-cancel document-decrypt mail-reply-sender bookmarks folder) |
33 | |||
34 | # install UI package | ||
35 | kpackage_install_package(mail org.kube.components.mail "genericqml") | ||
diff --git a/components/accounts/AccountWizard.qml b/components/accounts/contents/ui/AccountWizard.qml index 8cc90acb..8cc90acb 100644 --- a/components/accounts/AccountWizard.qml +++ b/components/accounts/contents/ui/AccountWizard.qml | |||
diff --git a/components/accounts/CreateGmail.qml b/components/accounts/contents/ui/CreateGmail.qml index 5d7f8194..5d7f8194 100644 --- a/components/accounts/CreateGmail.qml +++ b/components/accounts/contents/ui/CreateGmail.qml | |||
diff --git a/components/accounts/CreateImap.qml b/components/accounts/contents/ui/CreateImap.qml index 7f355409..7f355409 100644 --- a/components/accounts/CreateImap.qml +++ b/components/accounts/contents/ui/CreateImap.qml | |||
diff --git a/components/accounts/CreateKolabNow.qml b/components/accounts/contents/ui/CreateKolabNow.qml index e6022cbb..e6022cbb 100644 --- a/components/accounts/CreateKolabNow.qml +++ b/components/accounts/contents/ui/CreateKolabNow.qml | |||
diff --git a/components/accounts/CreateMaildir.qml b/components/accounts/contents/ui/CreateMaildir.qml index 99bde452..99bde452 100644 --- a/components/accounts/CreateMaildir.qml +++ b/components/accounts/contents/ui/CreateMaildir.qml | |||
diff --git a/components/accounts/EditImap.qml b/components/accounts/contents/ui/EditImap.qml index 8b137891..8b137891 100644 --- a/components/accounts/EditImap.qml +++ b/components/accounts/contents/ui/EditImap.qml | |||
diff --git a/components/accounts/EditKolabNow.qml b/components/accounts/contents/ui/EditKolabNow.qml index 8b137891..8b137891 100644 --- a/components/accounts/EditKolabNow.qml +++ b/components/accounts/contents/ui/EditKolabNow.qml | |||
diff --git a/components/accounts/EditMaildir.qml b/components/accounts/contents/ui/EditMaildir.qml index 8b137891..8b137891 100644 --- a/components/accounts/EditMaildir.qml +++ b/components/accounts/contents/ui/EditMaildir.qml | |||
diff --git a/components/accounts/main.qml b/components/accounts/contents/ui/main.qml index e15bca8f..e15bca8f 100644 --- a/components/accounts/main.qml +++ b/components/accounts/contents/ui/main.qml | |||
diff --git a/components/accounts/metadata.desktop b/components/accounts/metadata.desktop new file mode 100644 index 00000000..d93813d0 --- /dev/null +++ b/components/accounts/metadata.desktop | |||
@@ -0,0 +1,8 @@ | |||
1 | [Desktop Entry] | ||
2 | Name=Kube Accounts | ||
3 | X-KDE-PluginInfo-Name=org.kube.components.accounts | ||
4 | Exec=kpackagelauncherqml -a org.kube.components.accounts | ||
5 | X-Plasma-MainScript=ui/main.qml | ||
6 | X-KDE-ServiceTypes=KPackage/GenericQML | ||
7 | Icon=kmail2 | ||
8 | Type=Service | ||
diff --git a/components/accounts/qmldir b/components/accounts/qmldir index e563fec3..24759d6a 100644 --- a/components/accounts/qmldir +++ b/components/accounts/qmldir | |||
@@ -1,4 +1,4 @@ | |||
1 | module org.kube.accounts | 1 | module org.kube.components.accounts |
2 | 2 | ||
3 | Accounts 1.0 Accounts.qml | ||
3 | AccountWizard 1.0 AccountWizard.qml | 4 | AccountWizard 1.0 AccountWizard.qml |
4 | |||
diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml new file mode 100644 index 00000000..d8f6e787 --- /dev/null +++ b/components/mail/contents/ui/Mail.qml | |||
@@ -0,0 +1,343 @@ | |||
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 | |||
20 | import QtQuick 2.7 | ||
21 | import QtQuick.Controls 1.3 | ||
22 | import QtQuick.Layouts 1.1 | ||
23 | |||
24 | import QtQuick.Controls 2.0 as Controls2 | ||
25 | import org.kde.kirigami 1.0 as Kirigami | ||
26 | |||
27 | import org.kube.framework.actions 1.0 as KubeAction | ||
28 | import org.kube.framework.settings 1.0 as KubeSettings | ||
29 | import org.kube.framework.domain 1.0 as KubeFramework | ||
30 | import org.kube.components 1.0 as KubeComponents | ||
31 | import org.kube.components.accounts 1.0 as KubeAccounts | ||
32 | |||
33 | Controls2.ApplicationWindow { | ||
34 | id: app | ||
35 | |||
36 | //FIXME remove fixed pixel hight | ||
37 | //for now just convinience during testing | ||
38 | height: 1080 * 0.8 | ||
39 | width: 1920 * 0.8 | ||
40 | |||
41 | visible: true | ||
42 | |||
43 | //BEGIN Actions | ||
44 | KubeAction.Context { | ||
45 | id: maillistcontext | ||
46 | property variant mail | ||
47 | property bool isDraft | ||
48 | mail: mailListView.currentMail | ||
49 | isDraft: mailListView.isDraft | ||
50 | } | ||
51 | |||
52 | KubeAction.Action { | ||
53 | id: replyAction | ||
54 | actionId: "org.kde.kube.actions.reply" | ||
55 | context: maillistcontext | ||
56 | } | ||
57 | //END Actions | ||
58 | |||
59 | //BEGIN ActionHandler | ||
60 | KubeAction.ActionHandler { | ||
61 | actionId: "org.kde.kube.actions.reply" | ||
62 | function isReady(context) { | ||
63 | return context.mail ? true : false; | ||
64 | } | ||
65 | |||
66 | function handler(context) { | ||
67 | composer.loadMessage(context.mail, false) | ||
68 | composer.open() | ||
69 | } | ||
70 | } | ||
71 | |||
72 | KubeAction.ActionHandler { | ||
73 | actionId: "org.kde.kube.actions.edit" | ||
74 | function isReady(context) { | ||
75 | return context.mail && context.isDraft; | ||
76 | } | ||
77 | function handler(context) { | ||
78 | composer.loadMessage(context.mail, true) | ||
79 | composer.open() | ||
80 | } | ||
81 | } | ||
82 | //END ActionHandler | ||
83 | |||
84 | //Controller | ||
85 | KubeFramework.MailController { | ||
86 | id: mailController | ||
87 | threadLeader: mailListView.currentMail | ||
88 | } | ||
89 | |||
90 | KubeFramework.FolderController { | ||
91 | id: folderController | ||
92 | folder: folderListView.currentFolder | ||
93 | } | ||
94 | |||
95 | //BEGIN Shortcuts | ||
96 | Shortcut { | ||
97 | sequence: StandardKey.Refresh | ||
98 | onActivated: folderController.synchronizeAction.execute() | ||
99 | enabled: folderController.synchronizeAction.enabled | ||
100 | } | ||
101 | Shortcut { | ||
102 | sequence: StandardKey.Delete | ||
103 | onActivated: mailController.moveToTrashAction.execute() | ||
104 | enabled: mailController.moveToTrashAction.enabled | ||
105 | } | ||
106 | Shortcut { | ||
107 | sequence: StandardKey.MoveToNextLine | ||
108 | onActivated: mailListView.currentIndex++ | ||
109 | } | ||
110 | Shortcut { | ||
111 | sequence: StandardKey.MoveToPreviousLine | ||
112 | onActivated: mailListView.currentIndex-- | ||
113 | } | ||
114 | //END Shortcuts | ||
115 | |||
116 | //BEGIN background | ||
117 | Rectangle { | ||
118 | anchors.fill: parent | ||
119 | |||
120 | color: Kirigami.Theme.backgroundColor | ||
121 | } | ||
122 | //END background | ||
123 | |||
124 | //BEGIN Main content | ||
125 | SplitView { | ||
126 | anchors { | ||
127 | top: app.top | ||
128 | left: app.left | ||
129 | } | ||
130 | |||
131 | height: app.height | ||
132 | width: app.width | ||
133 | |||
134 | Rectangle { | ||
135 | width: Kirigami.Units.gridUnit * 10 | ||
136 | Layout.maximumWidth: app.width * 0.25 | ||
137 | Layout.minimumWidth: Kirigami.Units.gridUnit * 5 | ||
138 | |||
139 | color: Kirigami.Theme.textColor | ||
140 | |||
141 | Controls2.ToolBar { | ||
142 | id: toolBar | ||
143 | |||
144 | anchors { | ||
145 | top: parent.top | ||
146 | left: parent.left | ||
147 | right: parent.right | ||
148 | } | ||
149 | |||
150 | RowLayout { | ||
151 | anchors.centerIn: parent | ||
152 | |||
153 | spacing: Kirigami.Units.largeSpacing | ||
154 | |||
155 | KubeComponents.AccountSwitcher { | ||
156 | id: accountSwitcher | ||
157 | |||
158 | iconName: "kdenlive-menu" | ||
159 | height: Kirigami.Units.gridUnit * 1.5 | ||
160 | width: height | ||
161 | } | ||
162 | |||
163 | ToolButton { | ||
164 | iconName: "user" | ||
165 | height: Kirigami.Units.gridUnit * 1.5 | ||
166 | width: height | ||
167 | |||
168 | onClicked: { | ||
169 | people.open() | ||
170 | } | ||
171 | } | ||
172 | |||
173 | ToolButton { | ||
174 | iconName: "search" | ||
175 | height: Kirigami.Units.gridUnit * 1.5 | ||
176 | width: height | ||
177 | |||
178 | onClicked: { | ||
179 | search.open() | ||
180 | } | ||
181 | } | ||
182 | } | ||
183 | } | ||
184 | |||
185 | Rectangle { | ||
186 | id: newMailButton | ||
187 | |||
188 | anchors { | ||
189 | top: toolBar.bottom | ||
190 | left: parent.left | ||
191 | right: parent.right | ||
192 | margins: Kirigami.Units.largeSpacing | ||
193 | } | ||
194 | |||
195 | color: "#27ae60" | ||
196 | clip: true | ||
197 | |||
198 | height: Kirigami.Units.gridUnit * 1.5 | ||
199 | |||
200 | Text { | ||
201 | anchors.centerIn: parent | ||
202 | |||
203 | text: qsTr("New Email") | ||
204 | color: "white" | ||
205 | } | ||
206 | //iconName: "mail-message-new" | ||
207 | //Controls2.Tooltip.text: "compose new email" | ||
208 | |||
209 | MouseArea { | ||
210 | anchors.fill: parent | ||
211 | onClicked: { | ||
212 | composer.open() | ||
213 | } | ||
214 | } | ||
215 | } | ||
216 | |||
217 | Item { | ||
218 | id: accountName | ||
219 | |||
220 | anchors { | ||
221 | top: newMailButton.bottom | ||
222 | topMargin: Kirigami.Units.smallSpacing | ||
223 | } | ||
224 | |||
225 | width: parent.width | ||
226 | height: Kirigami.Units.gridUnit * 2 | ||
227 | |||
228 | Text { | ||
229 | anchors { | ||
230 | bottom: parent.bottom | ||
231 | left: parent.left | ||
232 | leftMargin: Kirigami.Units.smallSpacing | ||
233 | } | ||
234 | |||
235 | text: accountSwitcher.accountName | ||
236 | font.weight: Font.DemiBold | ||
237 | color: "white" | ||
238 | } | ||
239 | } | ||
240 | |||
241 | KubeComponents.FolderListView { | ||
242 | id: folderListView | ||
243 | |||
244 | anchors { | ||
245 | top: accountName.bottom | ||
246 | topMargin: Kirigami.Units.smallSpacing | ||
247 | bottom: parent.bottom | ||
248 | left: parent.left | ||
249 | right: parent.right | ||
250 | } | ||
251 | |||
252 | focus: true | ||
253 | accountId: accountSwitcher.accountId | ||
254 | } | ||
255 | } | ||
256 | |||
257 | KubeComponents.MailListView { | ||
258 | id: mailListView | ||
259 | parentFolder: folderListView.currentFolder | ||
260 | width: Kirigami.Units.gridUnit * 20 | ||
261 | height: parent.height | ||
262 | Layout.maximumWidth: app.width * 0.4 | ||
263 | Layout.minimumWidth: Kirigami.Units.gridUnit * 10 | ||
264 | focus: true | ||
265 | } | ||
266 | |||
267 | KubeComponents.SingleMailView { | ||
268 | id: mailView | ||
269 | mail: mailListView.currentMail | ||
270 | Layout.fillWidth: true | ||
271 | } | ||
272 | } | ||
273 | //END Main content | ||
274 | |||
275 | //BEGIN Composer | ||
276 | KubeComponents.FocusComposer { | ||
277 | id: composer | ||
278 | |||
279 | height: app.height * 0.85 | ||
280 | width: app.width * 0.85 | ||
281 | |||
282 | x: app.width * 0.075 | ||
283 | y: app.height * 0.075 | ||
284 | } | ||
285 | //END Composer | ||
286 | |||
287 | //BEGIN AccountWizard | ||
288 | KubeAccounts.AccountWizard { | ||
289 | id: accountWizard | ||
290 | |||
291 | height: app.height * 0.85 | ||
292 | width: app.width * 0.85 | ||
293 | |||
294 | x: app.width * 0.075 | ||
295 | y: app.height * 0.075 | ||
296 | } | ||
297 | //END AccountWizard | ||
298 | |||
299 | //BEGIN Search | ||
300 | Controls2.Popup { | ||
301 | id: search | ||
302 | |||
303 | width: app.width * 0.6 | ||
304 | height: Kirigami.Units.gridUnit * 3 | ||
305 | |||
306 | x: app.width * 0.2 | ||
307 | y: app.height * 0.2 | ||
308 | |||
309 | modal: true | ||
310 | focus: true | ||
311 | |||
312 | RowLayout { | ||
313 | anchors.fill: parent | ||
314 | |||
315 | Controls2.TextField { | ||
316 | Layout.fillWidth: true | ||
317 | placeholderText: "Search... is not available in this beta" | ||
318 | } | ||
319 | |||
320 | Controls2.Button { | ||
321 | text: "Go" | ||
322 | |||
323 | onClicked: { | ||
324 | search.close() | ||
325 | } | ||
326 | } | ||
327 | } | ||
328 | } | ||
329 | //END Search | ||
330 | |||
331 | //BEGIN People | ||
332 | KubeComponents.People { | ||
333 | id: people | ||
334 | |||
335 | height: app.height * 0.85 | ||
336 | width: app.width * 0.85 | ||
337 | |||
338 | x: app.width * 0.075 | ||
339 | y: app.height * 0.075 | ||
340 | |||
341 | } | ||
342 | //END People | ||
343 | } | ||
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index eed80f55..0a1e1d75 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml | |||
@@ -16,328 +16,9 @@ | |||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | |||
20 | import QtQuick 2.7 | 19 | import QtQuick 2.7 |
21 | import QtQuick.Controls 1.3 | 20 | import org.kube.components.Mail 1.0 as MailComponent |
22 | import QtQuick.Layouts 1.1 | ||
23 | |||
24 | import QtQuick.Controls 2.0 as Controls2 | ||
25 | import org.kde.kirigami 1.0 as Kirigami | ||
26 | |||
27 | import org.kube.framework.actions 1.0 as KubeAction | ||
28 | import org.kube.framework.settings 1.0 as KubeSettings | ||
29 | import org.kube.framework.domain 1.0 as KubeFramework | ||
30 | import org.kube.components 1.0 as KubeComponents | ||
31 | import org.kube.accounts 1.0 as KubeAccounts | ||
32 | |||
33 | Controls2.ApplicationWindow { | ||
34 | id: app | ||
35 | |||
36 | //FIXME remove fixed pixel hight | ||
37 | //for now just convinience during testing | ||
38 | height: 1080 * 0.8 | ||
39 | width: 1920 * 0.8 | ||
40 | |||
41 | visible: true | ||
42 | |||
43 | //BEGIN Actions | ||
44 | KubeAction.Context { | ||
45 | id: maillistcontext | ||
46 | property variant mail | ||
47 | property bool isDraft | ||
48 | mail: mailListView.currentMail | ||
49 | isDraft: mailListView.isDraft | ||
50 | } | ||
51 | |||
52 | KubeAction.Action { | ||
53 | id: replyAction | ||
54 | actionId: "org.kde.kube.actions.reply" | ||
55 | context: maillistcontext | ||
56 | } | ||
57 | //END Actions | ||
58 | |||
59 | //BEGIN ActionHandler | ||
60 | KubeAction.ActionHandler { | ||
61 | actionId: "org.kde.kube.actions.reply" | ||
62 | function isReady(context) { | ||
63 | return context.mail ? true : false; | ||
64 | } | ||
65 | |||
66 | function handler(context) { | ||
67 | composer.loadMessage(context.mail, false) | ||
68 | composer.open() | ||
69 | } | ||
70 | } | ||
71 | |||
72 | KubeAction.ActionHandler { | ||
73 | actionId: "org.kde.kube.actions.edit" | ||
74 | function isReady(context) { | ||
75 | return context.mail && context.isDraft; | ||
76 | } | ||
77 | function handler(context) { | ||
78 | composer.loadMessage(context.mail, true) | ||
79 | composer.open() | ||
80 | } | ||
81 | } | ||
82 | //END ActionHandler | ||
83 | |||
84 | //Controller | ||
85 | KubeFramework.MailController { | ||
86 | id: mailController | ||
87 | threadLeader: mailListView.currentMail | ||
88 | } | ||
89 | |||
90 | KubeFramework.FolderController { | ||
91 | id: folderController | ||
92 | folder: folderListView.currentFolder | ||
93 | } | ||
94 | |||
95 | //BEGIN Shortcuts | ||
96 | Shortcut { | ||
97 | sequence: StandardKey.Refresh | ||
98 | onActivated: folderController.synchronizeAction.execute() | ||
99 | enabled: folderController.synchronizeAction.enabled | ||
100 | } | ||
101 | Shortcut { | ||
102 | sequence: StandardKey.Delete | ||
103 | onActivated: mailController.moveToTrashAction.execute() | ||
104 | enabled: mailController.moveToTrashAction.enabled | ||
105 | } | ||
106 | Shortcut { | ||
107 | sequence: StandardKey.MoveToNextLine | ||
108 | onActivated: mailListView.currentIndex++ | ||
109 | } | ||
110 | Shortcut { | ||
111 | sequence: StandardKey.MoveToPreviousLine | ||
112 | onActivated: mailListView.currentIndex-- | ||
113 | } | ||
114 | //END Shortcuts | ||
115 | |||
116 | //BEGIN background | ||
117 | Rectangle { | ||
118 | anchors.fill: parent | ||
119 | |||
120 | color: Kirigami.Theme.backgroundColor | ||
121 | } | ||
122 | //END background | ||
123 | |||
124 | //BEGIN Main content | ||
125 | SplitView { | ||
126 | anchors { | ||
127 | top: app.top | ||
128 | left: app.left | ||
129 | } | ||
130 | |||
131 | height: app.height | ||
132 | width: app.width | ||
133 | |||
134 | Rectangle { | ||
135 | width: Kirigami.Units.gridUnit * 10 | ||
136 | Layout.maximumWidth: app.width * 0.25 | ||
137 | Layout.minimumWidth: Kirigami.Units.gridUnit * 5 | ||
138 | |||
139 | color: Kirigami.Theme.textColor | ||
140 | |||
141 | Controls2.ToolBar { | ||
142 | id: toolBar | ||
143 | |||
144 | anchors { | ||
145 | top: parent.top | ||
146 | left: parent.left | ||
147 | right: parent.right | ||
148 | } | ||
149 | |||
150 | RowLayout { | ||
151 | anchors.centerIn: parent | ||
152 | |||
153 | spacing: Kirigami.Units.largeSpacing | ||
154 | |||
155 | KubeComponents.AccountSwitcher { | ||
156 | id: accountSwitcher | ||
157 | |||
158 | iconName: "kdenlive-menu" | ||
159 | height: Kirigami.Units.gridUnit * 1.5 | ||
160 | width: height | ||
161 | } | ||
162 | |||
163 | ToolButton { | ||
164 | iconName: "user" | ||
165 | height: Kirigami.Units.gridUnit * 1.5 | ||
166 | width: height | ||
167 | |||
168 | onClicked: { | ||
169 | people.open() | ||
170 | } | ||
171 | } | ||
172 | |||
173 | ToolButton { | ||
174 | iconName: "search" | ||
175 | height: Kirigami.Units.gridUnit * 1.5 | ||
176 | width: height | ||
177 | |||
178 | onClicked: { | ||
179 | search.open() | ||
180 | } | ||
181 | } | ||
182 | } | ||
183 | } | ||
184 | |||
185 | Rectangle { | ||
186 | id: newMailButton | ||
187 | |||
188 | anchors { | ||
189 | top: toolBar.bottom | ||
190 | left: parent.left | ||
191 | right: parent.right | ||
192 | margins: Kirigami.Units.largeSpacing | ||
193 | } | ||
194 | |||
195 | color: "#27ae60" | ||
196 | clip: true | ||
197 | |||
198 | height: Kirigami.Units.gridUnit * 1.5 | ||
199 | |||
200 | Text { | ||
201 | anchors.centerIn: parent | ||
202 | |||
203 | text: qsTr("New Email") | ||
204 | color: "white" | ||
205 | } | ||
206 | //iconName: "mail-message-new" | ||
207 | //Controls2.Tooltip.text: "compose new email" | ||
208 | |||
209 | MouseArea { | ||
210 | anchors.fill: parent | ||
211 | onClicked: { | ||
212 | composer.open() | ||
213 | } | ||
214 | } | ||
215 | } | ||
216 | |||
217 | Item { | ||
218 | id: accountName | ||
219 | |||
220 | anchors { | ||
221 | top: newMailButton.bottom | ||
222 | topMargin: Kirigami.Units.smallSpacing | ||
223 | } | ||
224 | |||
225 | width: parent.width | ||
226 | height: Kirigami.Units.gridUnit * 2 | ||
227 | |||
228 | Text { | ||
229 | anchors { | ||
230 | bottom: parent.bottom | ||
231 | left: parent.left | ||
232 | leftMargin: Kirigami.Units.smallSpacing | ||
233 | } | ||
234 | |||
235 | text: accountSwitcher.accountName | ||
236 | font.weight: Font.DemiBold | ||
237 | color: "white" | ||
238 | } | ||
239 | } | ||
240 | |||
241 | KubeComponents.FolderListView { | ||
242 | id: folderListView | ||
243 | |||
244 | anchors { | ||
245 | top: accountName.bottom | ||
246 | topMargin: Kirigami.Units.smallSpacing | ||
247 | bottom: parent.bottom | ||
248 | left: parent.left | ||
249 | right: parent.right | ||
250 | } | ||
251 | |||
252 | focus: true | ||
253 | accountId: accountSwitcher.accountId | ||
254 | } | ||
255 | } | ||
256 | |||
257 | KubeComponents.MailListView { | ||
258 | id: mailListView | ||
259 | parentFolder: folderListView.currentFolder | ||
260 | width: Kirigami.Units.gridUnit * 20 | ||
261 | height: parent.height | ||
262 | Layout.maximumWidth: app.width * 0.4 | ||
263 | Layout.minimumWidth: Kirigami.Units.gridUnit * 10 | ||
264 | focus: true | ||
265 | } | ||
266 | |||
267 | KubeComponents.SingleMailView { | ||
268 | id: mailView | ||
269 | mail: mailListView.currentMail | ||
270 | Layout.fillWidth: true | ||
271 | } | ||
272 | } | ||
273 | //END Main content | ||
274 | |||
275 | //BEGIN Composer | ||
276 | KubeComponents.FocusComposer { | ||
277 | id: composer | ||
278 | |||
279 | height: app.height * 0.85 | ||
280 | width: app.width * 0.85 | ||
281 | |||
282 | x: app.width * 0.075 | ||
283 | y: app.height * 0.075 | ||
284 | } | ||
285 | //END Composer | ||
286 | |||
287 | //BEGIN AccountWizard | ||
288 | KubeAccounts.AccountWizard { | ||
289 | id: accountWizard | ||
290 | |||
291 | height: app.height * 0.85 | ||
292 | width: app.width * 0.85 | ||
293 | |||
294 | x: app.width * 0.075 | ||
295 | y: app.height * 0.075 | ||
296 | } | ||
297 | //END AccountWizard | ||
298 | |||
299 | //BEGIN Search | ||
300 | Controls2.Popup { | ||
301 | id: search | ||
302 | |||
303 | width: app.width * 0.6 | ||
304 | height: Kirigami.Units.gridUnit * 3 | ||
305 | |||
306 | x: app.width * 0.2 | ||
307 | y: app.height * 0.2 | ||
308 | |||
309 | modal: true | ||
310 | focus: true | ||
311 | |||
312 | RowLayout { | ||
313 | anchors.fill: parent | ||
314 | |||
315 | Controls2.TextField { | ||
316 | Layout.fillWidth: true | ||
317 | placeholderText: "Search... is not available in this beta" | ||
318 | } | ||
319 | |||
320 | Controls2.Button { | ||
321 | text: "Go" | ||
322 | |||
323 | onClicked: { | ||
324 | search.close() | ||
325 | } | ||
326 | } | ||
327 | } | ||
328 | } | ||
329 | //END Search | ||
330 | |||
331 | //BEGIN People | ||
332 | KubeComponents.People { | ||
333 | id: people | ||
334 | |||
335 | height: app.height * 0.85 | ||
336 | width: app.width * 0.85 | ||
337 | 21 | ||
338 | x: app.width * 0.075 | 22 | MailComponent.Mail { |
339 | y: app.height * 0.075 | ||
340 | 23 | ||
341 | } | ||
342 | //END People | ||
343 | } | 24 | } |
diff --git a/components/mail/qmldir b/components/mail/qmldir new file mode 100644 index 00000000..2c0088f6 --- /dev/null +++ b/components/mail/qmldir | |||
@@ -0,0 +1,3 @@ | |||
1 | module org.kube.components.mail | ||
2 | |||
3 | Mail 1.0 Mail.qml | ||
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..ac19eaaa --- /dev/null +++ b/tests/CMakeLists.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | project(tests) | ||
2 | |||
3 | cmake_minimum_required(VERSION 2.8.12) | ||
4 | cmake_policy(SET CMP0063 NEW) | ||
5 | |||
6 | include(CPack) | ||
7 | include(FeatureSummary) | ||
8 | find_package(PkgConfig) | ||
9 | |||
10 | ################# set KDE specific information ################# | ||
11 | |||
12 | find_package(ECM 0.0.8 REQUIRED NO_MODULE) | ||
13 | |||
14 | # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked | ||
15 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) | ||
16 | |||
17 | include(KDEInstallDirs) | ||
18 | include(KDECMakeSettings) | ||
19 | include(KDECompilerSettings) | ||
20 | |||
21 | find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Widgets WebEngine QuickTest) | ||
22 | |||
23 | set (QT_MIN_VERSION "5.6.0") | ||
24 | |||
25 | # build testrunner | ||
26 | add_executable(kubetestrunner kubetestrunner.cpp) | ||
27 | qt5_use_modules(kubetestrunner Gui Quick Widgets WebEngine QuickTest) | ||
28 | |||
29 | # tests | ||
30 | add_test(NAME qmltests COMMAND kubetestrunner WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
31 | |||
diff --git a/tests/kubetestrunner.cpp b/tests/kubetestrunner.cpp new file mode 100644 index 00000000..c0bee01a --- /dev/null +++ b/tests/kubetestrunner.cpp | |||
@@ -0,0 +1,6 @@ | |||
1 | #include <QtQuickTest/quicktest.h> | ||
2 | |||
3 | int main(int argc, char **argv) | ||
4 | { | ||
5 | return quick_test_main(argc, argv, "example", 0); | ||
6 | } | ||
diff --git a/tests/tst_applicationstart.qml b/tests/tst_applicationstart.qml new file mode 100644 index 00000000..15809395 --- /dev/null +++ b/tests/tst_applicationstart.qml | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright 2017 Christian Mollekopf <mollekopf@kolabsys.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU Library General Public License as | ||
6 | * published by the Free Software Foundation; either version 2, 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 Library General Public License for more details | ||
13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | import QtQuick 2.7 | ||
21 | import QtQuick.Controls 2.0 | ||
22 | import QtQuick.Window 2.1 | ||
23 | import QtTest 1.0 | ||
24 | import org.kube.components.mail 1.0 as KubeMail | ||
25 | |||
26 | |||
27 | TestCase { | ||
28 | id: testCase | ||
29 | width: 400 | ||
30 | height: 400 | ||
31 | name: "ApplicationStart" | ||
32 | |||
33 | KubeMail.Mail { | ||
34 | } | ||
35 | |||
36 | function test_stuff() { | ||
37 | } | ||
38 | } | ||