diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/qml/Icons.qml | 2 | ||||
-rw-r--r-- | framework/qml/Messages.qml | 2 | ||||
-rw-r--r-- | framework/qml/View.qml | 83 | ||||
-rw-r--r-- | framework/qmldir | 2 | ||||
-rw-r--r-- | framework/src/domain/maillistmodel.cpp | 32 | ||||
-rw-r--r-- | framework/src/domain/maillistmodel.h | 4 |
6 files changed, 125 insertions, 0 deletions
diff --git a/framework/qml/Icons.qml b/framework/qml/Icons.qml index add51534..05cde6c9 100644 --- a/framework/qml/Icons.qml +++ b/framework/qml/Icons.qml | |||
@@ -38,6 +38,7 @@ Item { | |||
38 | property string undo: "edit-undo-inverted" | 38 | property string undo: "edit-undo-inverted" |
39 | property string moveToTrash: "kubetrash" | 39 | property string moveToTrash: "kubetrash" |
40 | property string edit: "document-edit" | 40 | property string edit: "document-edit" |
41 | property string edit_inverted: "document-edit-inverted" | ||
41 | property string replyToSender: "mail-reply-sender" | 42 | property string replyToSender: "mail-reply-sender" |
42 | property string outbox: "mail-folder-outbox" | 43 | property string outbox: "mail-folder-outbox" |
43 | property string outbox_inverted: "mail-folder-outbox-inverted" | 44 | property string outbox_inverted: "mail-folder-outbox-inverted" |
@@ -47,6 +48,7 @@ Item { | |||
47 | property string search_inverted: "edit-find-inverted" | 48 | property string search_inverted: "edit-find-inverted" |
48 | property string mail_inverted: "mail-message-inverted" | 49 | property string mail_inverted: "mail-message-inverted" |
49 | property string goBack: "go-previous" | 50 | property string goBack: "go-previous" |
51 | property string goBack_inverted: "go-previous-inverted" | ||
50 | property string goDown: "go-down" | 52 | property string goDown: "go-down" |
51 | property string goUp: "go-down" | 53 | property string goUp: "go-down" |
52 | 54 | ||
diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml index 19d0c402..aa43de76 100644 --- a/framework/qml/Messages.qml +++ b/framework/qml/Messages.qml | |||
@@ -41,5 +41,7 @@ Item { | |||
41 | property string reply: "reply" | 41 | property string reply: "reply" |
42 | property string edit: "edit" | 42 | property string edit: "edit" |
43 | property string compose: "compose" | 43 | property string compose: "compose" |
44 | |||
45 | property string componentDone: "done" | ||
44 | } | 46 | } |
45 | 47 | ||
diff --git a/framework/qml/View.qml b/framework/qml/View.qml new file mode 100644 index 00000000..6a0b51b4 --- /dev/null +++ b/framework/qml/View.qml | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Michael Bohlender, <michael.bohlender@kdemail.net> | ||
3 | * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | |||
21 | import QtQuick 2.7 | ||
22 | import QtQuick.Controls 1.3 | ||
23 | import QtQuick.Controls 2.0 as Controls2 | ||
24 | import QtQuick.Layouts 1.1 | ||
25 | import org.kube.framework 1.0 as Kube | ||
26 | |||
27 | Item { | ||
28 | id: container | ||
29 | |||
30 | property int visibleViews: 2 | ||
31 | property int currentIndex: 0 | ||
32 | property int count: contentItems.length | ||
33 | default property alias contentItems: content.data | ||
34 | |||
35 | onCurrentIndexChanged: showRelevantSplits() | ||
36 | Component.onCompleted: showRelevantSplits() | ||
37 | |||
38 | function incrementCurrentIndex() { | ||
39 | if (currentIndex < count) { | ||
40 | currentIndex = currentIndex + 1 | ||
41 | } | ||
42 | } | ||
43 | |||
44 | function decrementCurrentIndex() { | ||
45 | if (currentIndex > 0) { | ||
46 | currentIndex = currentIndex - 1 | ||
47 | } | ||
48 | } | ||
49 | |||
50 | function showRelevantSplits() { | ||
51 | var i; | ||
52 | for (i = 0; i < count; i++) { | ||
53 | if (i < currentIndex) { | ||
54 | contentItems[i].visible = false; | ||
55 | } else if (i > (currentIndex + visibleViews - 1)) { | ||
56 | contentItems[i].visible = false; | ||
57 | } else { | ||
58 | contentItems[i].visible = true; | ||
59 | } | ||
60 | } | ||
61 | |||
62 | } | ||
63 | |||
64 | Kube.IconButton { | ||
65 | anchors { | ||
66 | top: container.top | ||
67 | left: container.left | ||
68 | } | ||
69 | z: 1 | ||
70 | background: Rectangle { | ||
71 | anchors.fill: parent | ||
72 | color: Kube.Colors.textColor | ||
73 | } | ||
74 | iconName: Kube.Icons.goBack_inverted | ||
75 | visible: currentIndex > 0 | ||
76 | onClicked: decrementCurrentIndex() | ||
77 | } | ||
78 | |||
79 | RowLayout { | ||
80 | id: content | ||
81 | anchors.fill: parent | ||
82 | } | ||
83 | } | ||
diff --git a/framework/qmldir b/framework/qmldir index 8b0c52ac..2060a920 100644 --- a/framework/qmldir +++ b/framework/qmldir | |||
@@ -22,6 +22,8 @@ ComboBox 1.0 ComboBox.qml | |||
22 | PositiveButton 1.0 PositiveButton.qml | 22 | PositiveButton 1.0 PositiveButton.qml |
23 | TextField 1.0 TextField.qml | 23 | TextField 1.0 TextField.qml |
24 | Label 1.0 Label.qml | 24 | Label 1.0 Label.qml |
25 | View 1.0 View.qml | ||
26 | AutocompleteLineEdit 1.0 AutocompleteLineEdit.qml | ||
25 | singleton Messages 1.0 Messages.qml | 27 | singleton Messages 1.0 Messages.qml |
26 | singleton Colors 1.0 Colors.qml | 28 | singleton Colors 1.0 Colors.qml |
27 | singleton Icons 1.0 Icons.qml | 29 | singleton Icons 1.0 Icons.qml |
diff --git a/framework/src/domain/maillistmodel.cpp b/framework/src/domain/maillistmodel.cpp index 0f477624..73d686eb 100644 --- a/framework/src/domain/maillistmodel.cpp +++ b/framework/src/domain/maillistmodel.cpp | |||
@@ -302,3 +302,35 @@ QVariant MailListModel::mail() const | |||
302 | } | 302 | } |
303 | 303 | ||
304 | 304 | ||
305 | void MailListModel::setShowDrafts(bool) | ||
306 | { | ||
307 | using namespace Sink::ApplicationDomain; | ||
308 | Sink::Query query; | ||
309 | // query.setFlags(Sink::Query::LiveQuery | Sink::Query::UpdateStatus); | ||
310 | query.filter<Mail::Draft>(true); | ||
311 | query.request<Mail::Subject>(); | ||
312 | query.request<Mail::Sender>(); | ||
313 | query.request<Mail::To>(); | ||
314 | query.request<Mail::Cc>(); | ||
315 | query.request<Mail::Bcc>(); | ||
316 | query.request<Mail::Date>(); | ||
317 | query.request<Mail::Unread>(); | ||
318 | query.request<Mail::Important>(); | ||
319 | query.request<Mail::Draft>(); | ||
320 | query.request<Mail::Folder>(); | ||
321 | query.request<Mail::Sent>(); | ||
322 | query.request<Mail::Trash>(); | ||
323 | query.request<Mail::MimeMessage>(); | ||
324 | query.request<Mail::FullPayloadAvailable>(); | ||
325 | mFetchMails = true; | ||
326 | mFetchedMails.clear(); | ||
327 | qDebug() << "Running mail query for drafts: "; | ||
328 | //Latest mail at the top | ||
329 | sort(0, Qt::AscendingOrder); | ||
330 | runQuery(query); | ||
331 | } | ||
332 | |||
333 | bool MailListModel::showDrafts() const | ||
334 | { | ||
335 | return false; | ||
336 | } | ||
diff --git a/framework/src/domain/maillistmodel.h b/framework/src/domain/maillistmodel.h index 5ed081f4..5f593700 100644 --- a/framework/src/domain/maillistmodel.h +++ b/framework/src/domain/maillistmodel.h | |||
@@ -31,6 +31,7 @@ class MailListModel : public QSortFilterProxyModel | |||
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | Q_PROPERTY (QVariant parentFolder READ parentFolder WRITE setParentFolder) | 32 | Q_PROPERTY (QVariant parentFolder READ parentFolder WRITE setParentFolder) |
33 | Q_PROPERTY (QVariant mail READ mail WRITE setMail) | 33 | Q_PROPERTY (QVariant mail READ mail WRITE setMail) |
34 | Q_PROPERTY (bool showDrafts READ showDrafts WRITE setShowDrafts) | ||
34 | Q_PROPERTY (QString filter READ filter WRITE setFilter) | 35 | Q_PROPERTY (QString filter READ filter WRITE setFilter) |
35 | Q_PROPERTY (bool isThreaded READ isThreaded NOTIFY isThreadedChanged) | 36 | Q_PROPERTY (bool isThreaded READ isThreaded NOTIFY isThreadedChanged) |
36 | 37 | ||
@@ -87,6 +88,9 @@ public: | |||
87 | void setFilter(const QString &mail); | 88 | void setFilter(const QString &mail); |
88 | QString filter() const; | 89 | QString filter() const; |
89 | 90 | ||
91 | void setShowDrafts(bool); | ||
92 | bool showDrafts() const; | ||
93 | |||
90 | signals: | 94 | signals: |
91 | void isThreadedChanged(); | 95 | void isThreadedChanged(); |
92 | 96 | ||