From 3d4c249184ae3f7a2be8c0a7271482bc2aff8de8 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 21 Aug 2018 11:00:29 +0200 Subject: Use the refresh signal in the conversation view as well. --- components/kube/qml/Kube.qml | 6 ------ framework/qml/InlineAccountSwitcher.qml | 5 ++++- views/conversation/qml/View.qml | 11 +++++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/components/kube/qml/Kube.qml b/components/kube/qml/Kube.qml index 17e77ebe..f8698570 100644 --- a/components/kube/qml/Kube.qml +++ b/components/kube/qml/Kube.qml @@ -107,12 +107,6 @@ Controls2.ApplicationWindow { if (kubeViews.currentItem && kubeViews.currentItem.refresh) { kubeViews.currentItem.refresh() } - if (!!app.currentFolder) { - Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": app.currentFolder}); - Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": app.currentAccount, "type": "folder"}) - } else { - Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": app.currentAccount}) - } } } //END Shortcuts diff --git a/framework/qml/InlineAccountSwitcher.qml b/framework/qml/InlineAccountSwitcher.qml index 2af1a455..e54049be 100644 --- a/framework/qml/InlineAccountSwitcher.qml +++ b/framework/qml/InlineAccountSwitcher.qml @@ -27,6 +27,8 @@ FocusScope { Kube.Fabric.postMessage(Kube.Messages.accountSelection, {accountId: currentAccount}); } + property var currentFolder + ColumnLayout { id: layout anchors.fill: parent @@ -95,7 +97,8 @@ FocusScope { onActivated: { if (visible) { Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": model.data(index, Kube.FolderListModel.DomainObject), - "trash": model.data(index, Kube.FolderListModel.Trash)}); + "trash": model.data(index, Kube.FolderListModel.Trash)}) + root.currentFolder = model.data(index, Kube.FolderListModel.DomainObject) } } } diff --git a/views/conversation/qml/View.qml b/views/conversation/qml/View.qml index 44208fa5..81d5e9cb 100644 --- a/views/conversation/qml/View.qml +++ b/views/conversation/qml/View.qml @@ -28,14 +28,25 @@ import org.kube.framework 1.0 as Kube Kube.View { id: root property alias currentAccount: accountFolderview.currentAccount + property alias currentFolder: accountFolderview.currentFolder //We have to hardcode because all the mapToItem/mapFromItem functions are garbage searchArea: Qt.rect(ApplicationWindow.window.sidebarWidth + mailListView.parent.x, 0, (mailView.x + mailView.width) - mailListView.parent.x, (mailView.y + mailView.height) - mailListView.y) + onFilterChanged: { mailListView.filter = filter Kube.Fabric.postMessage(Kube.Messages.searchString, {"searchString": filter}) } + onRefresh: { + if (!!root.currentFolder) { + Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": root.currentFolder}); + Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": root.currentAccount, "type": "folder"}) + } else { + Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": root.currentAccount}) + } + } + Kube.Listener { filter: Kube.Messages.search onMessageReceived: root.triggerSearch() -- cgit v1.2.3