diff options
Diffstat (limited to 'app/qml')
| -rw-r--r-- | app/qml/pages/AppStorePage.qml | 101 | ||||
| -rw-r--r-- | app/qml/pages/InstallAppDialog.qml | 4 |
2 files changed, 105 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) + } + } + } + + +} + 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 |
