From 7b89fa842e450c3219d6ae9dee983d80babc5b19 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 21 Aug 2018 10:38:12 +0200 Subject: A refresh signal that can be used to fetch data. This will be automatically triggered when the user selects a view, and whenever f5 is pressed. --- components/kube/qml/Kube.qml | 3 +++ framework/qml/View.qml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/components/kube/qml/Kube.qml b/components/kube/qml/Kube.qml index afc7c83f..17e77ebe 100644 --- a/components/kube/qml/Kube.qml +++ b/components/kube/qml/Kube.qml @@ -104,6 +104,9 @@ Controls2.ApplicationWindow { id: syncShortcut sequence: StandardKey.Refresh onActivated: { + 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"}) diff --git a/framework/qml/View.qml b/framework/qml/View.qml index 64524999..5df76cb6 100644 --- a/framework/qml/View.qml +++ b/framework/qml/View.qml @@ -64,10 +64,14 @@ FocusScope { property bool __aborted: false + //This signal will be emitted to refresh the views contents. Fetch data in here. + signal refresh() + //This signal will be emitted once all initial properties have been set and the view is ready to load signal setup() StackView.onActivated: { root.setup() + root.refresh() } StackView.onDeactivated: { -- cgit v1.2.3