From 78d1697cd63033244304f7794cf9157029e4fdb5 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Wed, 8 Apr 2015 11:52:14 +0200 Subject: Implemented firmwareUpgrade in daemon --- app/pebbledinterface.cpp | 11 ++++++----- app/pebbledinterface.h | 2 +- app/qml/pages/WatchPage.qml | 11 +---------- app/qml/pebble.qml | 4 ++-- app/translations/pebble-es.ts | 24 ++++++++++++------------ app/translations/pebble-pl.ts | 24 ++++++++++++------------ app/translations/pebble.ts | 24 ++++++++++++------------ 7 files changed, 46 insertions(+), 54 deletions(-) (limited to 'app') diff --git a/app/pebbledinterface.cpp b/app/pebbledinterface.cpp index 28f0581..2099c9e 100644 --- a/app/pebbledinterface.cpp +++ b/app/pebbledinterface.cpp @@ -304,6 +304,12 @@ QVariantMap PebbledInterface::appInfoByUuid(const QString &uuid) const } } +void PebbledInterface::notifyFirmware(bool ok) +{ + qDebug() << Q_FUNC_INFO << ok; + watch->NotifyFirmware(ok); +} + void PebbledInterface::uploadFirmware(const QString &file) { qDebug() << Q_FUNC_INFO << file; @@ -311,11 +317,6 @@ void PebbledInterface::uploadFirmware(const QString &file) reply.waitForFinished(); } -void PebbledInterface::notifyFirmware(const QString &version) -{ - qDebug() << Q_FUNC_INFO << version; -} - void PebbledInterface::onWatchConnectedChanged() { qDebug() << Q_FUNC_INFO; diff --git a/app/pebbledinterface.h b/app/pebbledinterface.h index 740df75..df0b722 100644 --- a/app/pebbledinterface.h +++ b/app/pebbledinterface.h @@ -73,8 +73,8 @@ public slots: void uploadApp(const QString &uuid, int slot); void unloadApp(int slot); + void notifyFirmware(bool ok); void uploadFirmware(const QString &file); - void notifyFirmware(const QString &version); private slots: void onWatchConnectedChanged(); diff --git a/app/qml/pages/WatchPage.qml b/app/qml/pages/WatchPage.qml index 6c24ef0..55f4db0 100644 --- a/app/qml/pages/WatchPage.qml +++ b/app/qml/pages/WatchPage.qml @@ -5,15 +5,7 @@ import Sailfish.Silica 1.0 Page { id: watchPage - property bool firmwareVersionOK: false - - Component.onCompleted: { - pebbled.info.firmware.forEach(function(firmware){ - if (!firmware.recovery) { - firmwareVersionOK = (firmware.version.indexOf("v1.") !== 0) - } - }) - } + property bool firmwareVersionOK: app.firmwareVersion && app.firmwareVersion.indexOf("v1.") !== 0 SilicaFlickable { id: flickable @@ -78,7 +70,6 @@ Page { from: Theme.primaryColor; to: Theme.highlightColor duration: 2500 loops: Animation.Infinite - easing: { type: Easing.InOutQuint } } } diff --git a/app/qml/pebble.qml b/app/qml/pebble.qml index a4b8b1f..380ff7e 100644 --- a/app/qml/pebble.qml +++ b/app/qml/pebble.qml @@ -32,8 +32,8 @@ ApplicationWindow function notifyNewFirmware() { firmwareLatest = pebbleFirmware.latest.friendlyVersion || "" - if (firmwareLatest && firmwareVersion && firmwareVersion !== firmwareLatest) { - pebbled.notifyFirmware(firmwareLatest); + if (firmwareLatest && firmwareVersion) { + pebbled.notifyFirmware(firmwareVersion === firmwareLatest); } } diff --git a/app/translations/pebble-es.ts b/app/translations/pebble-es.ts index 013942e..005bfe3 100644 --- a/app/translations/pebble-es.ts +++ b/app/translations/pebble-es.ts @@ -332,62 +332,62 @@ Si esto tarda mucho, comprueba que el reloj esté emparejado correctamente. WatchPage - + Info - + Ping Ping - + Sync Time Ajustar hora - + Installed applications Aplicaciones instaladas - + Your firmware is too old to support SDKv2 applications - + 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 0291ab8..facc044 100644 --- a/app/translations/pebble-pl.ts +++ b/app/translations/pebble-pl.ts @@ -328,62 +328,62 @@ Jeśli nie zostaje znaleziony sprawdź czy jest w zasięgu i czy jest sparowany WatchPage - + Info Info - + Ping Ping - + Sync Time Synch.Czas - + Installed applications Zainstalowane aplikacje - + Your firmware is too old to support SDKv2 applications 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 dcb9a34..b9c74d3 100644 --- a/app/translations/pebble.ts +++ b/app/translations/pebble.ts @@ -327,62 +327,62 @@ If it can't be found please check it's available and paired in Bluetoo WatchPage - + Info - + Ping - + Sync Time - + Installed applications - + Your firmware is too old to support SDKv2 applications - + Uninstalling - + (empty slot) - + (slot in use by unknown app) - + Install app... - + Companion app missing - + Configure... - + Uninstall -- cgit v1.2.3