summaryrefslogtreecommitdiff
path: root/rockwork/Main.qml
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2016-02-18 09:11:16 +0100
committerAndrew Branson <andrew.branson@cern.ch>2016-02-18 09:11:16 +0100
commit8f014f0915c7bdc97573f953aa9a3ae25a5f953a (patch)
tree3a7802c954ba9374dc83f91038a885fc2ddf4118 /rockwork/Main.qml
parentc177b720be89b9bae5b643caa9e84c132ec8f869 (diff)
Rockwork 1.0
Diffstat (limited to 'rockwork/Main.qml')
-rw-r--r--rockwork/Main.qml50
1 files changed, 49 insertions, 1 deletions
diff --git a/rockwork/Main.qml b/rockwork/Main.qml
index 2bdece3..a4726b9 100644
--- a/rockwork/Main.qml
+++ b/rockwork/Main.qml
@@ -35,11 +35,14 @@ MainView {
Pebbles {
id: pebbles
onCountChanged: loadStack()
+ onConnectedToServiceChanged: loadStack();
}
function loadStack() {
pageStack.clear()
- if (pebbles.count == 1) {
+ if (!pebbles.connectedToService) {
+ pageStack.push(loadingComponent)
+ } else if (pebbles.count == 1) {
pageStack.push(Qt.resolvedUrl("MainMenuPage.qml"), {pebble: pebbles.get(0)})
} else {
pageStack.push(Qt.resolvedUrl("PebblesPage.qml"))
@@ -50,4 +53,49 @@ MainView {
id: pageStack
Component.onCompleted: loadStack();
}
+
+ Component {
+ id: loadingComponent
+ Page {
+ title: "RockWork"
+
+ Column {
+ width: parent.width - units.gu(4)
+ anchors.centerIn: parent
+ spacing: units.gu(4)
+
+ Rectangle {
+ id: upgradeIcon
+ height: units.gu(10)
+ width: height
+ radius: width / 2
+ color: UbuntuColors.blue
+ anchors.horizontalCenter: parent.horizontalCenter
+ Icon {
+ anchors.fill: parent
+ anchors.margins: units.gu(1)
+ name: "preferences-system-updates-symbolic"
+ color: "white"
+ }
+
+ RotationAnimation on rotation {
+ duration: 2000
+ loops: Animation.Infinite
+ from: 0
+ to: 360
+ running: upgradeIcon.visible
+ }
+ visible: true
+ }
+
+ Label {
+ width: parent.width
+ horizontalAlignment: Text.AlignHCenter
+ fontSize: "large"
+ text: i18n.tr("Loading...")
+ }
+ }
+
+ }
+ }
}