diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-04-07 15:40:14 +0200 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-04-07 15:41:31 +0200 |
| commit | cbb0039fe542c0d8281601d25c04de487c84fa17 (patch) | |
| tree | 73462a423ef875e77be3ca97b2939ad06b199854 | |
| parent | 01dca8bb1697fce6a05ab6a613e8ceaca9d4bfec (diff) | |
Implemented checking for latest firmware version
| -rw-r--r-- | app/app.pro | 6 | ||||
| -rw-r--r-- | app/pebble.cpp | 3 | ||||
| -rw-r--r-- | app/pebbledinterface.cpp | 12 | ||||
| -rw-r--r-- | app/pebbledinterface.h | 3 | ||||
| -rw-r--r-- | app/pebblefirmware.cpp | 59 | ||||
| -rw-r--r-- | app/pebblefirmware.h | 38 | ||||
| -rw-r--r-- | app/qml/pages/ManagerPage.qml | 31 | ||||
| -rw-r--r-- | app/qml/pages/WatchInfo.qml | 52 | ||||
| -rw-r--r-- | app/qml/pebble.qml | 88 | ||||
| -rw-r--r-- | app/translations/pebble-es.ts | 86 | ||||
| -rw-r--r-- | app/translations/pebble-pl.ts | 86 | ||||
| -rw-r--r-- | app/translations/pebble.ts | 86 | ||||
| -rw-r--r-- | daemon/daemon.pro | 5 | ||||
| -rw-r--r-- | org.pebbled.Watch.xml | 6 | ||||
| -rw-r--r-- | pebble.pro | 1 |
15 files changed, 374 insertions, 188 deletions
diff --git a/app/app.pro b/app/app.pro index 3810f90..18be5a5 100644 --- a/app/app.pro +++ b/app/app.pro @@ -11,12 +11,14 @@ SOURCES += \ pebble.cpp \ pebbledinterface.cpp \ pebbleappiconprovider.cpp \ - pebblestoreview.cpp + pebblestoreview.cpp \ + pebblefirmware.cpp HEADERS += \ pebbledinterface.h \ pebbleappiconprovider.h \ - pebblestoreview.h + pebblestoreview.h \ + pebblefirmware.h DBUS_INTERFACES += ../org.pebbled.Watch.xml diff --git a/app/pebble.cpp b/app/pebble.cpp index dd3c915..04ff6a8 100644 --- a/app/pebble.cpp +++ b/app/pebble.cpp @@ -34,6 +34,7 @@ #include <sailfishapp.h> #include "pebbledinterface.h" #include "pebbleappiconprovider.h" +#include "pebblefirmware.h" #include "pebblestoreview.h" int main(int argc, char *argv[]) @@ -54,9 +55,11 @@ int main(int argc, char *argv[]) QScopedPointer<QQuickView> view(SailfishApp::createView()); QScopedPointer<PebbledInterface> pebbled(new PebbledInterface); QScopedPointer<PebbleAppIconProvider> appicons(new PebbleAppIconProvider(pebbled.data())); + QScopedPointer<PebbleFirmware> firmware(new PebbleFirmware); view->rootContext()->setContextProperty("APP_VERSION", APP_VERSION); view->rootContext()->setContextProperty("pebbled", pebbled.data()); + view->rootContext()->setContextProperty("pebbleFirmware", firmware.data()); view->engine()->addImageProvider("pebble-app-icon", appicons.data()); view->setSource(SailfishApp::pathTo("qml/pebble.qml")); view->show(); diff --git a/app/pebbledinterface.cpp b/app/pebbledinterface.cpp index e7fcb2e..28f0581 100644 --- a/app/pebbledinterface.cpp +++ b/app/pebbledinterface.cpp @@ -304,6 +304,18 @@ QVariantMap PebbledInterface::appInfoByUuid(const QString &uuid) const } } +void PebbledInterface::uploadFirmware(const QString &file) +{ + qDebug() << Q_FUNC_INFO << file; + QDBusPendingReply<> reply = watch->UploadFirmware(false, 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 cba5416..740df75 100644 --- a/app/pebbledinterface.h +++ b/app/pebbledinterface.h @@ -73,6 +73,9 @@ public slots: void uploadApp(const QString &uuid, int slot); void unloadApp(int slot); + void uploadFirmware(const QString &file); + void notifyFirmware(const QString &version); + private slots: void onWatchConnectedChanged(); void getUnitProperties(); diff --git a/app/pebblefirmware.cpp b/app/pebblefirmware.cpp new file mode 100644 index 0000000..95294f7 --- /dev/null +++ b/app/pebblefirmware.cpp @@ -0,0 +1,59 @@ +#include "pebblefirmware.h" +#include <QJsonDocument> +#include <QStandardPaths> +#include <QDir> +#include <QFile> +#include <QFileInfo> + +const QString PebbleFirmware::firmwareURL("http://pebblefw.s3.amazonaws.com/pebble/%1/%2/latest.json"); + +PebbleFirmware::PebbleFirmware(QObject *parent) : + QObject(parent), nm(new QNetworkAccessManager(this)) +{ + connect(nm, SIGNAL(finished(QNetworkReply*)), SLOT(onNetworkReplyFinished(QNetworkReply*))); +} + +void PebbleFirmware::updateLatest(QString hw) +{ + QNetworkRequest req; + req.setUrl(firmwareURL.arg(hw).arg("release-v2")); + req.setRawHeader("Cache-Control", "no-cache"); + nm->get(req); +} + +void PebbleFirmware::fetchFirmware(QString type) +{ + QNetworkRequest req; + req.setUrl(_latest.value(type).toObject().value("url").toString()); + req.setRawHeader("Cache-Control", "no-cache"); + nm->get(req); +} + +void PebbleFirmware::onNetworkReplyFinished(QNetworkReply* rep) +{ + qDebug() << "Download finished" << rep->url(); + + if (rep->request().url().toString().endsWith("/latest.json")) { + QJsonDocument jsonResponse = QJsonDocument::fromJson(rep->readAll()); + QJsonObject jsonObject = jsonResponse.object(); + if (!jsonObject.isEmpty()) { + qDebug() << "Latest firmware" << jsonObject; + _latest = jsonObject.value("normal").toObject(); + emit latestChanged(); + } + } else if (rep->url().toString().endsWith(".pbz")) { + QDir downDir(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)); + QFileInfo name(rep->url().toLocalFile()); + QFile file(downDir.absoluteFilePath(name.fileName())); + file.open(QIODevice::WriteOnly|QIODevice::Truncate); + if (file.write(rep->readAll()) == -1) { + qWarning() << "Error writing" << file.fileName() << file.errorString(); + } else { + file.close(); + qDebug() << "Downloaded" << file.fileName(); + emit firmwareFetched(file.fileName()); + } + } else { + qWarning() << "Unrequested download" << rep->request().url(); + } +} diff --git a/app/pebblefirmware.h b/app/pebblefirmware.h new file mode 100644 index 0000000..3890048 --- /dev/null +++ b/app/pebblefirmware.h @@ -0,0 +1,38 @@ +#ifndef PEBBLEFIRMWARE_H +#define PEBBLEFIRMWARE_H + +#include <QObject> +#include <QJsonObject> +#include <QNetworkAccessManager> +#include <QNetworkReply> + +class PebbleFirmware : public QObject +{ + Q_OBJECT + Q_PROPERTY(QJsonObject latest READ latest NOTIFY latestChanged) + + QJsonObject latest() { return _latest; } + +public: + explicit PebbleFirmware(QObject *parent = 0); + + const static QString firmwareURL; + +signals: + void latestChanged(); + void firmwareFetched(QString pbz); + +public slots: + void updateLatest(QString hw); + void fetchFirmware(QString type); + +private: + QJsonObject _latest; + + QNetworkAccessManager *nm; + +private slots: + void onNetworkReplyFinished(QNetworkReply*); +}; + +#endif // PEBBLEFIRMWARE_H diff --git a/app/qml/pages/ManagerPage.qml b/app/qml/pages/ManagerPage.qml index bfafeb5..894797d 100644 --- a/app/qml/pages/ManagerPage.qml +++ b/app/qml/pages/ManagerPage.qml @@ -1,34 +1,3 @@ -/* - Copyright (C) 2014 Jouni Roivas - Copyright (C) 2013 Jolla Ltd. - Contact: Thomas Perl <thomas.perl@jollamobile.com> - All rights reserved. - - You may use this file under the terms of BSD license as follows: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the authors nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - import QtQuick 2.0 import QtQml 2.1 import Sailfish.Silica 1.0 diff --git a/app/qml/pages/WatchInfo.qml b/app/qml/pages/WatchInfo.qml index 9ae1135..94445fb 100644 --- a/app/qml/pages/WatchInfo.qml +++ b/app/qml/pages/WatchInfo.qml @@ -5,19 +5,6 @@ import Sailfish.Silica 1.0 Page { id: watchInfoPage - property string firmwareVersion - property string recoveryVersion - - Component.onCompleted: { - pebbled.info.firmware.forEach(function(firmware){ - if (firmware.recovery) { - recoveryVersion = firmware.version - } else { - firmwareVersion = firmware.version - } - }) - } - Column { id: column width: watchInfoPage.width @@ -65,7 +52,7 @@ Page { text: qsTr("Firmware") } Label { - text: firmwareVersion + text: app.firmwareVersion } Label { @@ -73,8 +60,43 @@ Page { text: qsTr("Recovery") } Label { - text: recoveryVersion + text: app.recoveryVersion + } + } + + Label { + text: qsTr("Firmware") + font.family: Theme.fontFamilyHeading + color: Theme.highlightColor + anchors.right: parent.right + anchors.rightMargin: Theme.paddingMedium + } + Grid { + columns: 2 + spacing: Theme.paddingMedium + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingLarge + } + + Label { + color: Theme.highlightColor + text: qsTr("Latest") + } + Label { + text: app.firmwareLatest || qsTr("unknown") + } + } + Button { + visible: app.firmwareLatest && app.firmwareVersion && app.firmwareVersion !== app.firmwareLatest + text: qsTr("Upgrade Firmware") + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingLarge * 2 } + onClicked: pageStack.push(Qt.resolvedUrl("FirmwareUpgrade.qml")) } } } diff --git a/app/qml/pebble.qml b/app/qml/pebble.qml index 2e26ebe..a4b8b1f 100644 --- a/app/qml/pebble.qml +++ b/app/qml/pebble.qml @@ -1,34 +1,3 @@ -/* - Copyright (C) 2014 Jouni Roivas - Copyright (C) 2013 Jolla Ltd. - Contact: Thomas Perl <thomas.perl@jollamobile.com> - All rights reserved. - - You may use this file under the terms of BSD license as follows: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the authors nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - import QtQuick 2.0 import Sailfish.Silica 1.0 import "pages" @@ -36,6 +5,63 @@ import org.pebbled 0.1 ApplicationWindow { + id: app + + property string firmwareVersion + property string recoveryVersion + property string hardwareVersion + property string firmwareLatest + initialPage: Component { ManagerPage { } } cover: Qt.resolvedUrl("cover/CoverPage.qml") + + function parseInfo() { + if (pebbled.info.firmware && pebbled.info.firmware.length) { + pebbled.info.firmware.forEach(function(firmware){ + if (firmware.recovery) { + recoveryVersion = firmware.version + } else { + firmwareVersion = firmware.version + hardwareVersion = firmware.hardware + } + }) + } else { + firmwareVersion = recoveryVersion = hardwareVersion = "" + } + } + + function notifyNewFirmware() { + firmwareLatest = pebbleFirmware.latest.friendlyVersion || "" + if (firmwareLatest && firmwareVersion && firmwareVersion !== firmwareLatest) { + pebbled.notifyFirmware(firmwareLatest); + } + } + + Component.onCompleted: { + parseInfo() + } + + Connections { + target: pebbled + onInfoChanged: { + parseInfo() + } + } + + onHardwareVersionChanged: { + if (hardwareVersion) { + pebbleFirmware.updateLatest(hardwareVersion) + } + } + + onFirmwareVersionChanged: { + notifyNewFirmware() + } + + Connections { + target: pebbleFirmware + onLatestChanged: { + notifyNewFirmware() + } + } } diff --git a/app/translations/pebble-es.ts b/app/translations/pebble-es.ts index f93bc2b..013942e 100644 --- a/app/translations/pebble-es.ts +++ b/app/translations/pebble-es.ts @@ -133,154 +133,154 @@ <context> <name>ManagerPage</name> <message> - <location filename="../qml/pages/ManagerPage.qml" line="65"/> + <location filename="../qml/pages/ManagerPage.qml" line="34"/> <source>Pebble Appstore</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="69"/> + <location filename="../qml/pages/ManagerPage.qml" line="38"/> <source>About</source> <translation>Acerca de</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="80"/> + <location filename="../qml/pages/ManagerPage.qml" line="49"/> <source>Pebble Manager</source> <translation></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="87"/> + <location filename="../qml/pages/ManagerPage.qml" line="56"/> <source>Waiting for watch... If it can't be found please check it's available and paired in Bluetooth settings.</source> <translation>Buscando el reloj Si esto tarda mucho, comprueba que el reloj esté emparejado correctamente.</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="108"/> + <location filename="../qml/pages/ManagerPage.qml" line="77"/> <source>Service</source> <translation>Servicio</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="115"/> + <location filename="../qml/pages/ManagerPage.qml" line="84"/> <source>Enabled</source> <translation>Habilitado</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="116"/> + <location filename="../qml/pages/ManagerPage.qml" line="85"/> <source>Automatic startup</source> <translation>Inicio automático</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="116"/> + <location filename="../qml/pages/ManagerPage.qml" line="85"/> <source>Manual startup</source> <translation>Inicio manual</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="122"/> + <location filename="../qml/pages/ManagerPage.qml" line="91"/> <source>Active</source> <translation>Activo</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="123"/> + <location filename="../qml/pages/ManagerPage.qml" line="92"/> <source>Running</source> <translation>Ejecutándose</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="123"/> + <location filename="../qml/pages/ManagerPage.qml" line="92"/> <source>Dead</source> <translation>Detenido</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="129"/> + <location filename="../qml/pages/ManagerPage.qml" line="98"/> <source>Connection</source> <translation>Conexión</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="130"/> + <location filename="../qml/pages/ManagerPage.qml" line="99"/> <source>Connected</source> <translation>Conectado</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="130"/> + <location filename="../qml/pages/ManagerPage.qml" line="99"/> <source>Disconnected</source> <translation>Desconectado</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="143"/> + <location filename="../qml/pages/ManagerPage.qml" line="112"/> <source>Settings</source> <translation>Configuración</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="150"/> + <location filename="../qml/pages/ManagerPage.qml" line="119"/> <source>Forward phone calls</source> <translation>Transferir llamadas</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="158"/> + <location filename="../qml/pages/ManagerPage.qml" line="127"/> <source>Silent when connected</source> <translation>Modo silencio automático</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="159"/> + <location filename="../qml/pages/ManagerPage.qml" line="128"/> <source>Sets phone profile to "silent" when Pebble is connected</source> <translation>Activa el modo silencio cuando se conecte un Pebble</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="167"/> + <location filename="../qml/pages/ManagerPage.qml" line="136"/> <source>Transliterate messages</source> <translation>Transliterar mensajes</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="168"/> + <location filename="../qml/pages/ManagerPage.qml" line="137"/> <source>Messages are transliterated to ASCII before sending to Pebble</source> <translation>Codifica los mensajes entrates a ASCII antes de enviarlos a Pebble</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="177"/> + <location filename="../qml/pages/ManagerPage.qml" line="146"/> <source>Notifications</source> <translation>Notificaciones</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="185"/> + <location filename="../qml/pages/ManagerPage.qml" line="154"/> <source>Messaging</source> <translation>Mensajería</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="186"/> + <location filename="../qml/pages/ManagerPage.qml" line="155"/> <source>SMS and IM</source> <translation>SMS y chat</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="195"/> + <location filename="../qml/pages/ManagerPage.qml" line="164"/> <source>Missed call</source> <translation>Llamadas perdidas</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="204"/> + <location filename="../qml/pages/ManagerPage.qml" line="173"/> <source>Emails</source> <translation>Correos electrónicos</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="213"/> + <location filename="../qml/pages/ManagerPage.qml" line="182"/> <source>Mitakuuluu</source> <translation></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="222"/> + <location filename="../qml/pages/ManagerPage.qml" line="191"/> <source>Twitter</source> <translation>Twitter</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="232"/> + <location filename="../qml/pages/ManagerPage.qml" line="201"/> <source>Facebook</source> <translation>Facebook</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="241"/> + <location filename="../qml/pages/ManagerPage.qml" line="210"/> <source>Other notifications</source> <translation>Resto de notificaciones</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="250"/> + <location filename="../qml/pages/ManagerPage.qml" line="219"/> <source>All notifications</source> <translation>Todas las notificaciones</translation> </message> @@ -288,30 +288,46 @@ Si esto tarda mucho, comprueba que el reloj esté emparejado correctamente.</tra <context> <name>WatchInfo</name> <message> - <location filename="../qml/pages/WatchInfo.qml" line="41"/> + <location filename="../qml/pages/WatchInfo.qml" line="28"/> <source>Address</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="49"/> + <location filename="../qml/pages/WatchInfo.qml" line="36"/> <source>Serial Number</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="57"/> + <location filename="../qml/pages/WatchInfo.qml" line="44"/> <source>BootLoader</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="65"/> + <location filename="../qml/pages/WatchInfo.qml" line="52"/> + <location filename="../qml/pages/WatchInfo.qml" line="68"/> <source>Firmware</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="73"/> + <location filename="../qml/pages/WatchInfo.qml" line="60"/> <source>Recovery</source> <translation type="unfinished"></translation> </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="85"/> + <source>Latest</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="88"/> + <source>unknown</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="93"/> + <source>Upgrade Firmware</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>WatchPage</name> diff --git a/app/translations/pebble-pl.ts b/app/translations/pebble-pl.ts index f61894b..0291ab8 100644 --- a/app/translations/pebble-pl.ts +++ b/app/translations/pebble-pl.ts @@ -129,154 +129,154 @@ <context> <name>ManagerPage</name> <message> - <location filename="../qml/pages/ManagerPage.qml" line="65"/> + <location filename="../qml/pages/ManagerPage.qml" line="34"/> <source>Pebble Appstore</source> <translation>Pebble Appstore</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="69"/> + <location filename="../qml/pages/ManagerPage.qml" line="38"/> <source>About</source> <translation>Informacje</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="80"/> + <location filename="../qml/pages/ManagerPage.qml" line="49"/> <source>Pebble Manager</source> <translation>Pebble Manager</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="87"/> + <location filename="../qml/pages/ManagerPage.qml" line="56"/> <source>Waiting for watch... If it can't be found please check it's available and paired in Bluetooth settings.</source> <translation>Oczekiwanie na zegarek... Jeśli nie zostaje znaleziony sprawdź czy jest w zasięgu i czy jest sparowany w ustawieniach Bluetooth.</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="108"/> + <location filename="../qml/pages/ManagerPage.qml" line="77"/> <source>Service</source> <translation>Usługa</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="115"/> + <location filename="../qml/pages/ManagerPage.qml" line="84"/> <source>Enabled</source> <translation>Włączona</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="116"/> + <location filename="../qml/pages/ManagerPage.qml" line="85"/> <source>Automatic startup</source> <translation>Start automatyczny</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="116"/> + <location filename="../qml/pages/ManagerPage.qml" line="85"/> <source>Manual startup</source> <translation>Start ręczny</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="122"/> + <location filename="../qml/pages/ManagerPage.qml" line="91"/> <source>Active</source> <translation>Aktywna</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="123"/> + <location filename="../qml/pages/ManagerPage.qml" line="92"/> <source>Running</source> <translation>Pracuje</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="123"/> + <location filename="../qml/pages/ManagerPage.qml" line="92"/> <source>Dead</source> <translation>Martwa</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="129"/> + <location filename="../qml/pages/ManagerPage.qml" line="98"/> <source>Connection</source> <translation>Połączenie</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="130"/> + <location filename="../qml/pages/ManagerPage.qml" line="99"/> <source>Connected</source> <translation>Połączony</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="130"/> + <location filename="../qml/pages/ManagerPage.qml" line="99"/> <source>Disconnected</source> <translation>Rozłączony</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="143"/> + <location filename="../qml/pages/ManagerPage.qml" line="112"/> <source>Settings</source> <translation>Ustawienia</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="150"/> + <location filename="../qml/pages/ManagerPage.qml" line="119"/> <source>Forward phone calls</source> <translation>Przekazuj telefony</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="158"/> + <location filename="../qml/pages/ManagerPage.qml" line="127"/> <source>Silent when connected</source> <translation>Cichy gdy połączony</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="159"/> + <location filename="../qml/pages/ManagerPage.qml" line="128"/> <source>Sets phone profile to "silent" when Pebble is connected</source> <translation>Ustawia "cichy" profil telefonu gdy Pebble jest połączony</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="167"/> + <location filename="../qml/pages/ManagerPage.qml" line="136"/> <source>Transliterate messages</source> <translation>Transliteracja wiadomości</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="168"/> + <location filename="../qml/pages/ManagerPage.qml" line="137"/> <source>Messages are transliterated to ASCII before sending to Pebble</source> <translation>Wiadomości są transliterowane do ASCII przed wysłaniem do Pebble</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="177"/> + <location filename="../qml/pages/ManagerPage.qml" line="146"/> <source>Notifications</source> <translation>Powiadomienia</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="185"/> + <location filename="../qml/pages/ManagerPage.qml" line="154"/> <source>Messaging</source> <translation>Wiadomości</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="186"/> + <location filename="../qml/pages/ManagerPage.qml" line="155"/> <source>SMS and IM</source> <translation>SMS i IM</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="195"/> + <location filename="../qml/pages/ManagerPage.qml" line="164"/> <source>Missed call</source> <translation>Ominięte telefony</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="204"/> + <location filename="../qml/pages/ManagerPage.qml" line="173"/> <source>Emails</source> <translation>Emaile</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="213"/> + <location filename="../qml/pages/ManagerPage.qml" line="182"/> <source>Mitakuuluu</source> <translation>Mitakuuluu</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="222"/> + <location filename="../qml/pages/ManagerPage.qml" line="191"/> <source>Twitter</source> <translation>Twitter</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="232"/> + <location filename="../qml/pages/ManagerPage.qml" line="201"/> <source>Facebook</source> <translation>Facebook</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="241"/> + <location filename="../qml/pages/ManagerPage.qml" line="210"/> <source>Other notifications</source> <translation>Pozostałe powiadomienia</translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="250"/> + <location filename="../qml/pages/ManagerPage.qml" line="219"/> <source>All notifications</source> <translation>Wszystkie powiadomienia</translation> </message> @@ -284,30 +284,46 @@ Jeśli nie zostaje znaleziony sprawdź czy jest w zasięgu i czy jest sparowany <context> <name>WatchInfo</name> <message> - <location filename="../qml/pages/WatchInfo.qml" line="41"/> + <location filename="../qml/pages/WatchInfo.qml" line="28"/> <source>Address</source> <translation>Adres</translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="49"/> + <location filename="../qml/pages/WatchInfo.qml" line="36"/> <source>Serial Number</source> <translation>Numer seryjny</translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="57"/> + <location filename="../qml/pages/WatchInfo.qml" line="44"/> <source>BootLoader</source> <translation>Program ładowania</translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="65"/> + <location filename="../qml/pages/WatchInfo.qml" line="52"/> + <location filename="../qml/pages/WatchInfo.qml" line="68"/> <source>Firmware</source> <translation>Firmware</translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="73"/> + <location filename="../qml/pages/WatchInfo.qml" line="60"/> <source>Recovery</source> <translation>Recovery</translation> </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="85"/> + <source>Latest</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="88"/> + <source>unknown</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="93"/> + <source>Upgrade Firmware</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>WatchPage</name> diff --git a/app/translations/pebble.ts b/app/translations/pebble.ts index 5cf9a4d..dcb9a34 100644 --- a/app/translations/pebble.ts +++ b/app/translations/pebble.ts @@ -129,153 +129,153 @@ <context> <name>ManagerPage</name> <message> - <location filename="../qml/pages/ManagerPage.qml" line="65"/> + <location filename="../qml/pages/ManagerPage.qml" line="34"/> <source>Pebble Appstore</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="69"/> + <location filename="../qml/pages/ManagerPage.qml" line="38"/> <source>About</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="80"/> + <location filename="../qml/pages/ManagerPage.qml" line="49"/> <source>Pebble Manager</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="87"/> + <location filename="../qml/pages/ManagerPage.qml" line="56"/> <source>Waiting for watch... If it can't be found please check it's available and paired in Bluetooth settings.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="108"/> + <location filename="../qml/pages/ManagerPage.qml" line="77"/> <source>Service</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="115"/> + <location filename="../qml/pages/ManagerPage.qml" line="84"/> <source>Enabled</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="116"/> + <location filename="../qml/pages/ManagerPage.qml" line="85"/> <source>Automatic startup</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="116"/> + <location filename="../qml/pages/ManagerPage.qml" line="85"/> <source>Manual startup</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="122"/> + <location filename="../qml/pages/ManagerPage.qml" line="91"/> <source>Active</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="123"/> + <location filename="../qml/pages/ManagerPage.qml" line="92"/> <source>Running</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="123"/> + <location filename="../qml/pages/ManagerPage.qml" line="92"/> <source>Dead</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="129"/> + <location filename="../qml/pages/ManagerPage.qml" line="98"/> <source>Connection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="130"/> + <location filename="../qml/pages/ManagerPage.qml" line="99"/> <source>Connected</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="130"/> + <location filename="../qml/pages/ManagerPage.qml" line="99"/> <source>Disconnected</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="143"/> + <location filename="../qml/pages/ManagerPage.qml" line="112"/> <source>Settings</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="150"/> + <location filename="../qml/pages/ManagerPage.qml" line="119"/> <source>Forward phone calls</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="158"/> + <location filename="../qml/pages/ManagerPage.qml" line="127"/> <source>Silent when connected</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="159"/> + <location filename="../qml/pages/ManagerPage.qml" line="128"/> <source>Sets phone profile to "silent" when Pebble is connected</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="167"/> + <location filename="../qml/pages/ManagerPage.qml" line="136"/> <source>Transliterate messages</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="168"/> + <location filename="../qml/pages/ManagerPage.qml" line="137"/> <source>Messages are transliterated to ASCII before sending to Pebble</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="177"/> + <location filename="../qml/pages/ManagerPage.qml" line="146"/> <source>Notifications</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="185"/> + <location filename="../qml/pages/ManagerPage.qml" line="154"/> <source>Messaging</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="186"/> + <location filename="../qml/pages/ManagerPage.qml" line="155"/> <source>SMS and IM</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="195"/> + <location filename="../qml/pages/ManagerPage.qml" line="164"/> <source>Missed call</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="204"/> + <location filename="../qml/pages/ManagerPage.qml" line="173"/> <source>Emails</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="213"/> + <location filename="../qml/pages/ManagerPage.qml" line="182"/> <source>Mitakuuluu</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="222"/> + <location filename="../qml/pages/ManagerPage.qml" line="191"/> <source>Twitter</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="232"/> + <location filename="../qml/pages/ManagerPage.qml" line="201"/> <source>Facebook</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="241"/> + <location filename="../qml/pages/ManagerPage.qml" line="210"/> <source>Other notifications</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/ManagerPage.qml" line="250"/> + <location filename="../qml/pages/ManagerPage.qml" line="219"/> <source>All notifications</source> <translation type="unfinished"></translation> </message> @@ -283,30 +283,46 @@ If it can't be found please check it's available and paired in Bluetoo <context> <name>WatchInfo</name> <message> - <location filename="../qml/pages/WatchInfo.qml" line="41"/> + <location filename="../qml/pages/WatchInfo.qml" line="28"/> <source>Address</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="49"/> + <location filename="../qml/pages/WatchInfo.qml" line="36"/> <source>Serial Number</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="57"/> + <location filename="../qml/pages/WatchInfo.qml" line="44"/> <source>BootLoader</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="65"/> + <location filename="../qml/pages/WatchInfo.qml" line="52"/> + <location filename="../qml/pages/WatchInfo.qml" line="68"/> <source>Firmware</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qml/pages/WatchInfo.qml" line="73"/> + <location filename="../qml/pages/WatchInfo.qml" line="60"/> <source>Recovery</source> <translation type="unfinished"></translation> </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="85"/> + <source>Latest</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="88"/> + <source>unknown</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qml/pages/WatchInfo.qml" line="93"/> + <source>Upgrade Firmware</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>WatchPage</name> diff --git a/daemon/daemon.pro b/daemon/daemon.pro index aca5597..35eb302 100644 --- a/daemon/daemon.pro +++ b/daemon/daemon.pro @@ -51,10 +51,7 @@ HEADERS += \ uploadmanager.h \ stm32crc.h -DBUS_ADAPTORS += ../org.pebbled.Watch.xml - -OTHER_FILES += $$DBUS_ADAPTORS \ - js/typedarray.js +OTHER_FILES += js/typedarray.js DEFINES += QUAZIP_STATIC include(quazip/quazip.pri) diff --git a/org.pebbled.Watch.xml b/org.pebbled.Watch.xml index f125b03..3eae1ab 100644 --- a/org.pebbled.Watch.xml +++ b/org.pebbled.Watch.xml @@ -70,5 +70,11 @@ <annotation name="org.qtproject.QtDBus.QtTypeName" value="QVariantList"/> </property> <signal name="AllAppsChanged"/> + + <!-- Firmware management methods --> + <method name="UploadFirmware"> + <arg name="recovery" type="b" direction="in"/> + <arg name="file" type="s" direction="in"/> + </method> </interface> </node> @@ -1,6 +1,7 @@ TEMPLATE = subdirs SUBDIRS = daemon app OTHER_FILES += \ + org.pebbled.Watch.xml \ README.md \ rpm/pebble.spec \ rpm/pebble.yaml \ |
