summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/kube/contents/ui/MailView.qml65
-rw-r--r--framework/qml/StatusBar.qml79
-rw-r--r--framework/qmldir1
3 files changed, 87 insertions, 58 deletions
diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml
index 8ae2ffe4..2bbe6652 100644
--- a/components/kube/contents/ui/MailView.qml
+++ b/components/kube/contents/ui/MailView.qml
@@ -89,64 +89,13 @@ SplitView {
89 color: Kube.Colors.viewBackgroundColor 89 color: Kube.Colors.viewBackgroundColor
90 opacity: 0.3 90 opacity: 0.3
91 } 91 }
92 92 Kube.StatusBar {
93 Repeater { 93 accountId: accountFolderview.currentAccount
94 model: Kube.AccountsModel { 94 anchors {
95 accountId: accountFolderview.currentAccount 95 top: border.bottom
96 } 96 left: statusBar.left
97 97 right: statusBar.right
98 Column { 98 bottom: statusBar.bottom
99 anchors {
100 top: border.bottom
101 left: statusBar.left
102 right: statusBar.right
103 bottom: statusBar.bottom
104 }
105 spacing: Kube.Units.smallSpacing
106 Kube.Label {
107 id: statusText
108 anchors.horizontalCenter: parent.horizontalCenter
109 visible: false
110 color: Kube.Colors.highlightedTextColor
111 states: [
112 State {
113 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
114 PropertyChanges { target: statusBar; visible: true }
115 PropertyChanges { target: statusText; text: "Disconnected"; visible: true }
116 },
117 State {
118 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus
119 PropertyChanges { target: statusBar; visible: true }
120 PropertyChanges { target: statusText; text: "Synchronizing..."; visible: true }
121 PropertyChanges { target: progressBar; visible: true }
122 },
123 State {
124 name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus
125 PropertyChanges { target: statusBar; visible: true }
126 //TODO get to an error description
127 PropertyChanges { target: statusText; text: "Error"; visible: true }
128 }
129 ]
130 }
131 Kube.ProgressBar {
132 id: progressBar
133 anchors.horizontalCenter: parent.horizontalCenter
134 height: 2
135 width: parent.width - Kube.Units.smallSpacing * 2
136
137 indeterminate: true
138 visible: false
139
140 Kube.Listener {
141 filter: Kube.Messages.progressNotification
142 onMessageReceived: {
143 progressBar.indeterminate = false
144 progressBar.from = 0
145 progressBar.to = message.total
146 progressBar.value = message.progress
147 }
148 }
149 }
150 } 99 }
151 } 100 }
152 } 101 }
diff --git a/framework/qml/StatusBar.qml b/framework/qml/StatusBar.qml
new file mode 100644
index 00000000..fa85f872
--- /dev/null
+++ b/framework/qml/StatusBar.qml
@@ -0,0 +1,79 @@
1/*
2 * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19import QtQuick 2.7
20import org.kube.framework 1.0 as Kube
21
22Item {
23 id: root
24 property string accountId: ""
25 Repeater {
26 model: Kube.AccountsModel {
27 accountId: root.accountId
28 }
29
30 Column {
31 anchors.fill: root
32 spacing: Kube.Units.smallSpacing
33 Kube.Label {
34 id: statusText
35 anchors.horizontalCenter: parent.horizontalCenter
36 visible: false
37 color: Kube.Colors.highlightedTextColor
38 states: [
39 State {
40 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
41 PropertyChanges { target: statusBar; visible: true }
42 PropertyChanges { target: statusText; text: "Disconnected"; visible: true }
43 },
44 State {
45 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus
46 PropertyChanges { target: statusBar; visible: true }
47 PropertyChanges { target: statusText; text: "Synchronizing..."; visible: true }
48 PropertyChanges { target: progressBar; visible: true }
49 },
50 State {
51 name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus
52 PropertyChanges { target: statusBar; visible: true }
53 //TODO get to an error description
54 PropertyChanges { target: statusText; text: "Error"; visible: true }
55 }
56 ]
57 }
58 Kube.ProgressBar {
59 id: progressBar
60 anchors.horizontalCenter: parent.horizontalCenter
61 height: 2
62 width: parent.width - Kube.Units.smallSpacing * 2
63
64 indeterminate: true
65 visible: false
66
67 Kube.Listener {
68 filter: Kube.Messages.progressNotification
69 onMessageReceived: {
70 progressBar.indeterminate = false
71 progressBar.from = 0
72 progressBar.to = message.total
73 progressBar.value = message.progress
74 }
75 }
76 }
77 }
78 }
79}
diff --git a/framework/qmldir b/framework/qmldir
index 2060a920..a5184771 100644
--- a/framework/qmldir
+++ b/framework/qmldir
@@ -18,6 +18,7 @@ IconButton 1.0 IconButton.qml
18Button 1.0 Button.qml 18Button 1.0 Button.qml
19Popup 1.0 Popup.qml 19Popup 1.0 Popup.qml
20ProgressBar 1.0 ProgressBar.qml 20ProgressBar 1.0 ProgressBar.qml
21StatusBar 1.0 StatusBar.qml
21ComboBox 1.0 ComboBox.qml 22ComboBox 1.0 ComboBox.qml
22PositiveButton 1.0 PositiveButton.qml 23PositiveButton 1.0 PositiveButton.qml
23TextField 1.0 TextField.qml 24TextField 1.0 TextField.qml