summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/kube/contents/ui/Kube.qml65
-rw-r--r--framework/qml/FolderListView.qml1
-rw-r--r--framework/qml/InlineAccountSwitcher.qml5
-rw-r--r--framework/qml/Messages.qml1
4 files changed, 42 insertions, 30 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
diff --git a/framework/qml/FolderListView.qml b/framework/qml/FolderListView.qml
index ece6f280..25c6cbe5 100644
--- a/framework/qml/FolderListView.qml
+++ b/framework/qml/FolderListView.qml
@@ -42,7 +42,6 @@ Kube.TreeView {
42 model.fetchMore(index); 42 model.fetchMore(index);
43 Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": model.data(index, Kube.FolderListModel.DomainObject), 43 Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": model.data(index, Kube.FolderListModel.DomainObject),
44 "trash": model.data(index, Kube.FolderListModel.Trash)}); 44 "trash": model.data(index, Kube.FolderListModel.Trash)});
45 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": model.data(index, Kube.FolderListModel.DomainObject)});
46 } 45 }
47 46
48 47
diff --git a/framework/qml/InlineAccountSwitcher.qml b/framework/qml/InlineAccountSwitcher.qml
index 511c38db..354150a5 100644
--- a/framework/qml/InlineAccountSwitcher.qml
+++ b/framework/qml/InlineAccountSwitcher.qml
@@ -24,10 +24,7 @@ FocusScope {
24 id: root 24 id: root
25 property string currentAccount 25 property string currentAccount
26 onCurrentAccountChanged: { 26 onCurrentAccountChanged: {
27 if (!!currentAccount) { 27 Kube.Fabric.postMessage(Kube.Messages.accountSelection, {"account": currentAccount});
28 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": currentAccount});
29 }
30
31 } 28 }
32 29
33 ColumnLayout { 30 ColumnLayout {
diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml
index 485f7816..1d2ca002 100644
--- a/framework/qml/Messages.qml
+++ b/framework/qml/Messages.qml
@@ -24,6 +24,7 @@ Item {
24 //Selections 24 //Selections
25 property string folderSelection: "currentFolder" 25 property string folderSelection: "currentFolder"
26 property string mailSelection: "currentMail" 26 property string mailSelection: "currentMail"
27 property string accountSelection: "currentAccount"
27 28
28 //Actions 29 //Actions
29 property string moveToTrash: "moveToTrash" 30 property string moveToTrash: "moveToTrash"