summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-04-16 22:18:02 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-04-16 22:18:02 +0200
commitec48ea0cf01d306c0a9283e485f8c37d7d4d1ebd (patch)
tree4c3a4ef28fa7aaf32968d06b4fa4244181b8f521
parentef8a9f2f1d9f91358541b83fab63603aa3001bff (diff)
downloadkube-ec48ea0cf01d306c0a9283e485f8c37d7d4d1ebd.tar.gz
kube-ec48ea0cf01d306c0a9283e485f8c37d7d4d1ebd.zip
Hide trash from non-trash conversations.
...and indicate in the conversation view if a mail has been sent or is a draft.
-rw-r--r--components/kube/contents/ui/Kube.qml2
-rw-r--r--framework/qml/ConversationView.qml18
-rw-r--r--framework/qml/FolderListView.qml2
-rw-r--r--framework/src/domain/folderlistmodel.cpp6
-rw-r--r--framework/src/domain/folderlistmodel.h3
5 files changed, 30 insertions, 1 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml
index 979f7bd5..a56838e5 100644
--- a/components/kube/contents/ui/Kube.qml
+++ b/components/kube/contents/ui/Kube.qml
@@ -349,6 +349,8 @@ Controls2.ApplicationWindow {
349 id: mailView 349 id: mailView
350 mail: mailListView.currentMail 350 mail: mailListView.currentMail
351 Layout.fillWidth: true 351 Layout.fillWidth: true
352 hideTrash: !folderListView.isTrashFolder
353 hideNonTrash: folderListView.isTrashFolder
352 } 354 }
353 } 355 }
354 //END Main content 356 //END Main content
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml
index 83771925..0d71dde9 100644
--- a/framework/qml/ConversationView.qml
+++ b/framework/qml/ConversationView.qml
@@ -34,6 +34,9 @@ Rectangle {
34 property int currentIndex: 0; 34 property int currentIndex: 0;
35 property bool scrollToEnd: true; 35 property bool scrollToEnd: true;
36 property variant currentMail: null; 36 property variant currentMail: null;
37 property bool hideTrash: true;
38 property bool hideNonTrash: false;
39
37 onCurrentIndexChanged: { 40 onCurrentIndexChanged: {
38 markAsReadTimer.restart(); 41 markAsReadTimer.restart();
39 } 42 }
@@ -186,6 +189,7 @@ Rectangle {
186 189
187 height: sheet.height + Kube.Units.gridUnit 190 height: sheet.height + Kube.Units.gridUnit
188 width: parent.width 191 width: parent.width
192 visible: !((root.hideTrash && model.trash) || (root.hideNonTrash && !model.trash))
189 193
190 MouseArea { 194 MouseArea {
191 anchors.fill: parent 195 anchors.fill: parent
@@ -321,6 +325,20 @@ Rectangle {
321 color: Kube.Colors.textColor 325 color: Kube.Colors.textColor
322 opacity: 0.75 326 opacity: 0.75
323 font.italic: true 327 font.italic: true
328 states: [
329 State {
330 name: "trash"; when: model.trash
331 PropertyChanges { target: subject; text: "Trash: " + model.subject }
332 },
333 State {
334 name: "draft"; when: model.draft
335 PropertyChanges { target: subject; text: "Draft: " + model.subject }
336 },
337 State {
338 name: "sent"; when: model.sent
339 PropertyChanges { target: subject; text: "Sent: " + model.subject }
340 }
341 ]
324 } 342 }
325 343
326 Text { 344 Text {
diff --git a/framework/qml/FolderListView.qml b/framework/qml/FolderListView.qml
index 1455be21..734e6e10 100644
--- a/framework/qml/FolderListView.qml
+++ b/framework/qml/FolderListView.qml
@@ -29,6 +29,7 @@ Rectangle {
29 29
30 property variant currentFolder: null 30 property variant currentFolder: null
31 property variant accountId 31 property variant accountId
32 property bool isTrashFolder: false
32 33
33 color: Kube.Colors.textColor 34 color: Kube.Colors.textColor
34 35
@@ -77,6 +78,7 @@ Rectangle {
77 onCurrentIndexChanged: { 78 onCurrentIndexChanged: {
78 model.fetchMore(currentIndex) 79 model.fetchMore(currentIndex)
79 root.currentFolder = model.data(currentIndex, Kube.FolderListModel.DomainObject) 80 root.currentFolder = model.data(currentIndex, Kube.FolderListModel.DomainObject)
81 root.isTrashFolder = model.data(currentIndex, Kube.FolderListModel.Trash)
80 folderController.synchronizeAction.execute() 82 folderController.synchronizeAction.execute()
81 } 83 }
82 84
diff --git a/framework/src/domain/folderlistmodel.cpp b/framework/src/domain/folderlistmodel.cpp
index 14405beb..4437e75b 100644
--- a/framework/src/domain/folderlistmodel.cpp
+++ b/framework/src/domain/folderlistmodel.cpp
@@ -53,6 +53,7 @@ QHash< int, QByteArray > FolderListModel::roleNames() const
53 roles[Id] = "id"; 53 roles[Id] = "id";
54 roles[DomainObject] = "domainObject"; 54 roles[DomainObject] = "domainObject";
55 roles[Status] = "status"; 55 roles[Status] = "status";
56 roles[Trash] = "trash";
56 57
57 return roles; 58 return roles;
58} 59}
@@ -81,6 +82,11 @@ QVariant FolderListModel::data(const QModelIndex &idx, int role) const
81 } 82 }
82 return NoStatus; 83 return NoStatus;
83 } 84 }
85 case Trash:
86 if (folder) {
87 return folder->getSpecialPurpose().contains(Sink::ApplicationDomain::SpecialPurpose::Mail::trash);
88 }
89 return false;
84 } 90 }
85 return QSortFilterProxyModel::data(idx, role); 91 return QSortFilterProxyModel::data(idx, role);
86} 92}
diff --git a/framework/src/domain/folderlistmodel.h b/framework/src/domain/folderlistmodel.h
index 17645bb5..8f157ca2 100644
--- a/framework/src/domain/folderlistmodel.h
+++ b/framework/src/domain/folderlistmodel.h
@@ -54,7 +54,8 @@ public:
54 Icon, 54 Icon,
55 Id, 55 Id,
56 DomainObject, 56 DomainObject,
57 Status 57 Status,
58 Trash
58 }; 59 };
59 Q_ENUMS(Roles) 60 Q_ENUMS(Roles)
60 61