diff options
Diffstat (limited to 'app/qml/pages')
| -rw-r--r-- | app/qml/pages/AppStorePage.qml | 95 | ||||
| -rw-r--r-- | app/qml/pages/InstallAppDialog.qml | 4 | ||||
| -rw-r--r-- | app/qml/pages/ManagerPage.qml | 4 |
3 files changed, 90 insertions, 13 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) + } } } + + } + diff --git a/app/qml/pages/InstallAppDialog.qml b/app/qml/pages/InstallAppDialog.qml index ecc3d78..4661cf0 100644 --- a/app/qml/pages/InstallAppDialog.qml +++ b/app/qml/pages/InstallAppDialog.qml @@ -84,6 +84,10 @@ Dialog { } } + MenuItem { + text: qsTr("Pebble Appstore") + onClicked: pageStack.push(Qt.resolvedUrl("AppStorePage.qml")) + } } currentIndex: -1 diff --git a/app/qml/pages/ManagerPage.qml b/app/qml/pages/ManagerPage.qml index c0dd411..814c9d8 100644 --- a/app/qml/pages/ManagerPage.qml +++ b/app/qml/pages/ManagerPage.qml @@ -65,10 +65,6 @@ Page { text: qsTr("About") onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml")) } - MenuItem { - text: qsTr("Pebble Appstore") - onClicked: pageStack.push(Qt.resolvedUrl("AppStorePage.qml")) - } } Column { |
