diff options
Diffstat (limited to 'framework/qml/StatusBar.qml')
-rw-r--r-- | framework/qml/StatusBar.qml | 28 |
1 files changed, 25 insertions, 3 deletions
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 | |||
22 | Item { | 22 | Item { |
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 | } |