diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/CMakeLists.txt | 1 | ||||
-rw-r--r-- | components/mailviewer/qml/DummyApp.qml | 55 | ||||
-rw-r--r-- | components/mailviewer/qml/HtmlPart.qml | 2 | ||||
-rw-r--r-- | components/mailviewer/qml/MailPart.qml | 36 | ||||
-rw-r--r-- | components/mailviewer/qml/TextPart.qml | 4 | ||||
-rw-r--r-- | components/mailviewer/qml/dummyapp.qml | 90 | ||||
-rw-r--r-- | components/package/contents/ui/MailViewer.qml | 31 |
7 files changed, 102 insertions, 117 deletions
diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 4fad0387..66e27822 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt | |||
@@ -24,6 +24,7 @@ find_package(KF5 REQUIRED COMPONENTS Package) | |||
24 | 24 | ||
25 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/components) | 25 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/components) |
26 | install(DIRECTORY package/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components) | 26 | install(DIRECTORY package/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components) |
27 | install(DIRECTORY mailviewer/qml/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components) | ||
27 | 28 | ||
28 | include(${CMAKE_SOURCE_DIR}/KF5KirigamiMacros.cmake) | 29 | include(${CMAKE_SOURCE_DIR}/KF5KirigamiMacros.cmake) |
29 | 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) | 30 | 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) |
diff --git a/components/mailviewer/qml/DummyApp.qml b/components/mailviewer/qml/DummyApp.qml new file mode 100644 index 00000000..acb91ac1 --- /dev/null +++ b/components/mailviewer/qml/DummyApp.qml | |||
@@ -0,0 +1,55 @@ | |||
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 | |||
21 | Item { | ||
22 | Column { | ||
23 | anchors { | ||
24 | top: parent.top | ||
25 | left: parent.left | ||
26 | right: parent.right | ||
27 | margins: 20 | ||
28 | } | ||
29 | |||
30 | spacing: 10 | ||
31 | width: parent.width | ||
32 | Repeater { | ||
33 | model: messageParser.newTree | ||
34 | |||
35 | delegate: Column { | ||
36 | id: delegateRoot | ||
37 | |||
38 | width: parent.width | ||
39 | |||
40 | Loader { | ||
41 | id: loader | ||
42 | } | ||
43 | |||
44 | Component.onCompleted: { | ||
45 | switch (model.type) { | ||
46 | case "AlternativePart": | ||
47 | case "SinglePart": | ||
48 | loader.source = "MailPart.qml"; | ||
49 | break; | ||
50 | } | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | } | ||
55 | } | ||
diff --git a/components/mailviewer/qml/HtmlPart.qml b/components/mailviewer/qml/HtmlPart.qml index f1add75c..f812ecb4 100644 --- a/components/mailviewer/qml/HtmlPart.qml +++ b/components/mailviewer/qml/HtmlPart.qml | |||
@@ -24,7 +24,7 @@ import QtWebEngine 1.2 | |||
24 | 24 | ||
25 | Item { | 25 | Item { |
26 | id: root | 26 | id: root |
27 | property string content: model.htmlContent | 27 | property string content: model.content |
28 | property int contentHeight: helperView.contentHeight; | 28 | property int contentHeight: helperView.contentHeight; |
29 | //FIXME workaround until QtWebEngine 1.3 with contentsSize | 29 | //FIXME workaround until QtWebEngine 1.3 with contentsSize |
30 | 30 | ||
diff --git a/components/mailviewer/qml/MailPart.qml b/components/mailviewer/qml/MailPart.qml index 966337cd..d47b4c5f 100644 --- a/components/mailviewer/qml/MailPart.qml +++ b/components/mailviewer/qml/MailPart.qml | |||
@@ -21,24 +21,22 @@ import QtQuick 2.4 | |||
21 | Item { | 21 | Item { |
22 | id: root | 22 | id: root |
23 | 23 | ||
24 | height: partColumn.height + 40 | 24 | height: partColumn.height + 20 |
25 | width: delegateRoot.width | 25 | width: delegateRoot.width |
26 | 26 | ||
27 | Column { | 27 | Column { |
28 | id: partColumn | 28 | id: partColumn |
29 | |||
30 | anchors { | 29 | anchors { |
31 | top: parent.top | 30 | top: parent.top |
32 | left: parent.left | 31 | left: parent.left |
33 | right: parent.right | 32 | right: parent.right |
34 | margins: 20 | 33 | margins: 10 |
35 | } | 34 | } |
36 | 35 | ||
37 | spacing: 10 | 36 | spacing: 5 |
38 | 37 | ||
39 | Repeater { | 38 | Repeater { |
40 | model: content | 39 | model: contents |
41 | |||
42 | delegate: Column { | 40 | delegate: Column { |
43 | id: delegateRoot | 41 | id: delegateRoot |
44 | 42 | ||
@@ -49,23 +47,29 @@ Item { | |||
49 | } | 47 | } |
50 | 48 | ||
51 | Component.onCompleted: { | 49 | Component.onCompleted: { |
52 | |||
53 | switch (model.type) { | 50 | switch (model.type) { |
51 | case "AlternativePart": | ||
52 | case "SinglePart": | ||
53 | loader.source = "MailPart.qml"; | ||
54 | break; | ||
55 | |||
56 | case "PlainTextContent": | ||
57 | case "Content": | ||
58 | loader.source = "TextPart.qml"; | ||
59 | break; | ||
60 | case "HtmlContent": | ||
61 | loader.source = "HtmlPart.qml"; | ||
62 | break; | ||
63 | |||
64 | case "alternativeframe": | ||
65 | loader.source = "Frame.qml" | ||
66 | break; | ||
54 | case "encrypted": | 67 | case "encrypted": |
55 | loader.source = "EncryptedPart.qml"; | 68 | loader.source = "EncryptedPart.qml"; |
56 | break; | 69 | break; |
57 | case "embeded": | 70 | case "embeded": |
58 | loader.source = "EmbededPart.qml"; | 71 | loader.source = "EmbededPart.qml"; |
59 | break; | 72 | break; |
60 | case "frame": | ||
61 | loader.source = "Frame.qml" | ||
62 | break; | ||
63 | case "plaintext": | ||
64 | loader.source = "TextPart.qml"; | ||
65 | break; | ||
66 | case "html": | ||
67 | loader.source = "HtmlPart.qml"; | ||
68 | break; | ||
69 | } | 73 | } |
70 | } | 74 | } |
71 | } | 75 | } |
diff --git a/components/mailviewer/qml/TextPart.qml b/components/mailviewer/qml/TextPart.qml index 5f183852..0267682f 100644 --- a/components/mailviewer/qml/TextPart.qml +++ b/components/mailviewer/qml/TextPart.qml | |||
@@ -21,8 +21,8 @@ import QtQuick 2.4 | |||
21 | Text { | 21 | Text { |
22 | width: delegateRoot.width | 22 | width: delegateRoot.width |
23 | 23 | ||
24 | text: model.textContent | 24 | text: model.content |
25 | wrapMode: Text.WordWrap | 25 | wrapMode: Text.WordWrap |
26 | 26 | ||
27 | color: embeded ? "grey" : "black" | 27 | color: model.securityLevel //embeded ? "grey" : "black" |
28 | } | 28 | } |
diff --git a/components/mailviewer/qml/dummyapp.qml b/components/mailviewer/qml/dummyapp.qml deleted file mode 100644 index a186f0f1..00000000 --- a/components/mailviewer/qml/dummyapp.qml +++ /dev/null | |||
@@ -1,90 +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 | |||
21 | Rectangle { | ||
22 | id: app | ||
23 | |||
24 | width: 1200 | ||
25 | height: 700 | ||
26 | |||
27 | Rectangle { | ||
28 | anchors.fill: parent | ||
29 | |||
30 | color: "black" | ||
31 | |||
32 | opacity: 0.8 | ||
33 | |||
34 | } | ||
35 | |||
36 | Rectangle { | ||
37 | |||
38 | anchors.centerIn: parent | ||
39 | |||
40 | height: mainColumn.height + 50 | ||
41 | width: parent.width * 0.9 | ||
42 | |||
43 | Column { | ||
44 | id: mainColumn | ||
45 | |||
46 | anchors.centerIn: parent | ||
47 | |||
48 | width: parent.width - 50 | ||
49 | |||
50 | spacing: 10 | ||
51 | |||
52 | Repeater { | ||
53 | model: MailModel {} | ||
54 | |||
55 | delegate: Column { | ||
56 | id: delegateRoot | ||
57 | |||
58 | width: mainColumn.width | ||
59 | |||
60 | Loader { | ||
61 | id: loader | ||
62 | } | ||
63 | |||
64 | Component.onCompleted: { | ||
65 | switch (model.type) { | ||
66 | case "red": | ||
67 | loader.source = "Rect2.qml"; | ||
68 | break; | ||
69 | case "green": | ||
70 | loader.source = "Rect1.qml"; | ||
71 | break; | ||
72 | case "encrypted": | ||
73 | loader.source = "EncryptedPart.qml"; | ||
74 | break; | ||
75 | case "frame": | ||
76 | loader.source = "Frame.qml"; | ||
77 | break; | ||
78 | case "plaintext": | ||
79 | loader.source = "TextPart.qml"; | ||
80 | break; | ||
81 | case "html": | ||
82 | loader.source = "HtmlPart.qml"; | ||
83 | break; | ||
84 | } | ||
85 | } | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | } | ||
diff --git a/components/package/contents/ui/MailViewer.qml b/components/package/contents/ui/MailViewer.qml index 5365be66..347f30de 100644 --- a/components/package/contents/ui/MailViewer.qml +++ b/components/package/contents/ui/MailViewer.qml | |||
@@ -27,8 +27,8 @@ Item { | |||
27 | id: root | 27 | id: root |
28 | property variant message; | 28 | property variant message; |
29 | property string html; | 29 | property string html; |
30 | property bool enablePartTreeView : false | 30 | property bool enablePartTreeView : true; |
31 | property int desiredHeight: enablePartTreeView ? topPartLoader.height+450 : topPartLoader.height; | 31 | property int desiredHeight: enablePartTreeView ? topPartLoader.height + dummyApp.height + mailStructure.height + 50 : topPartLoader.height + dummyApp.height + 50; |
32 | 32 | ||
33 | Rectangle { | 33 | Rectangle { |
34 | id: rootRectangle | 34 | id: rootRectangle |
@@ -41,6 +41,19 @@ Item { | |||
41 | verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff | 41 | verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff |
42 | Column { | 42 | Column { |
43 | spacing:2 | 43 | spacing:2 |
44 | Text { | ||
45 | text: "New Mailviewer:" | ||
46 | color: "blue" | ||
47 | } | ||
48 | DummyApp { | ||
49 | id: dummyApp | ||
50 | height: 800 | ||
51 | width: rootRectangle.width | ||
52 | } | ||
53 | Text { | ||
54 | text: "Old Mailviewer:" | ||
55 | color: "blue" | ||
56 | } | ||
44 | MessagePartTree { | 57 | MessagePartTree { |
45 | id: topPartLoader | 58 | id: topPartLoader |
46 | // width: rootRectangle.width | 59 | // width: rootRectangle.width |
@@ -48,6 +61,7 @@ Item { | |||
48 | width: topPartLoader.contentWidth >= rootRectangle.width ? topPartLoader.contentWidth : rootRectangle.width | 61 | width: topPartLoader.contentWidth >= rootRectangle.width ? topPartLoader.contentWidth : rootRectangle.width |
49 | } | 62 | } |
50 | TreeView { | 63 | TreeView { |
64 | id: mailStructure | ||
51 | visible: enablePartTreeView | 65 | visible: enablePartTreeView |
52 | width: rootRectangle.width | 66 | width: rootRectangle.width |
53 | height: 400 | 67 | height: 400 |
@@ -57,16 +71,17 @@ Item { | |||
57 | width: 300 | 71 | width: 300 |
58 | } | 72 | } |
59 | TableViewColumn { | 73 | TableViewColumn { |
60 | role: "isHidden" | 74 | role: "embeded" |
61 | title: "Hidden" | 75 | title: "Embeded" |
62 | width: 60 | 76 | width: 60 |
63 | } | 77 | } |
64 | TableViewColumn { | 78 | TableViewColumn { |
65 | role: "text" | 79 | role: "content" |
66 | title: "Text" | 80 | title: "Content" |
67 | width: 600 | 81 | width: 200 |
68 | } | 82 | } |
69 | model: messageParser.partTree | 83 | //model: messageParser.partTree |
84 | model: messageParser.newTree | ||
70 | } | 85 | } |
71 | } | 86 | } |
72 | } | 87 | } |