diff options
Diffstat (limited to 'rockwork/Main.qml')
| -rw-r--r-- | rockwork/Main.qml | 50 |
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...") + } + } + + } + } } |
