diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/kube/contents/ui/Kube.qml | 65 |
1 files changed, 40 insertions, 25 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index e8b8a0c8..224b317e 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml | |||
@@ -34,6 +34,46 @@ Controls2.ApplicationWindow { | |||
34 | //Application default font | 34 | //Application default font |
35 | font.family: Kube.Font.fontFamily | 35 | font.family: Kube.Font.fontFamily |
36 | 36 | ||
37 | //Application context | ||
38 | property variant currentFolder | ||
39 | onCurrentFolderChanged: { | ||
40 | if (!!currentFolder) { | ||
41 | Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": currentFolder}) | ||
42 | } | ||
43 | } | ||
44 | property variant currentAccount | ||
45 | onCurrentAccountChanged: { | ||
46 | if (!!currentAccount) { | ||
47 | console.warn("Synching account", currentAccount) | ||
48 | Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": currentAccount}); | ||
49 | } | ||
50 | } | ||
51 | |||
52 | //Interval sync | ||
53 | Timer { | ||
54 | id: intervalSync | ||
55 | //5min | ||
56 | interval: 300000 | ||
57 | running: !!app.currentFolder | ||
58 | repeat: true | ||
59 | onTriggered: Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": app.currentFolder}) | ||
60 | } | ||
61 | |||
62 | Kube.StartupCheck { | ||
63 | onNoAccount: kubeViews.setAccountsView() | ||
64 | } | ||
65 | |||
66 | //Listener | ||
67 | Kube.Listener { | ||
68 | filter: Kube.Messages.accountSelection | ||
69 | onMessageReceived: app.currentAccount = message.account | ||
70 | } | ||
71 | |||
72 | Kube.Listener { | ||
73 | filter: Kube.Messages.folderSelection | ||
74 | onMessageReceived: app.currentFolder = message.folder | ||
75 | } | ||
76 | |||
37 | Kube.Listener { | 77 | Kube.Listener { |
38 | filter: Kube.Messages.notification | 78 | filter: Kube.Messages.notification |
39 | onMessageReceived: { | 79 | onMessageReceived: { |
@@ -79,31 +119,6 @@ Controls2.ApplicationWindow { | |||
79 | } | 119 | } |
80 | //END Shortcuts | 120 | //END Shortcuts |
81 | 121 | ||
82 | //Interval sync | ||
83 | Timer { | ||
84 | id: intervalSync | ||
85 | property variant folder: null | ||
86 | //5min | ||
87 | interval: 300000 | ||
88 | running: !!folder | ||
89 | repeat: true | ||
90 | onTriggered: Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": folder}) | ||
91 | } | ||
92 | |||
93 | Kube.Listener { | ||
94 | filter: Kube.Messages.folderSelection | ||
95 | onMessageReceived: { | ||
96 | syncShortcut.folder = message.folder | ||
97 | intervalSync.folder = message.folder | ||
98 | } | ||
99 | } | ||
100 | |||
101 | Kube.StartupCheck { | ||
102 | onNoAccount: { | ||
103 | kubeViews.setAccountsView() | ||
104 | } | ||
105 | } | ||
106 | |||
107 | //BEGIN background | 122 | //BEGIN background |
108 | Rectangle { | 123 | Rectangle { |
109 | anchors.fill: parent | 124 | anchors.fill: parent |