diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-14 22:33:35 +0100 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-14 22:33:35 +0100 |
| commit | a73ceae865428cdfcf7022677bad5f932379fbf6 (patch) | |
| tree | 6f0b994923e1c1f3ce1b3b1c89301e69a7867997 /app/qml/pages/AppStorePage.qml | |
| parent | e8f9a4da6c486ee4da9ae300019856976ff0a760 (diff) | |
| parent | 0da3325dcab2ebd419d1d0b1a59428f3201a5732 (diff) | |
Merge pull request #29 from smurfy/pebble-store
Pebble store support
Diffstat (limited to 'app/qml/pages/AppStorePage.qml')
| -rw-r--r-- | app/qml/pages/AppStorePage.qml | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/app/qml/pages/AppStorePage.qml b/app/qml/pages/AppStorePage.qml new file mode 100644 index 0000000..680ac50 --- /dev/null +++ b/app/qml/pages/AppStorePage.qml @@ -0,0 +1,101 @@ +import QtQuick 2.0 +import QtQml 2.1 +import Sailfish.Silica 1.0 +import org.pebbled 0.1 +import org.nemomobile.configuration 1.0 + +Page { + id: page + + ConfigurationGroup { + id: settings + path: "/org/pebbled/settings" + property string storeAccessToken: "" + } + + SilicaFlickable { + id: flickable + anchors.fill: parent + contentHeight: column.height + webview.height + + PullDownMenu { + visible: webview.loggedin; + + MenuItem { + text: qsTr("Logout") + onClicked: { + webview.logout(); + } + } + } + + Column { + id: column + width: page.width + spacing: Theme.paddingLarge + + PageHeader { + title: qsTr("Pebble Appstore") + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter + visible: webview.loggedin; + Button { + text: qsTr("WatchApps") + onClicked: { + webview.gotoWatchApps(); + } + } + Button { + text: qsTr("WatchFaces") + onClicked: { + webview.gotoWatchFaces(); + } + } + } + + Column { + id: download + visible: webview.downloadInProgress + width: parent.width + + Label { + anchors.horizontalCenter: parent.horizontalCenter + id: downloadLabel + text: qsTr("Downloading...") + } + + BusyIndicator { + anchors.horizontalCenter: parent.horizontalCenter + running: true + size: BusyIndicatorSize.Large + } + } + } + + PebbleStoreView { + id: webview + visible: !webview.downloadInProgress + width: page.width + height: page.height - column.height + + anchors { + top: column.bottom + } + + accessToken: settings.storeAccessToken + + onAccessTokenChanged: { + settings.storeAccessToken = accessToken; + } + + onDownloadPebbleApp: { + downloadLabel.text = qsTr("Downloading %1...").arg(downloadTitle) + } + } + } + + +} + |
