summaryrefslogtreecommitdiff
path: root/app/qml/pages/AppStorePage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'app/qml/pages/AppStorePage.qml')
-rw-r--r--app/qml/pages/AppStorePage.qml95
1 files changed, 86 insertions, 9 deletions
diff --git a/app/qml/pages/AppStorePage.qml b/app/qml/pages/AppStorePage.qml
index 95bb2db..680ac50 100644
--- a/app/qml/pages/AppStorePage.qml
+++ b/app/qml/pages/AppStorePage.qml
@@ -2,23 +2,100 @@ 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
- PebbleStoreView {
- id: webview
+ ConfigurationGroup {
+ id: settings
+ path: "/org/pebbled/settings"
+ property string storeAccessToken: ""
+ }
+
+ SilicaFlickable {
+ id: flickable
anchors.fill: parent
- url: "https://auth.getpebble.com/oauth/authorize?client_id=f88739e8e7a696c411236c41afc81cbef16dc54c3ff633d92dd4ceb0e5a25e5f&response_type=token&mid=xxx&pid=xxx&platform=android&mobile=sign_in&redirect_uri=pebble%3A%2F%2Flogin"
+ contentHeight: column.height + webview.height
+
+ PullDownMenu {
+ visible: webview.loggedin;
- onLoginSuccess: {
- console.log("ON Login " + accessToken);
- webview.url = "https://apps-prod.getpebble.com/en_US/?access_token=" + accessToken + "#/watchfaces"
+ MenuItem {
+ text: qsTr("Logout")
+ onClicked: {
+ webview.logout();
+ }
+ }
}
- onDownloadPebbleApp: {
- console.log("ON DOWNLOAD " + title);
- console.log(downloadUrl);
+ 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)
+ }
}
}
+
+
}
+