From e059c47ff2986c329d075f6f5fbedbf19cff430d Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Fri, 17 Apr 2015 13:36:51 +0200 Subject: Show configure option only for configurable apps Test for "configurable" capability. --- app/pebbledinterface.cpp | 1 + app/qml/pages/WatchPage.qml | 3 ++- app/translations/pebble-es.ts | 14 +++++++------- app/translations/pebble-pl.ts | 14 +++++++------- app/translations/pebble.ts | 14 +++++++------- daemon/manager.cpp | 3 ++- 6 files changed, 26 insertions(+), 23 deletions(-) diff --git a/app/pebbledinterface.cpp b/app/pebbledinterface.cpp index 2099c9e..13535da 100644 --- a/app/pebbledinterface.cpp +++ b/app/pebbledinterface.cpp @@ -358,6 +358,7 @@ void PebbledInterface::refreshAllApps() m.insert("companyName", orig.value("company-name")); m.insert("versionLabel", orig.value("version-label")); m.insert("isWatchface", orig.value("is-watchface")); + m.insert("isConfigurable", orig.value("configurable")); QByteArray pngIcon = orig.value("menu-icon").toByteArray(); if (!pngIcon.isEmpty()) { diff --git a/app/qml/pages/WatchPage.qml b/app/qml/pages/WatchPage.qml index 55f4db0..730f850 100644 --- a/app/qml/pages/WatchPage.qml +++ b/app/qml/pages/WatchPage.qml @@ -96,6 +96,7 @@ Page { property var appInfo: pebbled.appInfoByUuid(modelData) property bool isKnownApp: appInfo.hasOwnProperty("uuid") property bool isLocalApp: appInfo.hasOwnProperty("isLocal") && appInfo.isLocal + property bool isConfigurable: appInfo.hasOwnProperty("isConfigurable") && appInfo.isConfigurable property bool busy: false function configure() { @@ -212,7 +213,7 @@ Page { } MenuItem { text: qsTr("Configure...") - visible: !isEmptySlot && isLocalApp + visible: !isEmptySlot && isLocalApp && isConfigurable onClicked: configure(); } MenuItem { diff --git a/app/translations/pebble-es.ts b/app/translations/pebble-es.ts index 005bfe3..4a67245 100644 --- a/app/translations/pebble-es.ts +++ b/app/translations/pebble-es.ts @@ -357,37 +357,37 @@ Si esto tarda mucho, comprueba que el reloj esté emparejado correctamente. - + Uninstalling Desinstalando - + (empty slot) (hueco libre) - + (slot in use by unknown app) (hueco en uso) - + Install app... Instalar app... - + Companion app missing - + Configure... Configurar... - + Uninstall Desinstalar diff --git a/app/translations/pebble-pl.ts b/app/translations/pebble-pl.ts index facc044..7d882c7 100644 --- a/app/translations/pebble-pl.ts +++ b/app/translations/pebble-pl.ts @@ -353,37 +353,37 @@ Jeśli nie zostaje znaleziony sprawdź czy jest w zasięgu i czy jest sparowany Twój firmware jest zbyt stary aby obsłużyć aplikacje SDKv2 - + Uninstalling Odinstalowywanie - + (empty slot) (pusty slot) - + (slot in use by unknown app) (slot w użyciu przez nieznaną aplikację) - + Install app... Zainstaluj aplikację... - + Companion app missing Brakuje companion app - + Configure... Konfiguruj... - + Uninstall Odinstaluj diff --git a/app/translations/pebble.ts b/app/translations/pebble.ts index b9c74d3..1b62733 100644 --- a/app/translations/pebble.ts +++ b/app/translations/pebble.ts @@ -352,37 +352,37 @@ 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... - + Companion app missing - + Configure... - + Uninstall diff --git a/daemon/manager.cpp b/daemon/manager.cpp index db183bd..02a4021 100644 --- a/daemon/manager.cpp +++ b/daemon/manager.cpp @@ -436,7 +436,7 @@ QVariantList PebbledProxy::AllApps() const QVariantList l; foreach (const QUuid &uuid, uuids) { - const AppInfo &info = manager()->apps->info(uuid); + AppInfo info = manager()->apps->info(uuid); QVariantMap m; m.insert("local", QVariant::fromValue(info.isLocal())); m.insert("uuid", QVariant::fromValue(info.uuid().toString())); @@ -445,6 +445,7 @@ QVariantList PebbledProxy::AllApps() const m.insert("company-name", QVariant::fromValue(info.companyName())); m.insert("version-label", QVariant::fromValue(info.versionLabel())); m.insert("is-watchface", QVariant::fromValue(info.isWatchface())); + m.insert("configurable", QVariant::fromValue(info.capabilities().testFlag(AppInfo::Capability::Configurable))); if (!info.getMenuIconImage().isNull()) { m.insert("menu-icon", QVariant::fromValue(info.getMenuIconPng())); -- cgit v1.2.3