summaryrefslogtreecommitdiff
path: root/app/qml/pages/InstallAppDialog.qml
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-12-14 00:45:55 +0100
committerJavier <dev.git@javispedro.com>2014-12-14 00:45:55 +0100
commitdf30ca18eebd2dfec03c589b607d45a5891cf2b2 (patch)
tree2d916ddf017f299759e1c2e41d6861b3ee02be06 /app/qml/pages/InstallAppDialog.qml
parent93ec9b745032b4e9c02756dd0361de3a364b6742 (diff)
add UI to install/remove apps from watch
Diffstat (limited to 'app/qml/pages/InstallAppDialog.qml')
-rw-r--r--app/qml/pages/InstallAppDialog.qml66
1 files changed, 66 insertions, 0 deletions
diff --git a/app/qml/pages/InstallAppDialog.qml b/app/qml/pages/InstallAppDialog.qml
new file mode 100644
index 0000000..3a3c0b1
--- /dev/null
+++ b/app/qml/pages/InstallAppDialog.qml
@@ -0,0 +1,66 @@
+import QtQuick 2.0
+import QtQml 2.1
+import Sailfish.Silica 1.0
+
+Dialog {
+ id: installAppPage
+
+ property string selectedUuid;
+
+ SilicaListView {
+ id: appList
+ anchors.fill: parent
+
+ header: DialogHeader {
+ title: qsTr("Install app")
+ defaultAcceptText: qsTr("Install")
+ }
+
+ VerticalScrollDecorator { flickable: flickable }
+
+ currentIndex: -1
+
+ delegate: ListItem {
+ id: appDelegate
+ contentHeight: Theme.itemSizeSmall
+
+ property string uuid: modelData.uuid
+ property bool alreadyInstalled: pebbled.isAppInstalled(uuid)
+
+ Image {
+ id: appImage
+ anchors {
+ top: parent.top
+ left: parent.left
+ leftMargin: Theme.paddingLarge
+ }
+ width: Theme.itemSizeSmall
+ }
+
+ Label {
+ id: appName
+ anchors {
+ left: appImage.right
+ leftMargin: Theme.paddingMedium
+ right: parent.right
+ rightMargin: Theme.paddiumLarge
+ verticalCenter: parent.verticalCenter
+ }
+ text: modelData.longName
+ color: appDelegate.highlighted ? Theme.highlightColor : Theme.primaryColor
+ }
+
+ onClicked: {
+ appList.currentIndex = index
+ if (!alreadyInstalled) {
+ selectedUuid = uuid
+ accept();
+ }
+ }
+ }
+
+ model: pebbled.allApps
+ }
+
+ canAccept: appList.currentIndex >= 0 && !appList.currentItem.alreadyInstalled
+}