From eac37967cc535a3ac43a712b52b4bf73b96ec19c Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Sat, 3 Jan 2015 19:30:15 +0100 Subject: Support for watch apps, not installed on phone Needed to show app name instead of "unknown app" on the app management screen. --- app/pebbledinterface.cpp | 4 ++++ app/qml/pages/InstallAppDialog.qml | 4 +++- app/qml/pages/WatchPage.qml | 11 ++++++----- app/translations/pebble-es.ts | 12 ++++++------ app/translations/pebble.ts | 12 ++++++------ 5 files changed, 25 insertions(+), 18 deletions(-) (limited to 'app') diff --git a/app/pebbledinterface.cpp b/app/pebbledinterface.cpp index c978dd0..cc9a617 100644 --- a/app/pebbledinterface.cpp +++ b/app/pebbledinterface.cpp @@ -294,8 +294,12 @@ void PebbledInterface::refreshAllApps() QVariantMap m; m.insert("uuid", uuid.toString()); + m.insert("isLocal", orig.value("local")); m.insert("shortName", orig.value("short-name")); m.insert("longName", orig.value("long-name")); + m.insert("companyName", orig.value("company-name")); + m.insert("versionLabel", orig.value("version-label")); + m.insert("isWatchface", orig.value("is-watchface")); QByteArray pngIcon = orig.value("menu-icon").toByteArray(); if (!pngIcon.isEmpty()) { diff --git a/app/qml/pages/InstallAppDialog.qml b/app/qml/pages/InstallAppDialog.qml index fa96c28..1510c57 100644 --- a/app/qml/pages/InstallAppDialog.qml +++ b/app/qml/pages/InstallAppDialog.qml @@ -24,6 +24,8 @@ Dialog { id: appDelegate contentHeight: Theme.itemSizeSmall + visible: modelData.isLocal + property string uuid: modelData.uuid property bool alreadyInstalled: pebbled.isAppInstalled(uuid) @@ -41,7 +43,7 @@ Dialog { Image { id: appImage anchors.centerIn: parent - source: "image://pebble-app-icon/" + uuid; + source: appDelegate.visible ? "image://pebble-app-icon/" + uuid : "" scale: 2 } } diff --git a/app/qml/pages/WatchPage.qml b/app/qml/pages/WatchPage.qml index 43c2b99..b36280f 100644 --- a/app/qml/pages/WatchPage.qml +++ b/app/qml/pages/WatchPage.qml @@ -101,6 +101,7 @@ Page { property bool isEmptySlot: modelData === "" property var appInfo: pebbled.appInfoByUuid(modelData) property bool isKnownApp: appInfo.hasOwnProperty("uuid") + property bool isLocalApp: appInfo.hasOwnProperty("isLocal") && appInfo.isLocal property bool busy: false function configure() { @@ -155,9 +156,9 @@ Page { Image { id: slotImage anchors.centerIn: parent - source: isKnownApp ? "image://pebble-app-icon/" + modelData : "" + source: isLocalApp ? "image://pebble-app-icon/" + modelData : "" scale: 2 - visible: !isEmptySlot && isKnownApp && !slotBusy.running + visible: !isEmptySlot && isLocalApp && !slotBusy.running } Rectangle { @@ -170,7 +171,7 @@ Page { color: slotDelegate.highlighted ? Theme.highlightColor : Theme.primaryColor } color: "transparent" - visible: isEmptySlot && !slotBusy.running + visible: (isEmptySlot || !isLocalApp) && !slotBusy.running } BusyIndicator { @@ -189,7 +190,7 @@ Page { rightMargin: Theme.paddingLarge verticalCenter: parent.verticalCenter } - text: isEmptySlot ? qsTr("(empty slot)") : (isKnownApp ? appInfo.longName : qsTr("(slot in use by unknown app)")) + text: isEmptySlot ? qsTr("(empty slot)") : (isKnownApp ? (isLocalApp ? appInfo.longName : appInfo.shortName) : qsTr("(slot in use by unknown app)")) color: slotDelegate.highlighted ? Theme.highlightColor : Theme.primaryColor onTextChanged: slotDelegate.busy = false; } @@ -204,7 +205,7 @@ Page { } MenuItem { text: qsTr("Configure...") - visible: !isEmptySlot && isKnownApp + visible: !isEmptySlot && isLocalApp onClicked: configure(); } MenuItem { diff --git a/app/translations/pebble-es.ts b/app/translations/pebble-es.ts index 0316ecb..9be8be2 100644 --- a/app/translations/pebble-es.ts +++ b/app/translations/pebble-es.ts @@ -221,32 +221,32 @@ Si esto tarda mucho, comprueba que el reloj esté emparejado correctamente.Aplicaciones instaladas - + Uninstalling Desinstalando - + (empty slot) (hueco libre) - + (slot in use by unknown app) (hueco en uso) - + Install app... Instalar app... - + Configure... Configurar... - + Uninstall Desinstalar diff --git a/app/translations/pebble.ts b/app/translations/pebble.ts index 7a78d9d..0f953bc 100644 --- a/app/translations/pebble.ts +++ b/app/translations/pebble.ts @@ -220,32 +220,32 @@ If it can't be found please check it's available and paired in Bluetoo - + Uninstalling - + (empty slot) - + (slot in use by unknown app) - + Install app... - + Configure... - + Uninstall -- cgit v1.2.3