summaryrefslogtreecommitdiffstats
path: root/framework/qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-20 12:03:33 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-20 12:03:33 +0200
commitbe511a719851c14c5ea5c1479ed2d814fbd3a8e6 (patch)
tree96b4d73cb249bd39c24ac627d05201f4ea033e9d /framework/qml
parentfa8703974b98622f3f0dcd31cc1bdef554fb227b (diff)
downloadkube-be511a719851c14c5ea5c1479ed2d814fbd3a8e6.tar.gz
kube-be511a719851c14c5ea5c1479ed2d814fbd3a8e6.zip
Get the folder name in the status bar
Diffstat (limited to 'framework/qml')
-rw-r--r--framework/qml/Messages.qml1
-rw-r--r--framework/qml/StatusBar.qml28
2 files changed, 26 insertions, 3 deletions
diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml
index aa43de76..485f7816 100644
--- a/framework/qml/Messages.qml
+++ b/framework/qml/Messages.qml
@@ -36,6 +36,7 @@ Item {
36 36
37 property string notification: "notification" 37 property string notification: "notification"
38 property string progressNotification: "progressNotification" 38 property string progressNotification: "progressNotification"
39 property string errorNotification: "errorNotification"
39 property string search: "search" 40 property string search: "search"
40 property string synchronize: "synchronize" 41 property string synchronize: "synchronize"
41 property string reply: "reply" 42 property string reply: "reply"
diff --git a/framework/qml/StatusBar.qml b/framework/qml/StatusBar.qml
index fa85f872..ea2b4db5 100644
--- a/framework/qml/StatusBar.qml
+++ b/framework/qml/StatusBar.qml
@@ -22,6 +22,18 @@ import org.kube.framework 1.0 as Kube
22Item { 22Item {
23 id: root 23 id: root
24 property string accountId: "" 24 property string accountId: ""
25 property string currentFolderName: ""
26 property string currentFolderId: ""
27 property string errorText: "Error"
28
29 onCurrentFolderIdChanged: root.currentFolderName = ""
30 Kube.FolderListModel {
31 id: folderModel
32 folderId: root.currentFolderId
33 onRowsInserted: root.currentFolderName = folderModel.data(folderModel.index(0, 0), Kube.FolderListModel.Name)
34 onRowsRemoved: root.currentFolderName = ""
35 }
36
25 Repeater { 37 Repeater {
26 model: Kube.AccountsModel { 38 model: Kube.AccountsModel {
27 accountId: root.accountId 39 accountId: root.accountId
@@ -44,14 +56,13 @@ Item {
44 State { 56 State {
45 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus 57 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus
46 PropertyChanges { target: statusBar; visible: true } 58 PropertyChanges { target: statusBar; visible: true }
47 PropertyChanges { target: statusText; text: "Synchronizing..."; visible: true } 59 PropertyChanges { target: statusText; text: root.currentFolderName.length > 0 ? "Synchronizing " + root.currentFolderName: "Synchronizing..."; visible: true }
48 PropertyChanges { target: progressBar; visible: true } 60 PropertyChanges { target: progressBar; visible: true }
49 }, 61 },
50 State { 62 State {
51 name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus 63 name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus
52 PropertyChanges { target: statusBar; visible: true } 64 PropertyChanges { target: statusBar; visible: true }
53 //TODO get to an error description 65 PropertyChanges { target: statusText; text: root.errorText; visible: true }
54 PropertyChanges { target: statusText; text: "Error"; visible: true }
55 } 66 }
56 ] 67 ]
57 } 68 }
@@ -71,6 +82,17 @@ Item {
71 progressBar.from = 0 82 progressBar.from = 0
72 progressBar.to = message.total 83 progressBar.to = message.total
73 progressBar.value = message.progress 84 progressBar.value = message.progress
85 if (message.folderId) {
86 root.currentFolderId = message.folderId
87 } else {
88 root.currentFolderId = ""
89 }
90 }
91 }
92 Kube.Listener {
93 filter: Kube.Messages.errorNotification
94 onMessageReceived: {
95 root.errorText = message.message
74 } 96 }
75 } 97 }
76 } 98 }