summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-21 10:38:12 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-21 10:38:12 +0200
commit7b89fa842e450c3219d6ae9dee983d80babc5b19 (patch)
tree6525caac9cc84d1523486d891d0bd3e4f02b6394
parent86f2da09bd3edd33a293cab0feb147340bff8f63 (diff)
downloadkube-7b89fa842e450c3219d6ae9dee983d80babc5b19.tar.gz
kube-7b89fa842e450c3219d6ae9dee983d80babc5b19.zip
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.
-rw-r--r--components/kube/qml/Kube.qml3
-rw-r--r--framework/qml/View.qml4
2 files changed, 7 insertions, 0 deletions
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 {
104 id: syncShortcut 104 id: syncShortcut
105 sequence: StandardKey.Refresh 105 sequence: StandardKey.Refresh
106 onActivated: { 106 onActivated: {
107 if (kubeViews.currentItem && kubeViews.currentItem.refresh) {
108 kubeViews.currentItem.refresh()
109 }
107 if (!!app.currentFolder) { 110 if (!!app.currentFolder) {
108 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": app.currentFolder}); 111 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": app.currentFolder});
109 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": app.currentAccount, "type": "folder"}) 112 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 {
64 64
65 property bool __aborted: false 65 property bool __aborted: false
66 66
67 //This signal will be emitted to refresh the views contents. Fetch data in here.
68 signal refresh()
69
67 //This signal will be emitted once all initial properties have been set and the view is ready to load 70 //This signal will be emitted once all initial properties have been set and the view is ready to load
68 signal setup() 71 signal setup()
69 StackView.onActivated: { 72 StackView.onActivated: {
70 root.setup() 73 root.setup()
74 root.refresh()
71 } 75 }
72 76
73 StackView.onDeactivated: { 77 StackView.onDeactivated: {