[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/piggz/harbour-amazfish.git</param>
<param name="branch">master</param>
- <param name="revision">2.1.3</param>
+ <param name="revision">2.2.0</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-amazfish-2.1.3.tar.bz2/daemon/libwatchfish/voicecallcontroller.cpp
^
|
@@ -1,189 +0,0 @@
-/*
- * libwatchfish - library with common functionality for SailfishOS smartwatch connector programs.
- * Copyright (C) 2016 Javier S. Pedro <dev.git@javispedro.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "voicecallcontroller.h"
-#include "voicecallcontroller_p.h"
-#include <QtContacts/QContactManager>
-#include <QtContacts/QContactDetailFilter>
-#include <QtContacts/QContactPhoneNumber>
-
-namespace watchfish
-{
-
-Q_LOGGING_CATEGORY(voiceCallControllerCat, "watchfish-VoiceCallController")
-
-VoiceCallControllerPrivate::VoiceCallControllerPrivate(VoiceCallController *q)
- : vcm(new OrgNemomobileVoicecallVoiceCallManagerInterface("org.nemomobile.voicecall",
- "/", QDBusConnection::sessionBus(), this)),
- activeCall(0),
- curInCall(false), curRinging(false),
- q_ptr(q)
-{
- QMap<QString, QString> parameters;
- parameters.insert(QString::fromLatin1("mergePresenceChanges"), QString::fromLatin1("false"));
- contacts = new QtContacts::QContactManager("", parameters, this);
-
- numberFilter.setDetailType(QtContacts::QContactDetail::TypePhoneNumber, QtContacts::QContactPhoneNumber::FieldNumber);
- numberFilter.setMatchFlags(QtContacts::QContactFilter::MatchPhoneNumber);
-
- connect(vcm, &OrgNemomobileVoicecallVoiceCallManagerInterface::activeVoiceCallChanged,
- this, &VoiceCallControllerPrivate::handleActiveVoiceCallChanged);
- handleActiveVoiceCallChanged();
-}
-
-VoiceCallControllerPrivate::~VoiceCallControllerPrivate()
-{
- delete activeCall;
-}
-
-void VoiceCallControllerPrivate::handleActiveVoiceCallChanged()
-{
- delete activeCall;
- QString id = vcm->activeVoiceCall();
- qCDebug(voiceCallControllerCat) << "Active voice call changed" << id;
- if (!id.isEmpty()) {
- activeCall = new OrgNemomobileVoicecallVoiceCallInterface("org.nemomobile.voicecall",
- QString("/calls/%1").arg(id), vcm->connection(), this);
- connect(activeCall, &OrgNemomobileVoicecallVoiceCallInterface::statusChanged,
- this, &VoiceCallControllerPrivate::handleActiveVoiceCallStatusChanged);
- connect(activeCall, &OrgNemomobileVoicecallVoiceCallInterface::lineIdChanged,
- this, &VoiceCallControllerPrivate::handleActiveVoiceCallLineIdChanged);
- VoiceCallStatus status = static_cast<VoiceCallStatus>(activeCall->status());
- setCallerId(activeCall->lineId());
- setCallStatus(status);
- qDebug() << "Status of new call:" << status << curCallerId;
- } else {
- activeCall = 0;
- setCallStatus(STATUS_NULL);
- setCallerId(QString());
- }
-}
-
-void VoiceCallControllerPrivate::handleActiveVoiceCallStatusChanged(int status, const QString &statusText)
-{
- qCDebug(voiceCallControllerCat) << "Status changed:" << status << statusText;
- setCallStatus(static_cast<VoiceCallStatus>(status));
-}
-
-void VoiceCallControllerPrivate::handleActiveVoiceCallLineIdChanged(const QString &lineId)
-{
- qCDebug(voiceCallControllerCat) << "LineID changed:" << lineId;
- setCallerId(lineId);
-}
-
-void VoiceCallControllerPrivate::setCallStatus(VoiceCallStatus status)
-{
- Q_Q(VoiceCallController);
- const bool oldInCall = curInCall, oldRinging = curRinging;
- switch (status) {
- case STATUS_INCOMING:
- curInCall = true;
- curRinging = true;
- break;
- case STATUS_ACTIVE:
- case STATUS_HELD:
- case STATUS_DIALING:
- case STATUS_ALERTING:
- case STATUS_WAITING:
- curInCall = true;
- curRinging = false;
- break;
- case STATUS_DISCONNECTED:
- case STATUS_NULL:
- default:
- curInCall = false;
- curRinging = false;
- break;
- }
- if (oldInCall != curInCall) {
- emit q->inCallChanged();
- }
- if (oldRinging != curRinging) {
- emit q->ringingChanged();
- }
-}
-
-void VoiceCallControllerPrivate::setCallerId(const QString &callerId)
-{
- Q_Q(VoiceCallController);
- if (callerId != curCallerId) {
- curCallerId = callerId;
- emit q->callerIdChanged();
- }
-}
-
-VoiceCallController::VoiceCallController(QObject *parent)
- : QObject(parent), d_ptr(new VoiceCallControllerPrivate(this))
-{
-}
-
-VoiceCallController::~VoiceCallController()
-{
- delete d_ptr;
-}
-
-bool VoiceCallController::inCall() const
-{
- Q_D(const VoiceCallController);
- return d->curInCall;
-}
-
-bool VoiceCallController::ringing() const
-{
- Q_D(const VoiceCallController);
- return d->curRinging;
-}
-
-QString VoiceCallController::callerId() const
-{
- Q_D(const VoiceCallController);
- return d->curCallerId;
-}
-
-void VoiceCallController::hangup()
-{
- Q_D(VoiceCallController);
- qDebug() << Q_FUNC_INFO;
- if (d->activeCall) {
- d->activeCall->asyncCall("hangup");
- }
-}
-
-void VoiceCallController::silence()
-{
- Q_D(VoiceCallController);
- qDebug() << Q_FUNC_INFO;
- d->vcm->asyncCall("silenceRingtone");
-}
-
-QString VoiceCallController::findPersonByNumber(const QString &number)
-{
- Q_D(VoiceCallController);
- QString person;
- d->numberFilter.setValue(number);
-
- const QList<QtContacts::QContact> &found = d->contacts->contacts(d->numberFilter);
- if (found.size() > 0) {
- person = found[0].detail(QtContacts::QContactDetail::TypeDisplayLabel).value(0).toString();
- } else {
- person = number;
- }
- return person;
-}
-
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-amazfish-2.1.3.tar.bz2/ui/translations/harbour-amazfish-nl.ts
^
|
@@ -1,637 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1" language="nl_NL">
-<context>
- <name>AbstractDevice</name>
- <message>
- <source>Device doen not support settings</source>
- <translation>Apparaat ondersteunt geen instellingen</translation>
- </message>
-</context>
-<context>
- <name>AddCityDialog</name>
- <message>
- <source>Set Location</source>
- <translation>Locatie instellen</translation>
- </message>
-</context>
-<context>
- <name>Alarm</name>
- <message>
- <source>Enabled</source>
- <translation>Ingeschakeld</translation>
- </message>
- <message>
- <source>Mon</source>
- <translation>Ma</translation>
- </message>
- <message>
- <source>Tue</source>
- <translation>Di</translation>
- </message>
- <message>
- <source>Wed</source>
- <translation>Wo</translation>
- </message>
- <message>
- <source>Thu</source>
- <translation>Do</translation>
- </message>
- <message>
- <source>Fri</source>
- <translation>Vr</translation>
- </message>
- <message>
- <source>Sat</source>
- <translation>Za</translation>
- </message>
- <message>
- <source>Sun</source>
- <translation>Zo</translation>
- </message>
-</context>
-<context>
- <name>AnalysisPage</name>
- <message>
- <source>Download Data</source>
- <translation>Gegevens downloaden</translation>
- </message>
- <message>
- <source>Analysis</source>
- <translation>Analyse</translation>
- </message>
- <message>
- <source>Heartrate</source>
- <translation>Hartslag</translation>
- </message>
- <message>
- <source>Steps</source>
- <translation>Stappen</translation>
- </message>
- <message>
- <source>Intensity</source>
- <translation>Intensiteit</translation>
- </message>
-</context>
-<context>
- <name>BipDevice</name>
- <message>
- <source>Amazfish</source>
- <translation>Amazfish</translation>
- </message>
- <message>
- <source>Connected</source>
- <translation>Verbonden</translation>
- </message>
- <message>
- <source>Phone and watch are connected</source>
- <translation>Telefoon en horloge zijn verbonden</translation>
- </message>
-</context>
-<context>
- <name>BipFirmwarePage</name>
- <message>
- <source>Send file</source>
- <translation>Verstuur bestand</translation>
- </message>
- <message>
- <source>Download File</source>
- <translation>Download bestand</translation>
- </message>
- <message>
- <source>Select a file to download.</source>
- <translation>Selecteer een bestand om te downloaden.</translation>
- </message>
- <message>
- <source>None</source>
- <translation>Geen</translation>
- </message>
- <message>
- <source>Choose File</source>
- <translation>Kies bestand</translation>
- </message>
- <message>
- <source>File type/version: </source>
- <translation>Bestandstype/-versie</translation>
- </message>
-</context>
-<context>
- <name>BipFirmwareService</name>
- <message>
- <source>An operation is currently running, please try later</source>
- <translation>Er is momenteel een bewerking actief. Probeer het later opnieuw.</translation>
- </message>
- <message>
- <source>No file selected</source>
- <translation>Geen bestand geselecteerd</translation>
- </message>
-</context>
-<context>
- <name>DebugInfo</name>
- <message>
- <source>Refresh</source>
- <translation>Verversen</translation>
- </message>
- <message>
- <source>AmazFish</source>
- <translation>AmazFish</translation>
- </message>
- <message>
- <source>Address: </source>
- <translation>Adres: </translation>
- </message>
- <message>
- <source>Serial No: </source>
- <translation>Serienummer: </translation>
- </message>
- <message>
- <source>Hardware Rev: </source>
- <translation>Hardware Revisie: </translation>
- </message>
- <message>
- <source>Software Rev: </source>
- <translation>Software Revisie: </translation>
- </message>
- <message>
- <source>Connection State: </source>
- <translation>Verbindingsstatus: </translation>
- </message>
- <message>
- <source>GPS Ver: </source>
- <translation>GPS Versie: </translation>
- </message>
- <message>
- <source>Test Notification</source>
- <translation>Testmelding</translation>
- </message>
- <message>
- <source>Test Email</source>
- <translation>Test e-mail</translation>
- </message>
- <message>
- <source>Test Call</source>
- <translation>Testoproep</translation>
- </message>
- <message>
- <source>Fetch debug log</source>
- <translation>Foutopsporingslog ophalen</translation>
- </message>
- <message>
- <source>Test Popup</source>
- <translation>Test pop-up</translation>
- </message>
- <message>
- <source>Reboot watch</source>
- <translation>Horloge herstarten</translation>
- </message>
-</context>
-<context>
- <name>DeviceInterface</name>
- <message>
- <source>Device is not valid, it may not be supported</source>
- <translation>Apparaat is niet geldig, mogelijk wordt het niet ondersteund.</translation>
- </message>
-</context>
-<context>
- <name>FirstPage</name>
- <message>
- <source>Debug Info</source>
- <translation>Debug-informatie</translation>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-amazfish-2.1.3.tar.bz2/ui/translations/harbour-amazfish-ui-cz.ts
^
|
@@ -1,478 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1">
-<context>
- <name>Alarm</name>
- <message>
- <source>Enabled</source>
- <translation>Zapnuto</translation>
- </message>
- <message>
- <source>Mon</source>
- <translation>Po</translation>
- </message>
- <message>
- <source>Tue</source>
- <translation>Út</translation>
- </message>
- <message>
- <source>Wed</source>
- <translation>St</translation>
- </message>
- <message>
- <source>Thu</source>
- <translation>Čt</translation>
- </message>
- <message>
- <source>Fri</source>
- <translation>Pá</translation>
- </message>
- <message>
- <source>Sat</source>
- <translation>So</translation>
- </message>
- <message>
- <source>Sun</source>
- <translation>Ne</translation>
- </message>
-</context>
-<context>
- <name>AnalysisPage</name>
- <message>
- <source>Analysis</source>
- <translation>Analýza</translation>
- </message>
- <message>
- <source>Heartrate</source>
- <translation>Puls</translation>
- </message>
- <message>
- <source>Steps</source>
- <translation>Kroky</translation>
- </message>
- <message>
- <source>Intensity</source>
- <translation>Intensita</translation>
- </message>
- <message>
- <source>Download Data</source>
- <translation>Stažení dat</translation>
- </message>
-</context>
-<context>
- <name>BipDevice</name>
- <message>
- <source>Amazfish</source>
- <translation>Amazfish</translation>
- </message>
- <message>
- <source>Connected</source>
- <translation>Připojeno</translation>
- </message>
- <message>
- <source>Phone and watch are connected</source>
- <translation>Telefon a hodinky spárovány</translation>
- </message>
-</context>
-<context>
- <name>BipFirmwarePage</name>
- <message>
- <source>Send file</source>
- <translation>Odeslat soubor</translation>
- </message>
- <message>
- <source>Download File</source>
- <translation>Stáhnout soubor</translation>
- </message>
- <message>
- <source>Select a file to download.</source>
- <translation>Vybrat soubor k stažení</translation>
- </message>
-</context>
-<context>
- <name>BipFirmwareService</name>
- <message>
- <source>An operation is currently running, please try later</source>
- <translation>Běžící operace, opakujte později</translation>
- </message>
- <message>
- <source>No file selected</source>
- <translation>Nebyl vybrán soubor</translation>
- </message>
-</context>
-<context>
- <name>DebugInfo</name>
- <message>
- <source>AmazFish</source>
- <translation>AmazFish</translation>
- </message>
- <message>
- <source>Refresh</source>
- <translation>Оbnovit</translation>
- </message>
-</context>
-<context>
- <name>FirstPage</name>
- <message>
- <source>Pair with watch</source>
- <translation>Párovat s hodinkami</translation>
- </message>
- <message>
- <source>AmazFish</source>
- <translation>AmazFish</translation>
- </message>
- <message>
- <source>Connect to watch</source>
- <translation>Spárovat</translation>
- </message>
- <message>
- <source>Disconnect from watch</source>
- <translation>Zrušit párování</translation>
- </message>
- <message>
- <source>Debug Info</source>
- <translation>Ladění</translation>
- </message>
- <message>
- <source>Settings</source>
- <translation>Nastavení</translation>
- </message>
- <message>
- <source>Download File</source>
- <translation>Stáhnout soubor</translation>
- </message>
-</context>
-<context>
- <name>GraphData</name>
- <message>
- <source>No data</source>
- <translation>Žádná data</translation>
- </message>
-</context>
-<context>
- <name>MiBandService</name>
- <message>
- <source>An operation is currently running, please try later</source>
- <translation>Běžící operace, opakujte později</translation>
- </message>
- <message>
- <source>Firmware is too old to set display items, V0.1.1.14 is required</source>
- <translation>Zastaralý firmware, použijte v0.1.1.14 a vyšší</translation>
- </message>
-</context>
-<context>
- <name>PairPage</name>
- <message>
- <source>Start scan</source>
- <translation>Spustit hledání</translation>
- </message>
- <message>
- <source>Try again</source>
- <translation>Zkuste znova</translation>
- </message>
-</context>
-<context>
- <name>QObject</name>
- <message>
- <source>Finished transferring activity data</source>
- <translation>Přenos dat aktivity ukončen</translation>
- </message>
- <message>
- <source>No data to transfer</source>
- <translation>Žádná data k přenosu</translation>
- </message>
- <message>
- <source>Update operation failed</source>
- <translation>Aktualizace neúspěšná</translation>
- </message>
- <message>
- <source>Update operation failed, unexpected metadata</source>
- <translation>Aktualizace neúspěšná, vadná metadata</translation>
- </message>
- <message>
- <source>Update operation complete</source>
- <translation>Aktualizace úspěšná</translation>
- </message>
- <message>
- <source>File does not seem to be supported</source>
- <translation>Nepodporovaný typ souboru</translation>
- </message>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-amazfish-2.1.3.tar.bz2/ui/translations/harbour-amazfish.ts
^
|
@@ -1,621 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1">
-<context>
- <name>AbstractDevice</name>
- <message>
- <source>Device doen not support settings</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>AddCityDialog</name>
- <message>
- <source>Set Location</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>Alarm</name>
- <message>
- <source>Enabled</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Mon</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Tue</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Wed</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Thu</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Fri</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Sat</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Sun</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>AnalysisPage</name>
- <message>
- <source>Download Data</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Analysis</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Heartrate</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Steps</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Intensity</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>BipDevice</name>
- <message>
- <source>Amazfish</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Connected</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Phone and watch are connected</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>BipFirmwarePage</name>
- <message>
- <source>Send file</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Download File</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Select a file to download.</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>None</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Choose File</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>File type/version: </source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>BipFirmwareService</name>
- <message>
- <source>An operation is currently running, please try later</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>No file selected</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>DebugInfo</name>
- <message>
- <source>Refresh</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>AmazFish</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Address: </source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Serial No: </source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Hardware Rev: </source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Software Rev: </source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Connection State: </source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>GPS Ver: </source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Test Notification</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Test Email</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Test Call</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Fetch debug log</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Test Popup</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Reboot watch</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>DeviceInterface</name>
- <message>
- <source>Device is not valid, it may not be supported</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>FirstPage</name>
- <message>
- <source>Debug Info</source>
- <translation type="unfinished"></translation>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/.github/workflows/sailfishos.yml
^
|
@@ -0,0 +1,38 @@
+name: SailfishOS Build
+
+on: [push, pull_request]
+
+env:
+ OS_VERSION: 4.5.0.16
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ name: Build App
+ strategy:
+ matrix:
+ arch: ['armv7hl', 'aarch64', 'i486']
+
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: recursive
+ - name: Prepare
+ run: docker pull coderus/sailfishos-platform-sdk:$OS_VERSION && mkdir output
+
+ - name: Build ${{ matrix.arch }}
+ run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$OS_VERSION /bin/bash -c "
+ mkdir -p build ;
+ cd build ;
+ cp -r /share/* . ;
+ sb2 -t SailfishOS-$OS_VERSION-${{ matrix.arch }} -R zypper --non-interactive ar --no-gpgcheck http://repo.merproject.org/obs/home:/piggz:/kf5/sailfish_latest_${{ matrix.arch }}/ piggz ;
+ sb2 -t SailfishOS-$OS_VERSION-${{ matrix.arch }} -R zypper --non-interactive refresh ;
+ sb2 -t SailfishOS-$OS_VERSION-${{ matrix.arch }} -R zypper --non-interactive in -y mpris-qt5-devel libkf5archive-devel kcoreaddons-devel kdb-devel libKDb3-3 mkcal-qt5-devel libicu-devel pulseaudio-devel;
+ mb2 -t SailfishOS-$OS_VERSION-${{ matrix.arch }} build ;
+ sudo cp -r RPMS/*.rpm /share/output"
+
+ - name: Upload RPM (${{ matrix.arch }})
+ uses: actions/upload-artifact@v3
+ with:
+ name: rpm-${{ matrix.arch }}
+ path: output
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/.gitignore
^
|
@@ -1 +1,4 @@
harbour-amazfish.pro.user*
+.clickable/
+3rdparty/
+build/
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/README.md
^
|
@@ -9,6 +9,9 @@
* Run `devel-su pkcon refresh`
* Run `devel-su pkcon install harbour-amazfish`
+
+[![OpenStore](https://open-store.io/badges/en_US.svg)](https://open-store.io/app/uk.co.piggz.amazfish)
+
## Supported Devices
There are 3 tiers of supported devices:
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/click/click.pro
^
|
@@ -0,0 +1,44 @@
+# This creates the manifest.json file, it is the description file for the
+# click package.
+
+TEMPLATE = aux
+
+# figure out the current build architecture
+CLICK_ARCH=$$system(dpkg-architecture -qDEB_HOST_ARCH)
+
+# do not remove this line, it is required by the IDE even if you do
+# not substitute variables in the manifest file
+UBUNTU_MANIFEST_FILE = $$PWD/manifest.json.in
+
+
+# substitute the architecture in the manifest file
+manifest_file.output = manifest.json
+manifest_file.CONFIG += no_link \
+ add_inputs_as_makefile_deps\
+ target_predeps
+manifest_file.commands = sed s/@CLICK_ARCH@/$$CLICK_ARCH/g ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
+manifest_file.input = UBUNTU_MANIFEST_FILE
+QMAKE_EXTRA_COMPILERS += manifest_file
+
+# installation path of the manifest file
+mfile.CONFIG += no_check_exist
+mfile.files += $$OUT_PWD/manifest.json
+mfile.path = /
+
+# AppArmor profile
+apparmor.files += $$PWD/harbour-amazfish.apparmor
+apparmor.path = /
+
+# Desktop launcher icon
+desktopicon.files += $$PWD/harbour-amazfish-ui.png
+desktopicon.path = /
+
+# Desktop launcher
+desktop.files += $$PWD/harbour-amazfish-ui.desktop
+desktop.path = /
+
+# Run script
+runscript.files += $$PWD/run.sh
+runscript.path = /
+
+INSTALLS += mfile apparmor runscript desktopicon desktop
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/click/harbour-amazfish-ui.desktop
^
|
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Icon=harbour-amazfish-ui.png
+Exec=run.sh
+Name=Amazfish
+X-Ubuntu-Touch=true
+X-Ubuntu-Splash-Color=#F5F5F5
|
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/click/harbour-amazfish-ui.png
^
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/click/harbour-amazfish.apparmor
^
|
@@ -0,0 +1,6 @@
+{
+ "policy_groups": [
+ ],
+ "policy_version": 20.04,
+ "template": "unconfined"
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/click/manifest.json.in
^
|
@@ -0,0 +1,15 @@
+{
+ "name": "uk.co.piggz.amazfish",
+ "description": "Smart watch sync app",
+ "architecture": "@CLICK_ARCH@",
+ "title": "Amazfish",
+ "hooks": {
+ "harbour-amazfish": {
+ "apparmor": "harbour-amazfish.apparmor",
+ "desktop": "harbour-amazfish-ui.desktop"
+ }
+ },
+ "version": "2.1.3",
+ "maintainer": "Adam Pigg <adam@piggz.co.uk>",
+ "framework" : "ubuntu-sdk-20.04"
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/click/run.sh
^
|
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+UNIT_FILE=$HOME/.config/systemd/user/harbour-amazfish.service
+
+if [ ! -f "$UNIT_FILE" ]; then
+
+ echo "Creating service $UNIT_FILE"
+ mkdir -p "$(dirname "$UNIT_FILE")"
+ cat <<"EOF" > $UNIT_FILE
+[Unit]
+Description=Amazfish daemon
+After=graphical.target
+
+[Service]
+ExecStart=/opt/click.ubuntu.com/uk.co.piggz.amazfish/current/bin/harbour-amazfishd
+Restart=always
+RestartSec=5
+Environment=LD_LIBRARY_PATH=/opt/click.ubuntu.com/uk.co.piggz.amazfish/current/lib:/opt/click.ubuntu.com/uk.co.piggz.amazfish/current/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH
+Environment=HOME=%h XDG_CONFIG_HOME=/home/%u/.config DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus XDG_RUNTIME_DIR=/run/user/%U
+
+[Install]
+WantedBy=default.target
+
+EOF
+
+ /usr/bin/systemctl daemon-reload
+ /usr/bin/systemctl --user enable harbour-amazfish.service
+ /usr/bin/systemctl --user start harbour-amazfish.service
+
+else
+
+ # restart just after reinstall
+
+ mod_time=$(stat --format="%Y" ./bin/harbour-amazfishd)
+ enter_active=$(date -d "$(systemctl show -p ActiveEnterTimestamp --value --user harbour-amazfish)" +%s) #"
+ if [ "$mod_time" -gt "$enter_active" ]; then
+ /usr/bin/systemctl --user restart harbour-amazfish.service
+ fi
+
+fi
+
+export LD_LIBRARY_PATH=$PWD/lib:$PWD/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH
+export QT_QUICK_CONTROLS_MOBILE=true
+export QT_QUICK_CONTROLS_STYLE=Suru
+
+exec $PWD/bin/harbour-amazfish-ui \
+ --desktop_file_hint=${HOME}/.local/share/applications/${APP_ID}.desktop "$@"
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/clickable.yaml
^
|
@@ -0,0 +1,52 @@
+clickable_minimum_required: 8.0.0
+framework: ubuntu-sdk-20.04
+
+prebuild: git submodule update --init
+kill: harbour-amazfish
+ignore_review_errors: true
+
+builder: qmake
+build_args:
+- FLAVOR=uuitk
+- CONFIG+=click
+- INCLUDEPATH+=${QTMPRIS_LIB_INSTALL_DIR}/usr/include/${ARCH_TRIPLET}/qt5/MprisQt
+- INCLUDEPATH+=${QTMPRIS_LIB_INSTALL_DIR}/usr/include/${ARCH_TRIPLET}/qt5
+- LIBS+=-L${QTMPRIS_LIB_INSTALL_DIR}/usr/lib/${ARCH_TRIPLET}
+env_vars:
+ PKG_CONFIG_PATH: ${QTMPRIS_LIB_INSTALL_DIR}/usr/lib/${ARCH_TRIPLET}/pkgconfig:${NEMO_QML_PLUGIN_DBUS_LIB_INSTALL_DIR}/usr/lib/${ARCH_TRIPLET}/pkgconfig
+dependencies_target:
+- libkdb3-driver-sqlite
+- qml-module-org-kde-bluezqt
+- libkdb3-dev
+- libkf5contacts-dev
+- libkf5archive-dev
+- libkf5coreaddons-dev
+- libdbus-1-dev
+- libtelepathy-qt5-dev
+
+libraries:
+ qtmpris:
+ src_dir: 3rdparty/qtmpris
+ prebuild:
+ - mkdir -p ${ROOT}/3rdparty
+ - git -C ${SRC_DIR} pull || git clone https://github.com/sailfishos/qtmpris ${SRC_DIR}
+ builder: qmake
+
+ nemo-qml-plugin-dbus:
+ src_dir: 3rdparty/nemo-qml-plugin-dbus
+ prebuild:
+ - mkdir -p ${ROOT}/3rdparty
+ - git -C ${SRC_DIR} pull || git clone https://github.com/sailfishos/nemo-qml-plugin-dbus ${SRC_DIR}
+ builder: qmake
+
+install_lib:
+- ${NEMO_QML_PLUGIN_DBUS_LIB_INSTALL_DIR}/usr/lib/${ARCH_TRIPLET}/libnemodbus.so*
+- ${QTMPRIS_LIB_INSTALL_DIR}/usr/lib/${ARCH_TRIPLET}/libmpris-qt5.so*
+- /usr/lib/${ARCH_TRIPLET}/libKDb3.so*
+- /usr/lib/${ARCH_TRIPLET}/libKF5BluezQt.so*
+install_data:
+ /usr/lib/${ARCH_TRIPLET}/qt5/plugins/kdb3: bin
+install_qml:
+- ${NEMO_QML_PLUGIN_DBUS_LIB_INSTALL_DIR}/usr/lib/${ARCH_TRIPLET}/qt5/qml/Nemo/DBus
+- ${QTMPRIS_LIB_INSTALL_DIR}/usr/lib/${ARCH_TRIPLET}/qt5/qml/org/nemomobile/mpris
+- /usr/lib/${ARCH_TRIPLET}/qt5/qml/org/kde/bluezqt
|
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/chirp.raw
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/daemon.pro
^
|
@@ -14,8 +14,9 @@
LIBS += -Lqble/qble -L$$OUT_PWD/../lib -lamazfish -lz
PKGCONFIG += dbus-1
+PKGCONFIG += icu-uc icu-io icu-i18n # transliteration
QT += positioning KDb3 network dbus KArchive
-CONFIG += c++17
+CONFIG += c++17 c++1z
equals(FLAVOR, "silica") {
CONFIG += flavor_silica
@@ -32,10 +33,16 @@
flavor_silica {
message(SailfishOS daemon build)
DEFINES += MER_EDITION_SAILFISH
- LIBS += -lkeepalive
+ LIBS += -lkeepalive -lpulse-simple
CONFIG += sailfishapp
CONFIG += link_pkgconfig
- PKGCONFIG += mlite5
+ PKGCONFIG += mlite5 libpulse
+ WATCHFISH_FEATURES += music \
+ voicecall \
+ notificationmonitor \
+ calendar
+} else:flavor_uuitk {
+ DEFINES += UUITK_EDITION
WATCHFISH_FEATURES += music \
voicecall \
notificationmonitor \
@@ -73,6 +80,9 @@
systemd_services.files = $$OUT_PWD/harbour-amazfish.service
systemd_services.CONFIG += no_check_exist
+chirp.path = $$PREFIX/share/harbour-amazfish/
+chirp.files = chirp.raw
+
#Install appropriate files for each system
flavor_silica {
systemd_services.commands = cp $$PWD/harbour-amazfish-sailfish.service.in $$OUT_PWD/harbour-amazfish.service
@@ -87,7 +97,8 @@
}
INSTALLS += target \
- systemd_services
+ systemd_services \
+ chirp
include(libwatchfish/libwatchfish.pri)
include(../qble/qble.pri)
@@ -99,6 +110,7 @@
src/devices/gtr2device.cpp \
src/devices/gtr2firmwareinfo.cpp \
src/devices/gtrdevice.cpp \
+ src/devices/gtrfirmwareinfo.cpp \
src/devices/gts2device.cpp \
src/devices/gts2firmwareinfo.cpp \
src/devices/huamidevice.cpp \
@@ -124,17 +136,21 @@
src/services/infinitimemotionservice.cpp \
src/services/infinitimenavservice.cpp \
src/services/infinitimeweatherservice.cpp \
+ src/services/pinetimesimpleweatherservice.cpp \
src/services/pinetimemusicservice.cpp \
src/services/uartservice.cpp \
src/typeconversion.cpp \
src/bipbatteryinfo.cpp \
src/devicefactory.cpp \
+ src/realtimeactivitysample.cpp \
src/services/mibandservice.cpp \
src/services/miband2service.cpp \
src/services/alertnotificationservice.cpp \
src/services/hrmservice.cpp \
src/services/deviceinfoservice.cpp \
src/services/bipfirmwareservice.cpp \
+ src/services/batteryservice.cpp \
+ src/services/immediatealertservice.cpp \
src/operations/abstractoperation.cpp \
src/operations/activityfetchoperation.cpp \
src/operations/logfetchoperation.cpp \
@@ -152,9 +168,11 @@
src/bipactivitydetailparser.cpp \
src/activitycoordinate.cpp \
src/harbour-amazfish-daemon.cpp \
+ src/transliterator.cpp \
src/huamiweathercondition.cpp
DISTFILES += \
+ chirp.raw \
harbour-amazfish-sailfish.service.in \
harbour-amazfish.service.in \
harbour-amazfishd.privileges
@@ -169,6 +187,7 @@
src/devices/gtr2device.h \
src/devices/gtr2firmwareinfo.h \
src/devices/gtrdevice.h \
+ src/devices/gtrfirmwareinfo.h \
src/devices/gts2device.h \
src/devices/gts2firmwareinfo.h \
src/devices/huamidevice.h \
@@ -194,8 +213,10 @@
src/services/infinitimemotionservice.h \
src/services/infinitimenavservice.h \
src/services/infinitimeweatherservice.h \
+ src/services/pinetimesimpleweatherservice.h \
src/services/pinetimemusicservice.h \
src/services/uartservice.h \
+ src/services/immediatealertservice.h \
src/typeconversion.h \
src/bipbatteryinfo.h \
src/deviceinterface.h \
@@ -205,6 +226,7 @@
src/activitysummary.h \
src/activitysample.h \
src/devicefactory.h \
+ src/realtimeactivitysample.h \
src/services/mibandservice.h \
src/services/miband2service.h \
src/services/alertnotificationservice.h \
@@ -218,6 +240,8 @@
src/operations/updatefirmwareoperation.h \
src/operations/sportsdetailoperation.h \
src/operations/abstractfetchoperation.h \
+ src/services/batteryservice.h \
src/devices/abstractdevice.h \
src/bipactivitydetailparser.h \
+ src/transliterator.h \
src/activitycoordinate.h
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/callchannelobserver.cpp
^
|
@@ -0,0 +1,165 @@
+#include "callchannelobserver.h"
+
+#include <TelepathyQt/Contact>
+#include <TelepathyQt/PendingContactInfo>
+
+#include <QContactFetchRequest>
+#include <QContactPhoneNumber>
+#include <QContactFilter>
+#include <QContactDetail>
+#include <QContactDisplayLabel>
+
+QTCONTACTS_USE_NAMESPACE
+
+TelepathyMonitor::TelepathyMonitor(QObject *parent):
+ QObject(parent)
+{
+ Tp::registerTypes();
+ QTimer::singleShot(0, this, &TelepathyMonitor::accountManagerSetup);
+ m_contactManager = new QContactManager("galera");
+ m_contactManager->setParent(this);
+}
+
+void TelepathyMonitor::hangupCall(uint cookie)
+{
+ if (m_currentCalls.contains(cookie)) {
+ m_currentCalls.value(cookie)->hangup();
+ }
+}
+
+void TelepathyMonitor::accept(uint cookie) {
+ if (m_currentCalls.contains(cookie)) {
+ m_currentCalls.value(cookie)->accept();
+ }
+}
+
+
+void TelepathyMonitor::accountManagerSetup()
+{
+ m_accountManager = Tp::AccountManager::create(Tp::AccountFactory::create(QDBusConnection::sessionBus(),
+ Tp::Account::FeatureCore),
+ Tp::ConnectionFactory::create(QDBusConnection::sessionBus(),
+ Tp::Connection::FeatureCore));
+ connect(m_accountManager->becomeReady(),
+ SIGNAL(finished(Tp::PendingOperation*)),
+ SLOT(accountManagerReady(Tp::PendingOperation*)));
+}
+
+void TelepathyMonitor::accountManagerReady(Tp::PendingOperation* operation)
+{
+ if (operation->isError()) {
+ qDebug() << "TelepathyMonitor: accountManager init error.";
+ QTimer::singleShot(1000, this, &TelepathyMonitor::accountManagerSetup); // again
+ return;
+ }
+ qDebug() << "Telepathy account manager ready";
+
+ foreach (const Tp::AccountPtr& account, m_accountManager->allAccounts()) {
+ connect(account->becomeReady(Tp::Account::FeatureCapabilities),
+ SIGNAL(finished(Tp::PendingOperation*)),
+ SLOT(accountReady(Tp::PendingOperation*)));
+ }
+
+ connect(m_accountManager.data(), SIGNAL(newAccount(Tp::AccountPtr)), SLOT(newAccount(Tp::AccountPtr)));
+}
+
+void TelepathyMonitor::newAccount(const Tp::AccountPtr& account)
+{
+ connect(account->becomeReady(Tp::Account::FeatureCapabilities),
+ SIGNAL(finished(Tp::PendingOperation*)),
+ SLOT(accountReady(Tp::PendingOperation*)));
+}
+
+void TelepathyMonitor::accountReady(Tp::PendingOperation* operation)
+{
+ if (operation->isError()) {
+ qDebug() << "TelepathyAccount: Operation failed (accountReady)";
+ return;
+ }
+
+ Tp::PendingReady* pendingReady = qobject_cast<Tp::PendingReady*>(operation);
+ if (pendingReady == 0) {
+ qDebug() << "Rejecting account because could not understand ready status";
+ return;
+ }
+ checkAndAddAccount(Tp::AccountPtr::qObjectCast(pendingReady->proxy()));
+}
+
+void TelepathyMonitor::onCallStarted(Tp::CallChannelPtr callChannel)
+{
+ m_cookie++;
+ m_currentCalls.insert(m_cookie, callChannel.data());
+ m_currentCallStates.insert(m_cookie, Tp::CallStateInitialising);
+
+ callChannel->becomeReady(Tp::CallChannel::FeatureCallState);
+
+ connect(callChannel.data(), &Tp::CallChannel::callStateChanged, this, &TelepathyMonitor::callStateChanged);
+
+ QString number = callChannel->initiatorContact()->id();
+
+ // try to match the contact info
+ QContactFetchRequest *request = new QContactFetchRequest(this);
+ request->setFilter(QContactPhoneNumber::match(number));
+
+ // lambda function to update the notification
+ QObject::connect(request, &QContactAbstractRequest::stateChanged, [this, request, number](QContactAbstractRequest::State state) {
+ qDebug() << "request returned";
+ if (!request || state != QContactAbstractRequest::FinishedState) {
+ qDebug() << "error fetching contact" << state;
+ return;
+ }
+
+ QContact contact;
+
+ // create the snap decision only after the contact match finishes
+ if (request->contacts().size() > 0) {
+ // use the first match
+ contact = request->contacts().at(0);
+
+ qDebug() << "have contact" << contact.detail<QContactDisplayLabel>().label();
+ emit this->incomingCall(m_cookie, number, contact.detail<QContactDisplayLabel>().label());
+ } else {
+ qDebug() << "unknown contact" << number;
+ emit this->incomingCall(m_cookie, number, QString());
+ }
+ });
+
+ request->setManager(m_contactManager);
+ request->start();
+}
+
+void TelepathyMonitor::callStateChanged(Tp::CallState state)
+{
+ qDebug() << "call state changed1";
+ Tp::CallChannel *channel = qobject_cast<Tp::CallChannel*>(sender());
+ uint cookie = m_currentCalls.key(channel);
+
+ qDebug() << "call state changed2" << state << "cookie:" << cookie;
+
+ switch (state) {
+ case Tp::CallStateActive:
+ emit callStarted(cookie);
+ m_currentCallStates[cookie] = Tp::CallStateActive;
+ break;
+ case Tp::CallStateEnded: {
+ Tp::CallState oldState = m_currentCallStates.value(cookie);
+ emit callEnded(cookie, oldState != Tp::CallStateActive);
+ m_currentCalls.take(cookie);
+ m_currentCallStates.take(cookie);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+void TelepathyMonitor::checkAndAddAccount(const Tp::AccountPtr& account)
+{
+ Tp::ConnectionCapabilities caps = account->capabilities();
+ // TODO: Later on we will need to filter for the right capabilities, and also allow dynamic account detection
+ // Don't check caps for now as a workaround for https://bugs.launchpad.net/ubuntu/+source/media-hub/+bug/1409125
+ // at least until we are able to find out the root cause of it (check rev 107 for the caps check)
+ auto tcm = new TelepathyCallMonitor(account);
+ connect(tcm, &TelepathyCallMonitor::callStarted, this, &TelepathyMonitor::onCallStarted);
+ m_callMonitors.append(tcm);
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/callchannelobserver.h
^
|
@@ -0,0 +1,75 @@
+#ifndef CALLCHANNELOBSERVER_H
+#define CALLCHANNELOBSERVER_H
+
+#include <TelepathyQt/AccountManager>
+#include <TelepathyQt/SimpleCallObserver>
+#include <TelepathyQt/PendingOperation>
+#include <TelepathyQt/PendingReady>
+#include <TelepathyQt/PendingAccount>
+#include <TelepathyQt/CallChannel>
+
+#include <QContactManager>
+
+QTCONTACTS_USE_NAMESPACE
+
+class TelepathyCallMonitor : public QObject
+{
+ Q_OBJECT
+public:
+ TelepathyCallMonitor(const Tp::AccountPtr& account):
+ mAccount(account),
+ mCallObserver(Tp::SimpleCallObserver::create(mAccount, Tp::SimpleCallObserver::CallDirectionIncoming)) {
+ connect(mCallObserver.data(), SIGNAL(callStarted(Tp::CallChannelPtr)), SIGNAL(callStarted(Tp::CallChannelPtr)));
+// connect(mCallObserver.data(), SIGNAL(callEnded(Tp::CallChannelPtr,QString,QString)), SIGNAL(callEnded()));
+// connect(mCallObserver.data(), SIGNAL(streamedMediaCallStarted(Tp::StreamedMediaChannelPtr)), SIGNAL(offHook()));
+// connect(mCallObserver.data(), SIGNAL(streamedMediaCallEnded(Tp::StreamedMediaChannelPtr,QString,QString)), SIGNAL(onHook()));
+ }
+
+signals:
+ void callStarted(Tp::CallChannelPtr callChannel);
+// void callEnded();
+
+private:
+ Tp::AccountPtr mAccount;
+ Tp::SimpleCallObserverPtr mCallObserver;
+};
+
+class TelepathyMonitor: public QObject
+{
+ Q_OBJECT
+public:
+ TelepathyMonitor(QObject *parent = 0);
+
+ void hangupCall(uint cookie);
+ void accept(uint cookie);
+
+private slots:
+ void accountManagerSetup();
+ void accountManagerReady(Tp::PendingOperation* operation);
+
+ void newAccount(const Tp::AccountPtr& account);
+ void accountReady(Tp::PendingOperation* operation);
+
+ void onCallStarted(Tp::CallChannelPtr callChannel);
+ void callStateChanged(Tp::CallState state);
+
+signals:
+ void incomingCall(uint cookie, const QString &number, const QString &name);
+ void callStarted(uint cookie);
+ void callEnded(uint cookie, bool missed);
+
+private:
+ void checkAndAddAccount(const Tp::AccountPtr& account);
+
+private:
+ Tp::AccountManagerPtr m_accountManager;
+ QList<TelepathyCallMonitor*> m_callMonitors;
+ QContactManager *m_contactManager;
+
+ QHash<uint, Tp::CallChannel*> m_currentCalls;
+ QHash<uint, Tp::CallState> m_currentCallStates;
+
+ uint m_cookie = 0;
+};
+
+#endif // CALLCHANNELOBSERVER_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/libwatchfish.pri
^
|
@@ -41,9 +41,20 @@
}
contains(WATCHFISH_FEATURES, voicecall) {
- HEADERS += $$PWD/voicecallcontroller.h $$PWD/voicecallcontroller_p.h
- SOURCES += $$PWD/voicecallcontroller.cpp
- DBUS_INTERFACES += $$PWD/org.nemomobile.voicecall.VoiceCallManager.xml $$PWD/org.nemomobile.voicecall.VoiceCall.xml
+
+ equals(FLAVOR, "silica") {
+ HEADERS += $$PWD/voicecallcontroller_sailfish.h $$PWD/voicecallcontroller.h $$PWD/voicecallcontroller_p.h $$PWD/voicecallcontrollerbase.h
+ SOURCES += $$PWD/voicecallcontroller_sailfish.cpp $$PWD/voicecallcontrollerbase.cpp
+ DBUS_INTERFACES += $$PWD/org.nemomobile.voicecall.VoiceCallManager.xml $$PWD/org.nemomobile.voicecall.VoiceCall.xml
+ DEFINES += MER_EDITION_SAILFISH
+ } else {
+ HEADERS += $$PWD/voicecallcontroller.h $$PWD/voicecallcontroller_ubuntu.h $$PWD/callchannelobserver.h $$PWD/voicecallcontrollerbase.h
+ SOURCES += $$PWD/voicecallcontroller_ubuntu.cpp $$PWD/callchannelobserver.cpp $$PWD/voicecallcontrollerbase.cpp
+ INCLUDEPATH += /usr/include/telepathy-qt5/
+ LIBS += -ltelepathy-qt5
+ QT += contacts
+ DEFINES += UUITK_EDITION
+ }
}
contains (WATCHFISH_FEATURES, volume) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/notificationmonitor.cpp
^
|
@@ -16,10 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QMessageLogger>
#include <QtCore/QSettings>
#include <QtCore/QSocketNotifier>
+#include <QRegularExpression>
#include "notification.h"
#include "notificationmonitor.h"
@@ -258,6 +260,16 @@
}
}
+#ifdef UUITK_EDITION
+ proto.appId = proto.appName;
+ proto.appName = getAppName(proto.appId);
+ if (proto.appName.isEmpty()) {
+ proto.appName = proto.appId;
+ }
+
+#endif
+
+
// Lookup category info and merge it with the notification info if found.
if (hints.contains("category")) {
proto.hints = getCategoryInfo(hints["category"]);
@@ -305,7 +317,12 @@
_appNameCache[id].lastCheckTime.secsTo(QDateTime::currentDateTime()) > DESKTOP_REFRESH_CHECK_TIME;
if (needs_check) {
AppNameCacheEntry &entry = _appNameCache[id];
+#ifdef UUITK_EDITION
+ QString new_id = guessAppId(id);
+ QFileInfo finfo(QString("%1/%2.desktop").arg(DESKTOP_FILE_DIRECTORY, new_id));
+#else
QFileInfo finfo(QString("%1/%2.desktop").arg(DESKTOP_FILE_DIRECTORY, id));
+#endif
if (finfo.exists()) {
if (!in_cache || finfo.lastModified() > entry.lastReadTime) {
QSettings settings(finfo.absoluteFilePath(), QSettings::IniFormat);
@@ -324,6 +341,24 @@
}
}
+QString NotificationMonitorPrivate::guessAppId(const QString &id) const
+{
+#ifdef UUITK_EDITION
+ QDir directory(DESKTOP_FILE_DIRECTORY);
+
+ QString pattern = QRegularExpression::wildcardToRegularExpression(QString("%1_*.desktop").arg(id));
+ QRegularExpression regex(pattern, QRegularExpression::CaseInsensitiveOption);
+
+ foreach (const QString &fileName, directory.entryList()) {
+ if (regex.match(fileName).hasMatch()) {
+ QString extractedId = fileName.left(fileName.length() - QString(".desktop").length());
+ return extractedId;
+ }
+ }
+#endif
+ return id;
+}
+
dbus_bool_t NotificationMonitorPrivate::busWatchAdd(DBusWatch *watch, void *data)
{
NotificationMonitorPrivate *self = static_cast<NotificationMonitorPrivate*>(data);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/notificationmonitor_p.h
^
|
@@ -9,7 +9,13 @@
#define CATEGORY_DEFINITION_FILE_DIRECTORY "/usr/share/lipstick/notificationcategories"
#define CATEGORY_REFRESH_CHECK_TIME 120
-#define DESKTOP_FILE_DIRECTORY "/usr/share/applications"
+
+#if defined(UUITK_EDITION)
+ #define DESKTOP_FILE_DIRECTORY "/home/phablet/.local/share/applications"
+#else // defined(MER_EDITION_SAILFISH) // and others
+ #define DESKTOP_FILE_DIRECTORY "/usr/share/applications"
+#endif
+
#define DESKTOP_REFRESH_CHECK_TIME 120
namespace watchfish
@@ -67,6 +73,7 @@
QHash<QString,QString> getCategoryInfo(const QString &s) const;
QString getAppName(const QString &id) const;
+ QString guessAppId(const QString &id) const;
static dbus_bool_t busWatchAdd(DBusWatch *watch, void *data);
static void busWatchRemove(DBusWatch *watch, void *data);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/voicecallcontroller.h
^
|
@@ -19,45 +19,11 @@
#ifndef WATCHFISH_VOICECALLCONTROLLER_H
#define WATCHFISH_VOICECALLCONTROLLER_H
-#include <QtCore/QLoggingCategory>
+#if defined(UUITK_EDITION)
+ #include "voicecallcontroller_ubuntu.h"
+#elif defined(MER_EDITION_SAILFISH)
+ #include "voicecallcontroller_sailfish.h"
+#endif
-namespace watchfish
-{
-
-Q_DECLARE_LOGGING_CATEGORY(voiceCallControllerCat)
-
-class VoiceCallControllerPrivate;
-
-class VoiceCallController : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(VoiceCallController)
-
- Q_PROPERTY(bool inCall READ inCall NOTIFY inCallChanged)
- Q_PROPERTY(bool ringing READ ringing NOTIFY ringingChanged)
- Q_PROPERTY(QString callerId READ callerId NOTIFY callerIdChanged)
-
-public:
- explicit VoiceCallController(QObject *parent = 0);
- ~VoiceCallController();
-
- bool inCall() const;
- bool ringing() const;
-
- QString callerId() const;
- void hangup();
- void silence();
- QString findPersonByNumber(const QString &number);
-
-signals:
- void inCallChanged();
- void ringingChanged();
- void callerIdChanged();
-
-private:
- VoiceCallControllerPrivate * const d_ptr;
-};
-
-}
#endif // WATCHFISH_VOICECALLCONTROLLER_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/voicecallcontroller_sailfish.cpp
^
|
@@ -0,0 +1,201 @@
+/*
+ * libwatchfish - library with common functionality for SailfishOS smartwatch connector programs.
+ * Copyright (C) 2016 Javier S. Pedro <dev.git@javispedro.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "voicecallcontroller.h"
+#include "voicecallcontroller_p.h"
+#include "voicecallcontrollerbase.h"
+
+#include <QtContacts/QContactManager>
+#include <QtContacts/QContactDetailFilter>
+#include <QtContacts/QContactPhoneNumber>
+
+namespace watchfish
+{
+
+VoiceCallControllerPrivate::VoiceCallControllerPrivate(VoiceCallController *q)
+ : vcm(new OrgNemomobileVoicecallVoiceCallManagerInterface("org.nemomobile.voicecall",
+ "/", QDBusConnection::sessionBus(), this)),
+ activeCall(0),
+ curInCall(false), curRinging(false),
+ q_ptr(q)
+{
+ QMap<QString, QString> parameters;
+ parameters.insert(QString::fromLatin1("mergePresenceChanges"), QString::fromLatin1("false"));
+ contacts = new QtContacts::QContactManager("", parameters, this);
+
+ numberFilter.setDetailType(QtContacts::QContactDetail::TypePhoneNumber, QtContacts::QContactPhoneNumber::FieldNumber);
+ numberFilter.setMatchFlags(QtContacts::QContactFilter::MatchPhoneNumber);
+
+ connect(vcm, &OrgNemomobileVoicecallVoiceCallManagerInterface::activeVoiceCallChanged,
+ this, &VoiceCallControllerPrivate::handleActiveVoiceCallChanged);
+ handleActiveVoiceCallChanged();
+}
+
+VoiceCallControllerPrivate::~VoiceCallControllerPrivate()
+{
+ delete activeCall;
+}
+
+void VoiceCallControllerPrivate::handleActiveVoiceCallChanged()
+{
+ delete activeCall;
+ QString id = vcm->activeVoiceCall();
+ qCDebug(voiceCallControllerCat) << "Active voice call changed" << id;
+ if (!id.isEmpty()) {
+ activeCall = new OrgNemomobileVoicecallVoiceCallInterface("org.nemomobile.voicecall",
+ QString("/calls/%1").arg(id), vcm->connection(), this);
+ connect(activeCall, &OrgNemomobileVoicecallVoiceCallInterface::statusChanged,
+ this, &VoiceCallControllerPrivate::handleActiveVoiceCallStatusChanged);
+ connect(activeCall, &OrgNemomobileVoicecallVoiceCallInterface::lineIdChanged,
+ this, &VoiceCallControllerPrivate::handleActiveVoiceCallLineIdChanged);
+ VoiceCallStatus status = static_cast<VoiceCallStatus>(activeCall->status());
+ setCallerId(activeCall->lineId());
+ setCallStatus(status);
+ qDebug() << "Status of new call:" << status << curCallerId;
+ } else {
+ activeCall = 0;
+ setCallStatus(STATUS_NULL);
+ setCallerId(QString());
+ }
+}
+
+void VoiceCallControllerPrivate::handleActiveVoiceCallStatusChanged(int status, const QString &statusText)
+{
+ qCDebug(voiceCallControllerCat) << "Status changed:" << status << statusText;
+ setCallStatus(static_cast<VoiceCallStatus>(status));
+}
+
+void VoiceCallControllerPrivate::handleActiveVoiceCallLineIdChanged(const QString &lineId)
+{
+ qCDebug(voiceCallControllerCat) << "LineID changed:" << lineId;
+ setCallerId(lineId);
+}
+
+void VoiceCallControllerPrivate::setCallStatus(VoiceCallStatus status)
+{
+ Q_Q(VoiceCallController);
+ const bool oldInCall = curInCall, oldRinging = curRinging;
+ switch (status) {
+ case STATUS_INCOMING:
+ curInCall = true;
+ curRinging = true;
+ break;
+ case STATUS_ACTIVE:
+ case STATUS_HELD:
+ case STATUS_DIALING:
+ case STATUS_ALERTING:
+ case STATUS_WAITING:
+ curInCall = true;
+ curRinging = false;
+ break;
+ case STATUS_DISCONNECTED:
+ case STATUS_NULL:
+ default:
+ curInCall = false;
+ curRinging = false;
+ break;
+ }
+ if (oldInCall != curInCall) {
+ emit q->inCallChanged();
+ }
+ if (oldRinging != curRinging) {
+ emit q->ringingChanged();
+ }
+}
+
+void VoiceCallControllerPrivate::setCallerId(const QString &callerId)
+{
+ Q_Q(VoiceCallController);
+ if (callerId != curCallerId) {
+ curCallerId = callerId;
+ emit q->callerIdChanged();
+ }
+}
+
+VoiceCallController::VoiceCallController(QObject *parent)
+ : VoiceCallControllerBase(parent), d_ptr(new VoiceCallControllerPrivate(this))
+{
+}
+
+VoiceCallController::~VoiceCallController()
+{
+ delete d_ptr;
+}
+
+bool VoiceCallController::inCall() const
+{
+ Q_D(const VoiceCallController);
+ return d->curInCall;
+}
+
+bool VoiceCallController::ringing() const
+{
+ Q_D(const VoiceCallController);
+ return d->curRinging;
+}
+
+QString VoiceCallController::callerId() const
+{
+ Q_D(const VoiceCallController);
+ return d->curCallerId;
+}
+
+void VoiceCallController::answer()
+{
+ Q_D(VoiceCallController);
+ qDebug() << Q_FUNC_INFO;
+ if (d->activeCall) {
+ d->activeCall->asyncCall("answer");
+ }
+}
+
+
+void VoiceCallController::hangup()
+{
+ Q_D(VoiceCallController);
+ qDebug() << Q_FUNC_INFO;
+ if (d->activeCall) {
+ d->activeCall->asyncCall("hangup");
+ }
+}
+
+void VoiceCallController::silence()
+{
+ Q_D(VoiceCallController);
+ qDebug() << Q_FUNC_INFO;
+ d->vcm->asyncCall("silenceRingtone");
+}
+
+
+QString VoiceCallController::findPersonByNumber(const QString &number)
+{
+ Q_D(VoiceCallController);
+ QString person;
+ d->numberFilter.setValue(number);
+
+ const QList<QtContacts::QContact> &found = d->contacts->contacts(d->numberFilter);
+ if (found.size() > 0) {
+ person = found[0].detail(QtContacts::QContactDetail::TypeDisplayLabel).value(0).toString();
+ } else {
+ person = number;
+ }
+ return person;
+}
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/voicecallcontroller_sailfish.h
^
|
@@ -0,0 +1,57 @@
+/*
+ * libwatchfish - library with common functionality for SailfishOS smartwatch connector programs.
+ * Copyright (C) 2016 Javier S. Pedro <dev.git@javispedro.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef WATCHFISH_VOICECALLCONTROLLER_SAILFISH_H
+#define WATCHFISH_VOICECALLCONTROLLER_SAILFISH_H
+
+#include <QtCore/QLoggingCategory>
+#include "voicecallcontrollerbase.h"
+
+namespace watchfish
+{
+
+Q_DECLARE_LOGGING_CATEGORY(voiceCallControllerCat)
+
+class VoiceCallControllerPrivate;
+
+class VoiceCallController : public VoiceCallControllerBase
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(VoiceCallController)
+
+public:
+ explicit VoiceCallController(QObject *parent = 0);
+ ~VoiceCallController();
+
+ virtual bool inCall() const override;
+ virtual bool ringing() const override;
+ virtual QString callerId() const override;
+
+ virtual void hangup() override;
+ virtual void silence() override;
+ virtual void answer() override;
+ virtual QString findPersonByNumber(const QString &number) override;
+
+private:
+ VoiceCallControllerPrivate * const d_ptr;
+};
+
+} // namespace
+
+
+#endif // WATCHFISH_VOICECALLCONTROLLER_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/voicecallcontroller_ubuntu.cpp
^
|
@@ -0,0 +1,107 @@
+/*
+ * libwatchfish - library with common functionality for SailfishOS smartwatch connector programs.
+ * Copyright (C) 2016 Javier S. Pedro <dev.git@javispedro.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "voicecallcontroller.h"
+#include "callchannelobserver.h"
+#include "voicecallcontrollerbase.h"
+
+#include <QDBusConnection>
+#include <QDBusConnectionInterface>
+#include <QDebug>
+
+namespace watchfish
+{
+
+VoiceCallController::VoiceCallController(QObject *parent): VoiceCallControllerBase(parent)
+{
+
+ // Calls
+ m_telepathyMonitor = new TelepathyMonitor(this);
+ connect(m_telepathyMonitor, &TelepathyMonitor::incomingCall, this, &VoiceCallController::incomingCall);
+ connect(m_telepathyMonitor, &TelepathyMonitor::callStarted, this, &VoiceCallController::callStarted);
+ connect(m_telepathyMonitor, &TelepathyMonitor::callEnded, this, &VoiceCallController::callEnded);
+}
+
+QString VoiceCallController::findPersonByNumber(const QString &number) {
+ if ((m_callerId == number) && m_callerName != "") {
+ return m_callerName;
+ }
+ return number;
+}
+
+void VoiceCallController::incomingCall(uint cookie, const QString &number, const QString &name) {
+ m_lastCookie = cookie;
+ m_callerId = number;
+ m_callerName = name;
+
+ m_ringing = true;
+ m_inCall = true;
+ emit inCallChanged();
+ emit ringingChanged();
+ emit callerIdChanged();
+}
+
+bool VoiceCallController::inCall() const {
+ return m_inCall;
+}
+
+bool VoiceCallController::ringing() const {
+ return m_ringing;
+}
+
+QString VoiceCallController::callerId() const {
+ return m_callerId;
+}
+
+void VoiceCallController::answer() {
+ m_telepathyMonitor->accept(m_lastCookie);
+ m_ringing = false;
+ m_inCall = true;
+ emit inCallChanged();
+ emit ringingChanged();
+}
+
+void VoiceCallController::hangup() {
+ hangupCall(m_lastCookie);
+}
+
+void VoiceCallController::callStarted(uint cookie) {
+ m_lastCookie = cookie;
+ m_ringing = false;
+ m_inCall = true;
+ emit inCallChanged();
+ emit ringingChanged();
+}
+
+void VoiceCallController::callEnded(uint cookie, bool missed) {
+ m_lastCookie = cookie;
+ m_ringing = false;
+ m_inCall = false;
+ emit inCallChanged();
+ emit ringingChanged();
+}
+
+void VoiceCallController::hangupCall(uint cookie) {
+ m_telepathyMonitor->hangupCall(cookie);
+ m_ringing = false;
+ m_inCall = false;
+ emit inCallChanged();
+ emit ringingChanged();
+}
+
+} // namespace
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/voicecallcontroller_ubuntu.h
^
|
@@ -0,0 +1,65 @@
+/*
+ * libwatchfish - library with common functionality for SailfishOS smartwatch connector programs.
+ * Copyright (C) 2016 Javier S. Pedro <dev.git@javispedro.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef WATCHFISH_VOICECALLCONTROLLER_UBUNTU_H
+#define WATCHFISH_VOICECALLCONTROLLER_UBUNTU_H
+
+#include <QtCore/QLoggingCategory>
+#include <TelepathyQt/AbstractClientObserver>
+#include "voicecallcontrollerbase.h"
+
+class TelepathyMonitor;
+
+namespace watchfish
+{
+
+
+class VoiceCallController : public VoiceCallControllerBase
+{
+ Q_OBJECT
+
+public:
+ VoiceCallController(QObject *parent = 0);
+ void hangupCall(uint cookie);
+
+ virtual bool inCall() const override;
+ virtual bool ringing() const override;
+
+ virtual QString callerId() const override;
+ virtual void hangup() override;
+// virtual void silence() override;
+ virtual void answer() override;
+ virtual QString findPersonByNumber(const QString &number) override;
+
+private slots:
+ void incomingCall(uint cookie, const QString &number, const QString &name);
+ void callStarted(uint cookie);
+ void callEnded(uint cookie, bool missed);
+
+private:
+ TelepathyMonitor *m_telepathyMonitor;
+ uint m_lastCookie;
+ bool m_inCall;
+ bool m_ringing;
+ QString m_callerId;
+ QString m_callerName;
+};
+
+} // namespace
+
+#endif // WATCHFISH_VOICECALLCONTROLLER_UBUNTU_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/voicecallcontrollerbase.cpp
^
|
@@ -0,0 +1,61 @@
+/*
+ * libwatchfish - library with common functionality for SailfishOS smartwatch connector programs.
+ * Copyright (C) 2016 Javier S. Pedro <dev.git@javispedro.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "voicecallcontrollerbase.h"
+#include <QString>
+#include <QtCore/QLoggingCategory>
+
+namespace watchfish
+{
+
+Q_LOGGING_CATEGORY(voiceCallControllerCat, "watchfish-VoiceCallController")
+
+
+VoiceCallControllerBase::VoiceCallControllerBase(QObject *parent): QObject(parent) {
+}
+
+VoiceCallControllerBase::~VoiceCallControllerBase() {
+}
+
+bool VoiceCallControllerBase::inCall() const
+{
+ return false;
+}
+
+bool VoiceCallControllerBase::ringing() const
+{
+ return false;
+}
+
+QString VoiceCallControllerBase::callerId() const {
+ return QString();
+}
+
+void VoiceCallControllerBase::hangup() {
+}
+void VoiceCallControllerBase::silence() {
+}
+void VoiceCallControllerBase::answer() {
+}
+
+QString VoiceCallControllerBase::findPersonByNumber(const QString &number) {
+ return number;
+}
+
+} // namespace
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/libwatchfish/voicecallcontrollerbase.h
^
|
@@ -0,0 +1,62 @@
+/*
+ * libwatchfish - library with common functionality for SailfishOS smartwatch connector programs.
+ * Copyright (C) 2016 Javier S. Pedro <dev.git@javispedro.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef WATCHFISH_VOICECALLCONTROLLER_BASE_H
+#define WATCHFISH_VOICECALLCONTROLLER_BASE_H
+
+#include <QObject>
+#include <QString>
+#include <QtCore/QLoggingCategory>
+
+namespace watchfish
+{
+
+Q_DECLARE_LOGGING_CATEGORY(voiceCallControllerCat)
+
+class VoiceCallControllerBase : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool inCall READ inCall NOTIFY inCallChanged)
+ Q_PROPERTY(bool ringing READ ringing NOTIFY ringingChanged)
+ Q_PROPERTY(QString callerId READ callerId NOTIFY callerIdChanged)
+
+public:
+ explicit VoiceCallControllerBase(QObject *parent = 0);
+ ~VoiceCallControllerBase();
+
+ virtual bool inCall() const;
+ virtual bool ringing() const;
+
+ virtual QString callerId() const;
+
+ virtual void hangup();
+ virtual void silence();
+ virtual void answer();
+ virtual QString findPersonByNumber(const QString &number);
+
+signals:
+ void inCallChanged();
+ void ringingChanged();
+ void callerIdChanged();
+
+};
+
+} // namespace
+
+#endif // WATCHFISH_VOICECALLCONTROLLER_BASE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/dbushrm.cpp
^
|
@@ -3,7 +3,7 @@
DBusHRM::DBusHRM(QObject *parent) : QObject(parent)
{
- qDebug() << "Creating DBUS HRM";
+ qDebug() << Q_FUNC_INFO;
if (!QDBusConnection::sessionBus().registerService("org.sailfishos.heartrate")) {
qDebug() << QDBusConnection::sessionBus().lastError().message();
@@ -14,22 +14,19 @@
void DBusHRM::setHRMService(HRMService *hrm)
{
- qDebug() << "Assigning HRM";
-
+ qDebug() << Q_FUNC_INFO;
m_hrm = hrm;
}
-void DBusHRM::setMiBandService(MiBandService *mi)
+void DBusHRM::setDevice(AbstractDevice *dev)
{
- qDebug() << "Assigning MI";
-
- m_mi = mi;
+ qDebug() << Q_FUNC_INFO;
+ m_device = dev;
}
void DBusHRM::start()
{
- qDebug() << "Starting DBUS HRM" << m_hrm;
-
+ qDebug() << Q_FUNC_INFO;
if (m_hrm) {
return m_hrm->enableRealtimeHRMeasurement(true);
}
@@ -37,8 +34,7 @@
void DBusHRM::stop()
{
- qDebug() << "Stopping DBUS HRM" << m_hrm;
-
+ qDebug() << Q_FUNC_INFO;
if (m_hrm) {
return m_hrm->enableRealtimeHRMeasurement(false);
}
@@ -46,7 +42,7 @@
int DBusHRM::heartRate()
{
- qDebug() << "Getting heartrate" << m_hrm->heartRate();
+ qDebug() << Q_FUNC_INFO << m_hrm->heartRate();
if (m_hrm) {
m_hrm->keepRealtimeHRMMeasurementAlive();
@@ -57,8 +53,8 @@
int DBusHRM::batteryLevel()
{
- if (m_mi) {
- return m_mi->batteryInfo();
+ if (m_device) {
+ return m_device->information(AbstractDevice::INFO_BATTERY).toInt();
}
return 0;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/dbushrm.h
^
|
@@ -3,7 +3,7 @@
#include <QObject>
#include "services/hrmservice.h"
-#include "services/mibandservice.h"
+#include "abstractdevice.h"
class DBusHRM : public QObject
{
@@ -12,7 +12,7 @@
public:
explicit DBusHRM(QObject *parent = nullptr);
void setHRMService(HRMService *hrm);
- void setMiBandService(MiBandService *mi);
+ void setDevice(AbstractDevice *dev);
public Q_SLOTS:
void start();
@@ -22,7 +22,7 @@
private:
HRMService *m_hrm = nullptr;
- MiBandService *m_mi = nullptr;
+ AbstractDevice *m_device = nullptr;
};
#endif // DBUSHRM_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/deviceinterface.cpp
^
|
@@ -1,19 +1,24 @@
#include "deviceinterface.h"
#include "deviceinfoservice.h"
-#include "mibandservice.h"
-#include "miband2service.h"
#include "alertnotificationservice.h"
#include "hrmservice.h"
#include "bipfirmwareservice.h"
#include "devicefactory.h"
#include "amazfishconfig.h"
+#include "transliterator.h"
#include <QDir>
#include <QFile>
#include <QProcess>
#include <KDb3/KDbDriverManager>
+#include <KDb3/KDbTransactionGuard>
+
+#ifdef MER_EDITION_SAILFISH
+#include <pulse/simple.h>
+#include <pulse/error.h>
+#endif
static const char *SERVICE = SERVICE_NAME_AMAZFISH;
static const char *PATH = "/application";
@@ -46,7 +51,7 @@
connect(&m_notificationMonitor, &watchfish::NotificationMonitor::notification, this, &DeviceInterface::onNotification);
// Calls
-#ifdef MER_EDITION_SAILFISH
+#if defined(MER_EDITION_SAILFISH) || defined(UUITK_EDITION)
connect(&m_voiceCallController, &watchfish::VoiceCallController::ringingChanged, this, &DeviceInterface::onRingingChanged);
#endif
//Weather
@@ -62,6 +67,10 @@
m_refreshTimer->start(60000);
m_lastWeatherSync = m_lastCalendarSync = m_lastActivitySync = QDateTime::currentDateTime();
+ //Find device playback timer
+ m_findDeviceTimer = new QTimer();
+ connect(m_findDeviceTimer, &QTimer::timeout, this, &DeviceInterface::findDevice);
+
//Music
connect(&m_musicController, &watchfish::MusicController::statusChanged, this, &DeviceInterface::musicChanged);
connect(&m_musicController, &watchfish::MusicController::titleChanged, this, &DeviceInterface::musicChanged);
@@ -144,11 +153,6 @@
return m_device->connectionState();
}
-MiBandService *DeviceInterface::miBandService() const
-{
- return qobject_cast<MiBandService*>(m_device->service(MiBandService::UUID_SERVICE_MIBAND));
-}
-
HRMService *DeviceInterface::hrmService() const
{
return qobject_cast<HRMService*>(m_device->service(HRMService::UUID_SERVICE_HRM));
@@ -158,7 +162,7 @@
{
if (m_device && m_device->connectionState() == "authenticated" && m_device->supportsFeature(AbstractDevice::FEATURE_ALERT)){
qDebug() << "Sending alert to device";
- m_device->sendAlert(notification->appName(), notification->summary(), notification->body());
+ sendAlert(notification->appName(), notification->summary(), notification->body());
} else {
qDebug() << "no notification service, buffering notification";
@@ -177,7 +181,7 @@
void DeviceInterface::onRingingChanged()
{
-#ifdef MER_EDITION_SAILFISH
+#if defined(MER_EDITION_SAILFISH) || defined(UUITK_EDITION)
qDebug() << Q_FUNC_INFO << m_voiceCallController.ringing();
if (!m_device) {
@@ -185,7 +189,15 @@
}
if (m_voiceCallController.ringing()) {
- m_device->incomingCall(m_voiceCallController.findPersonByNumber(m_voiceCallController.callerId()));
+
+ QString caller = m_voiceCallController.findPersonByNumber(m_voiceCallController.callerId());
+
+ if (AmazfishConfig::instance()->appTransliterate()) {
+ m_device->incomingCall( Transliterator::convert( caller ) );
+ } else {
+ m_device->incomingCall(caller);
+ }
+
} else {
if (m_device->service("00001802-0000-1000-8000-00805f9b34fb")){
m_device->service("00001802-0000-1000-8000-00805f9b34fb")->writeValue("00002a06-0000-1000-8000-00805f9b34fb", QByteArray(1, 0x00)); //TODO properly abstract immediate notification service
@@ -238,6 +250,39 @@
}
+ if (!m_conn->containsTable("info_log")) {
+ KDbTableSchema *t_info = new KDbTableSchema("info_log");
+ t_info->setCaption("Info log");
+ t_info->addField(f = new KDbField("id", KDbField::Integer, KDbField::PrimaryKey | KDbField::AutoInc, KDbField::Unsigned));
+ f->setCaption("ID");
+ t_info->addField(f = new KDbField("timestamp", KDbField::Integer, nullptr));
+ f->setCaption("Timestamp");
+ t_info->addField(f = new KDbField("timestamp_dt", KDbField::DateTime));
+ f->setCaption("Timestamp in Date/Time format");
+ t_info->addField(f = new KDbField("key", KDbField::Integer, nullptr, KDbField::Unsigned));
+ f->setCaption("Key based on AbstractDevice::Info");
+ t_info->addField(f = new KDbField("value", KDbField::Integer, nullptr, KDbField::Unsigned));
+ f->setCaption("Value");
+
+ if (!m_conn->createTable(t_info)) {
+ qDebug() << m_conn->result();
+ return;
+ }
+ qDebug() << "-- info_log created --";
+ qDebug() << *t_info;
+ }
+
+ int batteryLevel = 0;
+
+ if (m_conn->querySingleNumber(
+ KDbEscapedString("SELECT value FROM info_log WHERE key = %1 ORDER BY id DESC").arg(AbstractDevice::INFO_BATTERY), // automatically adds LIMIT 1 into query
+ &batteryLevel) == true) { // comparision of tristate type (true, false, canceled)
+ m_lastBatteryLevel = batteryLevel;
+ qDebug() << "Last Battery Level: " << m_lastBatteryLevel;
+ } else {
+ qWarning() << "Cannot get battery level";
+ }
+
if (!m_conn->containsTable("sports_data")) {
KDbTableSchema *t_summary = new KDbTableSchema("sports_data");
t_summary->setCaption("Sports Data");
@@ -388,9 +433,9 @@
qDebug() << "DeviceInterface::onConnectionStateChanged" << connectionState();
if (connectionState() == "authenticated") {
- if (miBandService()) {
- miBandService()->setDatabase(dbConnection());
- m_dbusHRM->setMiBandService(miBandService());
+ m_device->setDatabase(dbConnection());
+ if (m_device) {
+ m_dbusHRM->setDevice(m_device);
}
if (hrmService()) {
m_dbusHRM->setHRMService(hrmService());
@@ -408,17 +453,62 @@
emit connectionStateChanged();
}
+void DeviceInterface::log_battery_level(int level) {
+
+ if (!m_conn || !(m_conn->isDatabaseUsed())) {
+ qDebug() << "Database not connected";
+ return;
+ }
+
+ QDateTime m_sampleTime = QDateTime::currentDateTime();
+ qDebug() << "Start time" << m_sampleTime;
+
+ KDbTransaction transaction = m_conn->beginTransaction();
+ KDbTransactionGuard tg(transaction);
+
+ KDbFieldList fields;
+ auto s_battery = m_conn->tableSchema("info_log");
+
+ fields.addField(s_battery->field("timestamp"));
+ fields.addField(s_battery->field("timestamp_dt"));
+ fields.addField(s_battery->field("key"));
+ fields.addField(s_battery->field("value"));
+
+ QList<QVariant> values;
+
+ values << m_sampleTime.toMSecsSinceEpoch() / 1000;
+ values << m_sampleTime;
+ values << AbstractDevice::INFO_BATTERY;
+ values << level;
+
+ if (!m_conn->insertRecord(&fields, values)) {
+ qDebug() << "error inserting record";
+ return;
+ }
+ tg.commit();
+
+}
+
void DeviceInterface::slot_informationChanged(AbstractDevice::Info key, const QString &val)
{
qDebug() << Q_FUNC_INFO << key << val;
+
+ if (key == AbstractDevice::INFO_IMMEDIATE_ALERT) {
+ qWarning() << "Not implemented: Immediate Alert Service" << val;
+ }
+
//Handle notification of low battery
if (key == AbstractDevice::INFO_BATTERY) {
- if (val.toInt() != m_lastBatteryLevel) {
- if (val.toInt() <= 10 && val.toInt() < m_lastBatteryLevel && AmazfishConfig::instance()->appNotifyLowBattery()) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/deviceinterface.h
^
|
@@ -76,6 +76,7 @@
Q_INVOKABLE void updateCalendar();
Q_INVOKABLE void reloadCities();
Q_INVOKABLE void enableFeature(int feature);
+ Q_INVOKABLE void fetchLogs();
Q_INVOKABLE QStringList supportedDisplayItems();
private:
@@ -99,13 +100,16 @@
DBusHRM *m_dbusHRM = nullptr;
QTimer *m_refreshTimer = nullptr;
+ QTimer *m_findDeviceTimer = nullptr;
Q_SLOT void onRefreshTimer();
+ void findDevice();
+ int m_playedSounds = 0;
void createSettings();
void updateServiceController();
- //TODO Minimise use of these funcitons
- MiBandService *miBandService() const;
+ void log_battery_level(int level);
+
HRMService *hrmService() const;
Q_SLOT void onNotification(watchfish::Notification *notification);
@@ -113,17 +117,17 @@
Q_SLOT void onConnectionStateChanged();
Q_SLOT void slot_informationChanged(AbstractDevice::Info infokey, const QString &infovalue);
Q_SLOT void musicChanged();
- Q_SLOT void deviceEvent(AbstractDevice::Events event);
+ Q_SLOT void deviceEvent(AbstractDevice::Event event);
Q_SLOT void handleButtonPressed(int presses);
Q_SLOT void onEventTimer();
Q_SLOT void backgroundActivityStateChanged();
void sendBufferedNotifications();
void scheduleNextEvent();
-
+
//Watchfish
watchfish::MusicController m_musicController;
-#ifdef MER_EDITION_SAILFISH
+#if defined(MER_EDITION_SAILFISH) || defined(UUITK_EDITION)
watchfish::VoiceCallController m_voiceCallController;
#endif
watchfish::NotificationMonitor m_notificationMonitor;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/abstractdevice.cpp
^
|
@@ -86,6 +86,11 @@
return (supportedFeatures() & f) == f;
}
+void AbstractDevice::setDatabase(KDbConnection *conn)
+{
+ m_conn = conn;
+}
+
QString AbstractDevice::deviceName() const
{
return m_pairedName;
@@ -101,8 +106,15 @@
}
void AbstractDevice::downloadSportsData()
+{
+}
+
+void AbstractDevice::downloadActivityData()
+{
+}
+
+void AbstractDevice::fetchLogs()
{
-
}
void AbstractDevice::sendWeather(CurrentWeather *weather)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/abstractdevice.h
^
|
@@ -6,6 +6,11 @@
#include "weather/currentweather.h"
#include "abstractfirmwareinfo.h"
+#include <KDb3/KDbDriver>
+#include <KDb3/KDbConnection>
+#include <KDb3/KDbConnectionData>
+#include <KDb3/KDbTransactionGuard>
+
class AbstractDevice : public QBLEDevice
{
Q_OBJECT
@@ -36,7 +41,8 @@
INFO_HEARTRATE,
INFO_MODEL,
INFO_FW_REVISION,
- INFO_MANUFACTURER
+ INFO_MANUFACTURER,
+ INFO_IMMEDIATE_ALERT
};
Q_ENUM(Info)
@@ -57,7 +63,7 @@
};
Q_ENUM(Settings)
- enum Events {
+ enum Event {
EVENT_MUSIC_STOP,
EVENT_MUSIC_PLAY,
EVENT_MUSIC_PAUSE,
@@ -68,9 +74,11 @@
EVENT_APP_MUSIC,
EVENT_DECLINE_CALL,
EVENT_ANSWER_CALL,
- EVENT_IGNORE_CALL
+ EVENT_IGNORE_CALL,
+ EVENT_FIND_PHONE,
+ EVENT_CANCEL_FIND_PHONE
};
- Q_ENUM(Events)
+ Q_ENUM(Event)
explicit AbstractDevice(const QString &pairedName, QObject *parent = nullptr);
@@ -83,6 +91,8 @@
bool supportsFeature(Feature f) const;
virtual int supportedFeatures() const = 0;
+ virtual void setDatabase(KDbConnection *conn);
+
virtual QString deviceType() const = 0;
QString deviceName() const;
virtual void abortOperations();
@@ -93,6 +103,8 @@
virtual void startDownload();
virtual void downloadSportsData();
+ virtual void downloadActivityData();
+ virtual void fetchLogs();
virtual void sendWeather(CurrentWeather *weather);
virtual void refreshInformation();
virtual QString information(Info i) const;
@@ -113,7 +125,7 @@
Q_SIGNAL void buttonPressed(int presses);
Q_SIGNAL void connectionStateChanged();
Q_SIGNAL void informationChanged(AbstractDevice::Info key, const QString& val);
- Q_SIGNAL void deviceEvent(Events event);
+ Q_SIGNAL void deviceEvent(Event event);
protected:
bool m_needsAuth = false;
@@ -125,11 +137,13 @@
QTimer *m_reconnectTimer;
void setConnectionState(const QString &state);
+ KDbConnection *m_conn = nullptr;
private:
void reconnectionTimer();
void devicePairFinished(const QString& status);
QString m_pairedName;
+
};
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/banglejsdevice.cpp
^
|
@@ -195,10 +195,10 @@
QJsonObject o;
o.insert("t", "weather");
o.insert("temp", weather->temperature());
- o.insert("hum", 0); //TODO we dont have this
+ o.insert("hum", weather->humidity());
o.insert("txt", weather->description());
- o.insert("wind", 0); //TODO we dont have this
- o.insert("wdir", ""); // TODO we dont have this
+ o.insert("wind", weather->windSpeed());
+ o.insert("wdir", weather->windDeg());
o.insert("loc", weather->city()->name());
uart->txJson(o);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/banglejsdevice.h
^
|
@@ -9,32 +9,32 @@
public:
explicit BangleJSDevice(const QString &pairedName, QObject *parent = 0);
- virtual void pair() override;
- virtual int supportedFeatures() const override;
- virtual QString deviceType() const override;
- virtual void abortOperations() override;
+ void pair() override;
+ int supportedFeatures() const override;
+ QString deviceType() const override;
+ void abortOperations() override;
- virtual void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
- virtual void incomingCall(const QString &caller) override;
+ void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
+ void incomingCall(const QString &caller) override;
- virtual void refreshInformation() override;
- virtual QString information(Info i) const override;
+ void refreshInformation() override;
+ QString information(Info i) const override;
Q_SLOT void authenticated(bool ready);
void prepareFirmwareDownload(const AbstractFirmwareInfo *info) override;
- virtual void startDownload() override;
- virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+ void startDownload() override;
+ AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
//Music
- virtual void setMusicStatus(bool playing, const QString &title, const QString &artist, const QString &album, int duration = 0, int position = 0) override;
+ void setMusicStatus(bool playing, const QString &title, const QString &artist, const QString &album, int duration = 0, int position = 0) override;
//Navigation
- virtual void navigationRunning(bool running) override;
- virtual void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
+ void navigationRunning(bool running) override;
+ void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
//Weather
- virtual void sendWeather(CurrentWeather *weather) override;
+ void sendWeather(CurrentWeather *weather) override;
protected:
virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/bipdevice.h
^
|
@@ -83,17 +83,17 @@
public:
explicit BipDevice(const QString &pairedName, QObject *parent = nullptr);
- virtual int supportedFeatures() const override;
- virtual QString deviceType() const override;
- virtual QStringList supportedDisplayItems() const override;
- virtual void applyDeviceSetting(AbstractDevice::Settings s) override;
+ int supportedFeatures() const override;
+ QString deviceType() const override;
+ QStringList supportedDisplayItems() const override;
+ void applyDeviceSetting(AbstractDevice::Settings s) override;
- virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+ AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
- virtual void sendWeather(CurrentWeather *weather) override;
+ void sendWeather(CurrentWeather *weather) override;
- virtual void navigationRunning(bool running) override;
- virtual void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
+ void navigationRunning(bool running) override;
+ void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
protected:
void initialise() override;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/bipfirmwareinfo.h
^
|
@@ -11,7 +11,7 @@
public:
explicit BipFirmwareInfo(const QByteArray &bytes);
- virtual bool supportedOnDevice(const QString &device) const override;
+ bool supportedOnDevice(const QString &device) const override;
private:
void determineFirmwareType();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/biplitedevice.h
^
|
@@ -9,9 +9,9 @@
public:
explicit BipLiteDevice(const QString &pairedName, QObject *parent = 0);
- virtual QString deviceType() const override;
+ QString deviceType() const override;
- virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+ AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
private:
void initialise() override;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/biplitefirmwareinfo.h
^
|
@@ -8,7 +8,7 @@
public:
explicit BipLiteFirmwareInfo(const QByteArray &bytes);
- virtual bool supportedOnDevice(const QString &device) const override;
+ bool supportedOnDevice(const QString &device) const override;
private:
void determineFirmwareType();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/bipsdevice.h
^
|
@@ -9,15 +9,15 @@
public:
explicit BipSDevice(const QString &pairedName, QObject *parent = nullptr);
- virtual QString deviceType() const override;
- virtual int supportedFeatures() const override;
- virtual QStringList supportedDisplayItems() const override;
+ QString deviceType() const override;
+ int supportedFeatures() const override;
+ QStringList supportedDisplayItems() const override;
- virtual void applyDeviceSetting(Settings s) override;
+ void applyDeviceSetting(Settings s) override;
AbstractFirmwareInfo* firmwareInfo(const QByteArray &bytes) override;
- virtual void setMusicStatus(bool playing, const QString &artist, const QString &album, const QString &track, int duration = 0, int position = 0) override;
+ void setMusicStatus(bool playing, const QString &artist, const QString &album, const QString &track, int duration = 0, int position = 0) override;
protected:
void initialise() override;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtr2device.h
^
|
@@ -9,7 +9,7 @@
public:
explicit Gtr2Device(const QString &pairedName, QObject *parent = nullptr);
QString deviceType() const override;
- virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+ AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtr2firmwareinfo.cpp
^
|
@@ -41,7 +41,7 @@
// m_type = Firmware;
// }
- if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
+ if ((m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(UIHH_HEADER)) && (m_bytes.at(4) == 0x01 || m_bytes.at(4) == 0x02)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
m_type = Watchface;
}
if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(NEWFT_HEADER))) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtr2firmwareinfo.h
^
|
@@ -8,7 +8,7 @@
public:
explicit Gtr2FirmwareInfo(const QByteArray &bytes);
- virtual bool supportedOnDevice(const QString &device) const override;
+ bool supportedOnDevice(const QString &device) const override;
private:
void determineFirmwareType();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtrdevice.cpp
^
|
@@ -1,4 +1,5 @@
#include "gtrdevice.h"
+#include "gtrfirmwareinfo.h"
#include <QtXml/QtXml>
#include <QTimer>
@@ -18,6 +19,11 @@
return version >= "1.0.0.00" && version < "1.6.0.00";
}
+AbstractFirmwareInfo *GtrDevice::firmwareInfo(const QByteArray &bytes)
+{
+ return new GtrFirmwareInfo(bytes);
+}
+
void GtrDevice::initialise()
{
qDebug() << Q_FUNC_INFO;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtrdevice.h
^
|
@@ -10,6 +10,8 @@
explicit GtrDevice(const QString &pairedName, QObject *parent = nullptr);
QString deviceType() const override;
+ AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+
protected:
void initialise() override;
void parseServices();
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtrfirmwareinfo.cpp
^
|
@@ -0,0 +1,122 @@
+#include "gtrfirmwareinfo.h"
+#include <QDebug>
+
+GtrFirmwareInfo::GtrFirmwareInfo(const QByteArray &bytes)
+{
+ m_bytes = bytes;
+
+ calculateCRC16();
+ calculateCRC32();
+ determineFirmwareType();
+ determineFirmwareVersion();
+
+ //qDebug() << mBytes;
+ qDebug() << m_type << m_version << m_crc16 << m_crc32;
+}
+
+void GtrFirmwareInfo::determineFirmwareType() {
+ qDebug() << "Determining firmware type";
+ m_type = Invalid;
+
+ if (m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(NEWRES_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
+ m_type = Res_Compressed;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER2)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER3)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER4))) {
+ m_type = GPS;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_ALMANAC_HEADER))) {
+ m_type = GPS_ALMANAC;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(AGPS_UIHH_HEADER))) {
+ m_type = GPS_UIHH;
+ }
+ if (m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(FW_HEADER2)) == FW_OFFSET) {
+ m_version = m_crcMap[m_crc16];
+ qDebug() << "Version:" << m_version << "CRC:" << m_crc16;
+ m_type = Firmware;
+ }
+
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
+ m_type = Watchface;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(NEWFT_HEADER))) {
+ if (m_bytes.at(10) == 0x01) {
+ m_type = Font;
+ } else if (m_bytes.at(10) == 0x02) {
+ m_type = Font_Latin;
+ }
+ }
+}
+
+bool GtrFirmwareInfo::supportedOnDevice(const QString &device) const
+{
+ qDebug() << "Checking if device suppoerted: " << device;
+ return device == "Amazfit GTR" && m_type != Invalid && !m_version.contains("unknown");
+}
+
+void GtrFirmwareInfo::determineFirmwareVersion()
+{
+ QString version = m_crcMap[m_crc16];
+
+ if (!version.isEmpty()) {
+ switch (m_type) {
+ case Firmware:
+ version = "FW " + version;
+ break;
+ case Res:
+ version = "RES " + version;
+ break;
+ case Res_Compressed:
+ version = "RES_COMPRESSED " + version;
+ break;
+ case Font:
+ version = "FONT " + version;
+ break;
+ case Font_Latin:
+ version = "FONT LATIN " + version;
+ break;
+ case GPS:
+ version = "GPS " + version;
+ break;
+ default:
+ version = "Invalid";
+ }
+ } else {
+ switch (m_type) {
+ case Firmware:
+ version = "FW (unknown)";
+ break;
+ case Res:
+ version = "RES (unknown)";
+ break;
+ case Res_Compressed:
+ version = "RES_COMPRESSED (unknown)";
+ break;
+ case Font:
+ version = "FONT (unknown)";
+ break;
+ case Font_Latin:
+ version = "FONT LATIN (unknown)";
+ break;
+ case GPS:
+ version = "GPS (unknown)";
+ break;
+ case GPS_CEP:
+ version = "CEP";
+ break;
+ case GPS_UIHH:
+ version = "GPS_UIHH";
+ break;
+ case GPS_ALMANAC:
+ version = "ALM";
+ break;
+ case Watchface:
+ version = "Watchface";
+ break;
+ default:
+ version = "(unknown)";
+ }
+ }
+
+ m_version = version;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtrfirmwareinfo.h
^
|
@@ -0,0 +1,21 @@
+#ifndef GTRFIRMWAREINFO_H
+#define GTRFIRMWAREINFO_H
+
+#include "huamifirmwareinfo.h"
+
+class GtrFirmwareInfo : public HuamiFirmwareInfo
+{
+public:
+ explicit GtrFirmwareInfo(const QByteArray &bytes);
+
+ bool supportedOnDevice(const QString &device) const override;
+
+private:
+ void determineFirmwareType();
+ void determineFirmwareVersion();
+
+ QMap<uint16_t, QString> m_crcMap;
+
+};
+
+#endif // GTSFIRMWAREINFO_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gts2firmwareinfo.cpp
^
|
@@ -41,7 +41,7 @@
// m_type = Firmware;
// }
- if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
+ if ((m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(UIHH_HEADER)) && (m_bytes.at(4) == 0x01 || m_bytes.at(4) == 0x02)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
m_type = Watchface;
}
if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(NEWFT_HEADER))) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gts2firmwareinfo.h
^
|
@@ -8,7 +8,7 @@
public:
explicit Gts2FirmwareInfo(const QByteArray &bytes);
- virtual bool supportedOnDevice(const QString &device) const override;
+ bool supportedOnDevice(const QString &device) const override;
private:
void determineFirmwareType();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtsdevice.cpp
^
|
@@ -68,6 +68,12 @@
case MiBandService::EVENT_IGNORE_CALL:
emit deviceEvent(AbstractDevice::EVENT_IGNORE_CALL);
break;
+ case MiBandService::EVENT_FIND_PHONE:
+ emit deviceEvent(AbstractDevice::EVENT_FIND_PHONE);
+ break;
+ case MiBandService::EVENT_CANCEL_FIND_PHONE:
+ emit deviceEvent(AbstractDevice::EVENT_CANCEL_FIND_PHONE);
+ break;
default:
break;
}
@@ -216,10 +222,12 @@
void GtsDevice::prepareFirmwareDownload(const AbstractFirmwareInfo *info)
{
BipFirmwareService *fw = qobject_cast<BipFirmwareService*>(service(BipFirmwareService::UUID_SERVICE_FIRMWARE));
- if (fw){
+ MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
+
+ if (fw && mi){
QString revision = softwareRevision();
if (revision > "0.1.1.16") {
- fw->prepareFirmwareDownload(info, new HuamiUpdateFirmwareOperation2020(info, fw));
+ fw->prepareFirmwareDownload(info, new HuamiUpdateFirmwareOperation2020(info, fw, *mi));
} else {
fw->prepareFirmwareDownload(info, new UpdateFirmwareOperationNew(info, fw));
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtsdevice.h
^
|
@@ -10,23 +10,23 @@
explicit GtsDevice(const QString &pairedName, QObject *parent = nullptr);
QString deviceType() const override;
- virtual void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
- virtual void sendEventReminder(int id, const QDateTime &dt, const QString &event) override;
- virtual int supportedFeatures() const override;
+ void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
+ void sendEventReminder(int id, const QDateTime &dt, const QString &event) override;
+ int supportedFeatures() const override;
void prepareFirmwareDownload(const AbstractFirmwareInfo *info) override;
- virtual void applyDeviceSetting(Settings s) override;
+ void applyDeviceSetting(Settings s) override;
- virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+ AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
- virtual void sendWeather(CurrentWeather *weather) override;
- virtual void enableFeature(AbstractDevice::Feature feature) override;
- virtual void setMusicStatus(bool playing, const QString &artist, const QString &album, const QString &track, int duration = 0, int position = 0) override;
+ void sendWeather(CurrentWeather *weather) override;
+ void enableFeature(AbstractDevice::Feature feature) override;
+ void setMusicStatus(bool playing, const QString &artist, const QString &album, const QString &track, int duration = 0, int position = 0) override;
//Navigation
- virtual void navigationRunning(bool running) override;
- virtual void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
+ void navigationRunning(bool running) override;
+ void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
- virtual QStringList supportedDisplayItems() const override;
+ QStringList supportedDisplayItems() const override;
protected:
Q_SLOT void serviceEvent(uint8_t event);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/gtsfirmwareinfo.h
^
|
@@ -8,7 +8,7 @@
public:
explicit GtsFirmwareInfo(const QByteArray &bytes);
- virtual bool supportedOnDevice(const QString &device) const override;
+ bool supportedOnDevice(const QString &device) const override;
private:
void determineFirmwareType();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/huamidevice.cpp
^
|
@@ -39,6 +39,30 @@
return m_softwareRevision;
}
+void HuamiDevice::downloadSportsData()
+{
+ MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
+ if (mi) {
+ mi->fetchSportsSummaries();
+ }
+}
+
+void HuamiDevice::downloadActivityData()
+{
+ MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
+ if (mi) {
+ mi->fetchActivityData();
+ }
+}
+
+void HuamiDevice::fetchLogs()
+{
+ MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
+ if (mi) {
+ mi->fetchLogs();
+ }
+}
+
void HuamiDevice::refreshInformation()
{
DeviceInfoService *info = qobject_cast<DeviceInfoService*>(service(DeviceInfoService::UUID_SERVICE_DEVICEINFO));
@@ -137,7 +161,7 @@
qDebug() << Q_FUNC_INFO << caller;
AlertNotificationService *alert = qobject_cast<AlertNotificationService*>(service(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION));
if (alert) {
- alert->incomingCall(caller);
+ alert->incomingCall(QByteArray::fromHex("0301"), caller);
}
}
@@ -157,6 +181,15 @@
sendAlert("navigation", tr("Progress") + ":" + QString::number(progress), narrative + "\n" + manDist);
}
+void HuamiDevice::setDatabase(KDbConnection *conn)
+{
+ MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
+ if (mi){
+ mi->setDatabase(conn);
+ }
+ AbstractDevice::setDatabase(conn);
+}
+
void HuamiDevice::handleButtonPressed()
{
qDebug() << Q_FUNC_INFO;
@@ -312,6 +345,12 @@
case MiBandService::EVENT_IGNORE_CALL:
emit deviceEvent(AbstractDevice::EVENT_IGNORE_CALL);
break;
+ case MiBandService::EVENT_FIND_PHONE:
+ emit deviceEvent(AbstractDevice::EVENT_FIND_PHONE);
+ break;
+ case MiBandService::EVENT_CANCEL_FIND_PHONE:
+ emit deviceEvent(AbstractDevice::EVENT_CANCEL_FIND_PHONE);
+ break;
default:
break;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/huamidevice.h
^
|
@@ -19,29 +19,35 @@
public:
explicit HuamiDevice(const QString &pairedName, QObject *parent = nullptr);
- virtual void abortOperations() override;
+ void abortOperations() override;
- virtual void refreshInformation() override;
- virtual QString information(Info i) const override;
- virtual void rebootWatch() override;
+ void refreshInformation() override;
+ QString information(Info i) const override;
+ void rebootWatch() override;
- virtual void applyDeviceSetting(Settings s) override;
+ void applyDeviceSetting(Settings s) override;
- virtual void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
- virtual void incomingCall(const QString &caller) override;
+ void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
+ void incomingCall(const QString &caller) override;
QString softwareRevision();
- virtual void prepareFirmwareDownload(const AbstractFirmwareInfo *info) override;
- virtual void startDownload() override;
+ void downloadSportsData() override;
+ void downloadActivityData() override;
+ void fetchLogs() override;
+
+ void prepareFirmwareDownload(const AbstractFirmwareInfo *info) override;
+ void startDownload() override;
Q_SLOT void authenticated(bool ready);
void sendWeatherHuami(CurrentWeather *weather, bool sendConditionString);
- virtual int activitySampleSize();
- virtual void navigationRunning(bool running) override;
- virtual void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
+ int activitySampleSize();
+ void navigationRunning(bool running) override;
+ void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
+
+ void setDatabase(KDbConnection *conn) override;
protected:
Q_SLOT void handleButtonPressed();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/huamifirmwareinfo.h
^
|
@@ -8,69 +8,73 @@
public:
HuamiFirmwareInfo();
- const int FW_OFFSET = 0x3;
- const int FONT_TYPE_OFFSET = 0x9;
- const int COMPRESSED_RES_HEADER_OFFSET = 0x9;
- const int COMPRESSED_RES_HEADER_OFFSET_NEW = 0xd;
+ static const int FW_OFFSET = 0x3;
+ static const int FONT_TYPE_OFFSET = 0x9;
+ static const int COMPRESSED_RES_HEADER_OFFSET = 0x9;
+ static const int COMPRESSED_RES_HEADER_OFFSET_NEW = 0xd;
- const uint8_t RES_HEADER[5]{ // HMRES resources file (*.res)
+ static constexpr uint8_t RES_HEADER[5]{ // HMRES resources file (*.res)
0x48, 0x4d, 0x52, 0x45, 0x53
};
- const uint8_t NEWRES_HEADER[5] = { // NERES resources file (*.res)
+ static constexpr uint8_t NEWRES_HEADER[5] = { // NERES resources file (*.res)
0x4e, 0x45, 0x52, 0x45, 0x53
};
- const uint8_t WATCHFACE_HEADER[6] = { //HMDIAL watchface
+ static constexpr uint8_t WATCHFACE_HEADER[6] = { //HMDIAL watchface
0x48, 0x4d, 0x44, 0x49, 0x41, 0x4c
};
- const uint8_t FT_HEADER[4] = { // HMZK font file (*.ft, *.ft.xx)
+ static constexpr uint8_t FT_HEADER[4] = { // HMZK font file (*.ft, *.ft.xx)
0x48, 0x4d, 0x5a, 0x4b
};
- const uint8_t NEWFT_HEADER[4] = { // NEZK font file (*.ft, *.ft.xx)
+ static constexpr uint8_t NEWFT_HEADER[4] = { // NEZK font file (*.ft, *.ft.xx)
0x4e, 0x45, 0x5a, 0x4b
};
- const uint8_t GPS_HEADER[16] = {
+ static constexpr uint8_t GPS_HEADER[16] = {
0xcb, 0x51, 0xc1, 0x30, 0x41, 0x9e, 0x5e, 0xd3,
0x51, 0x35, 0xdf, 0x66, 0xed, 0xd9, 0x5f, 0xa7
};
- const uint8_t GPS_HEADER2[16] = {
+ static constexpr uint8_t GPS_HEADER2[16] = {
0x10, 0x50, 0x26, 0x76, 0x8f, 0x4a, 0xa1, 0x49,
0xa7, 0x26, 0xd0, 0xe6, 0x4a, 0x21, 0x88, 0xd4
};
- const uint8_t GPS_HEADER3[16] = {
+ static constexpr uint8_t GPS_HEADER3[16] = {
0xeb, 0xfa, 0xc5, 0x89, 0xf0, 0x5c, 0x2e, 0xcc,
0xfa, 0xf3, 0x62, 0xeb, 0x92, 0xc6, 0xa1, 0xbb
};
- const uint8_t GPS_HEADER4[16] = {
+ static constexpr uint8_t GPS_HEADER4[16] = {
0x0b, 0x61, 0x53, 0xed, 0x83, 0xac, 0x07, 0x21,
0x8c, 0x36, 0x2e, 0x8c, 0x9c, 0x08, 0x54, 0xa6
};
- const uint8_t GPS_ALMANAC_HEADER[5] = { // probably wrong
+ static constexpr uint8_t GPS_ALMANAC_HEADER[5] = { // probably wrong
0xa0, 0x80, 0x08, 0x00, 0x8b
};
- const uint8_t GPS_CEP_HEADER[4]{ // probably wrong
+ static constexpr uint8_t GPS_CEP_HEADER[4]{ // probably wrong
0x2a, 0x12, 0xa0, 0x02
};
- const uint8_t AGPS_UIHH_HEADER[5]{ // probably wrong
+ static constexpr uint8_t UIHH_HEADER[4]{ //
+ 'U', 'I', 'H', 'H'
+ };
+
+ static constexpr uint8_t AGPS_UIHH_HEADER[5]{ // probably wrong
'U', 'I', 'H', 'H', 0x04
};
// this is the same as Cor
- const uint8_t FW_HEADER[16] = {
+ static constexpr uint8_t FW_HEADER[16] = {
0x00, 0x98, 0x00, 0x20, 0xA5, 0x04, 0x00, 0x20, 0xAD, 0x04, 0x00, 0x20, 0xC5, 0x04, 0x00, 0x20
};
- const uint8_t FW_HEADER2[5] = {
+ static constexpr uint8_t FW_HEADER2[5] = {
0x20, 0x99, 0x12, 0x01, 0x08 //probably nonsense
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/infinitimefirmwareinfo.cpp
^
|
@@ -52,7 +52,27 @@
{
switch (m_type) {
case Firmware:
- m_version = "FW ()";
+ {
+ m_version = "FW ()";
+
+ QRegularExpression binNameVersionPattern(".*-((\\d+\\.){2}\\d+)\\.bin$");
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(ZIP_HEADER))) {
+ QDataStream in(&m_bytes, QIODevice::ReadOnly);
+ KCompressionDevice dev(in.device(), false, KCompressionDevice::CompressionType::None);
+ KZip zip(&dev);
+
+ if(zip.open(QIODevice::ReadOnly)) {
+ auto* root = zip.directory();
+ foreach (const QString &entryName, root->entries()) {
+ QRegularExpressionMatch match = binNameVersionPattern.match(entryName);
+ if (match.hasMatch()) {
+ m_version = QString("FW (%1)").arg(match.captured(1));
+ break;
+ }
+ }
+ }
+ }
+ }
break;
case Res_Compressed:
m_version = "Ressource ()";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/infinitimefirmwareinfo.h
^
|
@@ -7,7 +7,7 @@
{
public:;
explicit InfinitimeFirmwareInfo(const QByteArray &bytes);
- virtual bool supportedOnDevice(const QString &device) const override;
+ bool supportedOnDevice(const QString &device) const override;
private:
void determineFirmwareType();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/pinetimejfdevice.cpp
^
|
@@ -7,10 +7,15 @@
#include "dfuservice.h"
#include "dfuoperation.h"
#include "infinitimenavservice.h"
+#include "immediatealertservice.h"
#include "hrmservice.h"
#include "infinitimemotionservice.h"
#include "infinitimeweatherservice.h"
+#include "pinetimesimpleweatherservice.h"
#include "adafruitblefsservice.h"
+#include "batteryservice.h"
+#include "amazfishconfig.h"
+#include "realtimeactivitysample.h"
#include <QtXml/QtXml>
namespace {
@@ -99,7 +104,7 @@
qDebug() << Q_FUNC_INFO << caller;
AlertNotificationService *alert = qobject_cast<AlertNotificationService*>(service(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION));
if (alert) {
- alert->incomingCall(caller);
+ alert->incomingCall(QByteArray::fromHex("030100"), caller);
}
}
@@ -139,7 +144,7 @@
} else if (uuid == CurrentTimeService::UUID_SERVICE_CURRENT_TIME && !service(CurrentTimeService::UUID_SERVICE_CURRENT_TIME)) {
addService(CurrentTimeService::UUID_SERVICE_CURRENT_TIME, new CurrentTimeService(path, this));
} else if (uuid == AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION && !service(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION)) {
- addService(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION, new AlertNotificationService(path, this, 0x0a));
+ addService(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION, new AlertNotificationService(path, this));
} else if (uuid == PineTimeMusicService::UUID_SERVICE_MUSIC && !service(PineTimeMusicService::UUID_SERVICE_MUSIC )) {
addService(PineTimeMusicService::UUID_SERVICE_MUSIC , new PineTimeMusicService(path, this));
} else if (uuid == DfuService::UUID_SERVICE_DFU && !service(DfuService::UUID_SERVICE_DFU)) {
@@ -150,11 +155,17 @@
addService(HRMService::UUID_SERVICE_HRM, new HRMService(path, this));
} else if (uuid == InfiniTimeMotionService::UUID_SERVICE_MOTION && !service(InfiniTimeMotionService::UUID_SERVICE_MOTION)) {
addService(InfiniTimeMotionService::UUID_SERVICE_MOTION, new InfiniTimeMotionService(path, this));
+ } else if (uuid == PineTimeSimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER && !service(PineTimeSimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER)) {
+ addService(PineTimeSimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER, new PineTimeSimpleWeatherService(path, this));
} else if (uuid == InfiniTimeWeatherService::UUID_SERVICE_WEATHER && !service(InfiniTimeWeatherService::UUID_SERVICE_WEATHER)) {
addService(InfiniTimeWeatherService::UUID_SERVICE_WEATHER, new InfiniTimeWeatherService(path, this));
} else if (uuid == AdafruitBleFsService::UUID_SERVICE_FS && !service(AdafruitBleFsService::UUID_SERVICE_FS)) {
size_t transferMtu = GetMtuForCharacteristic(path, AdafruitBleFsService::UUID_CHARACTERISTIC_FS_TRANSFER);
addService(AdafruitBleFsService::UUID_SERVICE_FS, new AdafruitBleFsService(path, this, transferMtu));
+ } else if (uuid == BatteryService::UUID_SERVICE_BATTERY && !service(BatteryService::UUID_SERVICE_BATTERY)) {
+ addService(BatteryService::UUID_SERVICE_BATTERY, new BatteryService(path, this));
+ } else if (uuid == ImmediateAlertService::UUID_SERVICE_IMMEDIATE_ALERT && !service(ImmediateAlertService::UUID_SERVICE_IMMEDIATE_ALERT)) {
+ addService(ImmediateAlertService::UUID_SERVICE_IMMEDIATE_ALERT, new ImmediateAlertService(path, this));
} else if ( !service(uuid)) {
addService(uuid, new QBLEService(uuid, path, this));
}
@@ -179,6 +190,11 @@
connect(info, &DeviceInfoService::informationChanged, this, &PinetimeJFDevice::informationChanged, Qt::UniqueConnection);
}
+ BatteryService *battery = qobject_cast<BatteryService*>(service(BatteryService::UUID_SERVICE_BATTERY));
+ if (battery) {
+ connect(battery, &BatteryService::informationChanged, this, &PinetimeJFDevice::informationChanged, Qt::UniqueConnection);
+ }
+
CurrentTimeService *cts = qobject_cast<CurrentTimeService*>(service(CurrentTimeService::UUID_SERVICE_CURRENT_TIME));
if (cts) {
cts->currentTime();
@@ -201,6 +217,7 @@
HRMService *hrm = qobject_cast<HRMService*>(service(HRMService::UUID_SERVICE_HRM));
if (hrm) {
connect(hrm, &HRMService::informationChanged, this, &AbstractDevice::informationChanged, Qt::UniqueConnection);
+ connect(hrm, &HRMService::informationChanged, &realtimeActivitySample, &RealtimeActivitySample::slot_informationChanged, Qt::UniqueConnection);
}
InfiniTimeMotionService *motion = qobject_cast<InfiniTimeMotionService*>(service(InfiniTimeMotionService::UUID_SERVICE_MOTION));
@@ -208,14 +225,66 @@
motion->enableNotification(InfiniTimeMotionService::UUID_CHARACTERISTIC_MOTION_STEPS);
//motion->enableNotification(InfiniTimeMotionService::UUID_CHARACTERISTIC_MOTION_MOTION);
connect(motion, &InfiniTimeMotionService::informationChanged, this, &AbstractDevice::informationChanged, Qt::UniqueConnection);
+ connect(motion, &InfiniTimeMotionService::informationChanged, &realtimeActivitySample, &RealtimeActivitySample::slot_informationChanged, Qt::UniqueConnection);
}
AdafruitBleFsService *bleFs = qobject_cast<AdafruitBleFsService*>(service(AdafruitBleFsService::UUID_SERVICE_FS));
if (bleFs) {
connect(bleFs, &AdafruitBleFsService::downloadProgress, this, &PinetimeJFDevice::downloadProgress, Qt::UniqueConnection);
}
+
+ connect(&realtimeActivitySample, &RealtimeActivitySample::samplesReady, this, &PinetimeJFDevice::sampledActivity, Qt::UniqueConnection);
}
+void PinetimeJFDevice::sampledActivity(QDateTime dt, int kind, int intensity, int steps, int heartrate) {
+ qDebug() << Q_FUNC_INFO << dt << kind << intensity << steps << heartrate;
+
+
+ if (!m_conn || !(m_conn->isDatabaseUsed())) {
+ qDebug() << "Database not connected";
+ return;
+ }
+
+ auto config = AmazfishConfig::instance();
+ uint id = qHash(config->profileName());
+ uint devid = qHash(config->pairedAddress());
+
+ KDbTransaction transaction = m_conn->beginTransaction();
+ KDbTransactionGuard tg(transaction);
+
+ KDbFieldList fields;
+ auto mibandActivity = m_conn->tableSchema("mi_band_activity");
+
+ fields.addField(mibandActivity->field("timestamp"));
+ fields.addField(mibandActivity->field("timestamp_dt"));
+ fields.addField(mibandActivity->field("device_id"));
+ fields.addField(mibandActivity->field("user_id"));
+ fields.addField(mibandActivity->field("raw_intensity"));
+ fields.addField(mibandActivity->field("steps"));
+ fields.addField(mibandActivity->field("raw_kind"));
+ fields.addField(mibandActivity->field("heartrate"));
+
+ QList<QVariant> values;
+
+ values << dt.toMSecsSinceEpoch() / 1000;
+ values << dt;
+ values << devid;
+ values << id;
+ values << intensity;
+ values << steps;
+ values << kind;
+ values << heartrate;
+
+ if (!m_conn->insertRecord(&fields, values)) {
+ qWarning() << "error inserting record";
+ tg.rollback();
+ return;
+ }
+ tg.commit();
+
+}
+
+
void PinetimeJFDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
{
qDebug() << "PinetimeJFDevice::onPropertiesChanged:" << interface << map << list;
@@ -327,17 +396,31 @@
if (info) {
info->refreshInformation();
}
+
+ BatteryService *bat = qobject_cast<BatteryService*>(service(BatteryService::UUID_SERVICE_BATTERY));
+ if (bat) {
+ bat->refreshInformation();
+ }
+
+ InfiniTimeMotionService *motion = qobject_cast<InfiniTimeMotionService*>(service(InfiniTimeMotionService::UUID_SERVICE_MOTION));
+ if (motion) {
+ motion->refreshSteps();
+// motion->refreshMotion();
+ }
+
}
QString PinetimeJFDevice::information(Info i) const
{
DeviceInfoService *info = qobject_cast<DeviceInfoService*>(service(DeviceInfoService::UUID_SERVICE_DEVICEINFO));
if (!info) {
+ qWarning() << "Device info service doesn't exists";
return QString();
}
- InfiniTimeMotionService *motion = qobject_cast<InfiniTimeMotionService*>(service(InfiniTimeMotionService::UUID_CHARACTERISTIC_MOTION_STEPS));
+ InfiniTimeMotionService *motion = qobject_cast<InfiniTimeMotionService*>(service(InfiniTimeMotionService::UUID_SERVICE_MOTION));
if (!motion) {
+ qWarning() << "Motion service doesn't exists";
return QString();
}
@@ -416,4 +499,10 @@
if (w){
w->sendWeather(weather);
}
+
+ PineTimeSimpleWeatherService *sw = qobject_cast<PineTimeSimpleWeatherService*>(service(PineTimeSimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER));
+
+ if (sw){
+ sw->sendWeather(weather);
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/devices/pinetimejfdevice.h
^
|
@@ -3,40 +3,41 @@
#include <QObject>
#include "abstractdevice.h"
+#include "realtimeactivitysample.h"
class PinetimeJFDevice : public AbstractDevice
{
public:
explicit PinetimeJFDevice(const QString &pairedName, QObject *parent = 0);
- virtual void pair() override;
- virtual int supportedFeatures() const override;
- virtual QString deviceType() const override;
- virtual void abortOperations() override;
+ void pair() override;
+ int supportedFeatures() const override;
+ QString deviceType() const override;
+ void abortOperations() override;
- virtual void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
- virtual void incomingCall(const QString &caller) override;
+ void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
+ void incomingCall(const QString &caller) override;
- virtual void refreshInformation() override;
- virtual QString information(Info i) const override;
+ void refreshInformation() override;
+ QString information(Info i) const override;
Q_SLOT void authenticated(bool ready);
- virtual void setMusicStatus(bool playing, const QString &title, const QString &artist, const QString &album, int duration = 0, int position = 0) override;
+ void setMusicStatus(bool playing, const QString &title, const QString &artist, const QString &album, int duration = 0, int position = 0) override;
void prepareFirmwareDownload(const AbstractFirmwareInfo *info) override;
- virtual void startDownload() override;
- virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+ void startDownload() override;
+ AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
//Navigation
- virtual void navigationRunning(bool running) override;
- virtual void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
+ void navigationRunning(bool running) override;
+ void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
//Weather
- virtual void sendWeather(CurrentWeather *weather) override;
+ void sendWeather(CurrentWeather *weather) override;
protected:
- virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
+ void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
private:
void parseServices();
@@ -44,6 +45,11 @@
Q_SLOT void serviceEvent(const QString &characteristic, uint8_t event);
AbstractFirmwareInfo::Type firmwareType;
+ RealtimeActivitySample realtimeActivitySample;
+
+ Q_SLOT void sampledActivity(QDateTime dt, int kind, int intensity, int steps, int heartrate);
+
+
};
#endif // PINETIMEJFDEVICE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/operations/huamiupdatefirmwareoperation2020.cpp
^
|
@@ -1,6 +1,7 @@
#include "huamiupdatefirmwareoperation2020.h"
#include"typeconversion.h"
#include "bipfirmwareservice.h"
+#include "mibandservice.h"
constexpr uint8_t HuamiUpdateFirmwareOperation2020::COMMAND_REQUEST_PARAMETERS;
constexpr uint8_t HuamiUpdateFirmwareOperation2020::COMMAND_START_FILE;
@@ -11,7 +12,7 @@
constexpr uint8_t HuamiUpdateFirmwareOperation2020::COMMAND_FINALIZE_UPDATE;
-HuamiUpdateFirmwareOperation2020::HuamiUpdateFirmwareOperation2020(const AbstractFirmwareInfo *info, QBLEService *service) : UpdateFirmwareOperation(info, service)
+HuamiUpdateFirmwareOperation2020::HuamiUpdateFirmwareOperation2020(const AbstractFirmwareInfo *info, QBLEService *service, QBLEService &mibandService) : UpdateFirmwareOperation(info, service), m_mibandService(mibandService)
{
qDebug() << Q_FUNC_INFO;
}
@@ -119,6 +120,24 @@
int arraySize = 14;
QByteArray bytes(arraySize, char(0x00));
+ //Special command for watchface
+ if (m_info->type() == AbstractFirmwareInfo::Watchface) {
+ if (m_fwBytes.startsWith(UCHARARR_TO_BYTEARRAY(HuamiFirmwareInfo::UIHH_HEADER))) {
+
+ uint8_t watchfaceConfig[10] = {0x39, 0x00,
+ sizeBytes[0],
+ sizeBytes[1],
+ sizeBytes[2],
+ sizeBytes[3],
+ m_fwBytes[18],
+ m_fwBytes[19],
+ m_fwBytes[20],
+ m_fwBytes[21]
+ };
+ m_mibandService.writeValue(MiBandService::UUID_CHARACTERISTIC_MIBAND_CONFIGURATION, UCHARARR_TO_BYTEARRAY(watchfaceConfig));
+ }
+ }
+
int i = 0;
bytes[i++] = COMMAND_SEND_FIRMWARE_INFO;
bytes[i++] = m_info->type();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/operations/huamiupdatefirmwareoperation2020.h
^
|
@@ -6,7 +6,7 @@
class HuamiUpdateFirmwareOperation2020 : public UpdateFirmwareOperation
{
public:
- HuamiUpdateFirmwareOperation2020(const AbstractFirmwareInfo *info, QBLEService *service);
+ HuamiUpdateFirmwareOperation2020(const AbstractFirmwareInfo *info, QBLEService *service, QBLEService &mibandService);
bool handleMetaData(const QByteArray &meta) override;
void start() override;
@@ -29,6 +29,8 @@
void sendTransferComplete();
void sendFinalize();
+ QBLEService &m_mibandService;
+
int mChunkLength = -1;
};
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/realtimeactivitysample.cpp
^
|
@@ -0,0 +1,98 @@
+#include "realtimeactivitysample.h"
+
+#include <QDebug>
+
+RealtimeActivitySample::RealtimeActivitySample(QObject* parent) : QObject(parent) {
+ m_lastSync = QDateTime::currentDateTime();
+}
+
+void RealtimeActivitySample::setKind(int _kind) {
+ if (_kind == 0) {
+ return;
+ }
+ sampleUpdated();
+ m_kind = _kind;
+}
+
+void RealtimeActivitySample::setIntensity(int _intensity) {
+ if (_intensity == 0) {
+ return;
+ }
+ sampleUpdated();
+ m_intensity = _intensity;
+}
+
+void RealtimeActivitySample::setSteps(int _steps) {
+ if (_steps == 0) {
+ return;
+ }
+ sampleUpdated();
+ m_steps = _steps;
+}
+
+void RealtimeActivitySample::setHeartrate(int _heartrate) {
+ if (_heartrate == 0) {
+ return;
+ }
+ sampleUpdated();
+ m_heartrate_samples.push_back(_heartrate);
+}
+
+void RealtimeActivitySample::sampleUpdated() {
+ QDateTime now = QDateTime::currentDateTime();
+
+
+ int steps_diff = 0;
+ int avg_heartrate = 0;
+
+ if (m_steps_previous == 0) {
+ m_steps_previous = m_steps;
+ }
+
+
+
+ // send old data
+ if (m_lastSync.secsTo(now) > m_interval) {
+
+ if ((m_steps_previous != 0) && (m_steps > m_steps_previous)) {
+ steps_diff = m_steps - m_steps_previous;
+ }
+
+ if (!m_heartrate_samples.isEmpty()) {
+ for (int value : m_heartrate_samples) {
+ avg_heartrate += value;
+ }
+ avg_heartrate = avg_heartrate / m_heartrate_samples.size();
+ }
+ if ((m_intensity != 0) || (steps_diff != 0) || (avg_heartrate != 0)) {
+ emit samplesReady(m_lastSync, m_kind, m_intensity, steps_diff, avg_heartrate);
+
+ // prepare for new data
+ m_kind = 0;
+ m_intensity = 0;
+ m_steps_previous = m_steps;
+ m_steps = 0;
+ m_heartrate_samples.clear();
+ m_lastSync = now;
+
+ }
+ }
+
+
+}
+
+void RealtimeActivitySample::slot_informationChanged(AbstractDevice::Info infokey, const QString &infovalue) {
+
+ switch (infokey) {
+ case AbstractDevice::INFO_STEPS:
+ setSteps(infovalue.toInt());
+ break;
+ case AbstractDevice::INFO_HEARTRATE:
+ setHeartrate(infovalue.toInt());
+ break;
+ default:
+ qWarning() << Q_FUNC_INFO << "unexpeted key " << infokey;
+ break;
+ }
+
+}
\ No newline at end of file
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/realtimeactivitysample.h
^
|
@@ -0,0 +1,39 @@
+#ifndef REALTIME_ACTIVITY_SAMPLE__H
+#define REALTIME_ACTIVITY_SAMPLE__H
+
+#include <QObject>
+#include <QDateTime>
+#include "abstractdevice.h"
+
+class RealtimeActivitySample : public QObject {
+ Q_OBJECT
+
+ public:
+ RealtimeActivitySample(QObject* parent = NULL);
+
+ void setKind(int _kind);
+ void setIntensity(int _intensity);
+ void setSteps(int _steps);
+ void setHeartrate(int _heartrate);
+
+ signals:
+ void samplesReady(QDateTime dt, int kind, int intensity, int steps, int heart);
+
+ public slots:
+ Q_SLOT void slot_informationChanged(AbstractDevice::Info infokey, const QString &infovalue);
+
+
+ private:
+ int m_kind = 0;
+ int m_intensity = 0;
+ int m_steps = 0;
+ int m_steps_previous = 0;
+ QList<int> m_heartrate_samples;
+
+ QDateTime m_lastSync;
+ qint64 m_interval = 60;
+
+ void sampleUpdated();
+};
+
+#endif // REALTIME_ACTIVITY_SAMPLE__H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/alertnotificationservice.cpp
^
|
@@ -17,10 +17,6 @@
{
qDebug() << "Alert:" << sender << subject << message;
- if (message.isEmpty()) {
- return;
- }
-
int category = 0xfa; //Custom Huami icon
int icon = mapSenderToIcon(sender);
@@ -49,11 +45,10 @@
writeValue(UUID_CHARACTERISTIC_ALERT_NOTIFICATION_NEW_ALERT, send);
}
-void AlertNotificationService::incomingCall(const QString &caller)
+void AlertNotificationService::incomingCall(const QByteArray header, const QString &caller)
{
qDebug() << Q_FUNC_INFO << caller;
- QByteArray send = QByteArray::fromHex("0301");
- send += caller.toUtf8();
+ QByteArray send = header + caller.toUtf8();
writeValue(UUID_CHARACTERISTIC_ALERT_NOTIFICATION_NEW_ALERT, send);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/alertnotificationservice.h
^
|
@@ -97,6 +97,7 @@
/* Instagram */
{"instagram", HuamiIcon::INSTAGRAM},
/* Telegram clients */
+ {"teleports.ubports_teleports", HuamiIcon::TELEGRAM},
{"depecher", HuamiIcon::TELEGRAM},
{"fernschreiber", HuamiIcon::TELEGRAM},
{"sailorgram", HuamiIcon::TELEGRAM},
@@ -115,7 +116,7 @@
};
Q_INVOKABLE void sendAlert(const QString &sender, const QString &subject, const QString &message);
- Q_INVOKABLE void incomingCall(const QString &caller);
+ Q_INVOKABLE void incomingCall(const QByteArray header, const QString &caller);
static int mapSenderToIcon(const QString &sender);
Q_SIGNAL void serviceEvent(const QString &c, uint8_t event);
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/batteryservice.cpp
^
|
@@ -0,0 +1,35 @@
+#include "batteryservice.h"
+
+const char* BatteryService::UUID_SERVICE_BATTERY = "0000180f-0000-1000-8000-00805f9b34fb";
+const char* BatteryService::UUID_CHARACTERISTIC_BATTERY_LEVEL = "00002a19-0000-1000-8000-00805f9b34fb";
+
+BatteryService::BatteryService(const QString &path, QObject *parent) : QBLEService(UUID_SERVICE_BATTERY, path, parent)
+{
+ qDebug() << Q_FUNC_INFO;
+
+ connect(this, &QBLEService::characteristicRead, this, &BatteryService::characteristicRead);
+}
+
+void BatteryService::refreshInformation()
+{
+ qDebug() << Q_FUNC_INFO;
+
+ readAsync(UUID_CHARACTERISTIC_BATTERY_LEVEL);
+}
+
+void BatteryService::characteristicRead(const QString &characteristic, const QByteArray &value)
+{
+ qDebug() << Q_FUNC_INFO << "Read:" << characteristic << value;
+ if (characteristic == UUID_CHARACTERISTIC_BATTERY_LEVEL) {
+ m_batteryLevel = value[0];
+ emit informationChanged(AbstractDevice::INFO_BATTERY, QString::number(m_batteryLevel));
+ } else {
+ qWarning() << "Unknown value";
+ }
+}
+
+int BatteryService::batteryLevel() const
+{
+ qDebug() << Q_FUNC_INFO << m_batteryLevel;
+ return m_batteryLevel;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/batteryservice.h
^
|
@@ -0,0 +1,27 @@
+#ifndef BATTERYSERVICE_H
+#define BATTERYSERVICE_H
+
+#include "qble/qbleservice.h"
+#include "devices/abstractdevice.h"
+
+class BatteryService : public QBLEService
+{
+ Q_OBJECT
+public:
+ BatteryService(const QString &path, QObject *parent);
+
+ static const char* UUID_SERVICE_BATTERY;
+ static const char* UUID_CHARACTERISTIC_BATTERY_LEVEL;
+
+ Q_INVOKABLE void refreshInformation();
+
+ int batteryLevel() const;
+
+ Q_SIGNAL void informationChanged(AbstractDevice::Info key, const QString &val);
+
+private:
+ int m_batteryLevel;
+ Q_SLOT void characteristicRead(const QString &c, const QByteArray &value);
+};
+
+#endif // BATTERYSERVICE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/bipfirmwareservice.cpp
^
|
@@ -4,7 +4,6 @@
const char* BipFirmwareService::UUID_CHARACTERISTIC_FIRMWARE = "00001531-0000-3512-2118-0009af100700";
const char* BipFirmwareService::UUID_CHARACTERISTIC_FIRMWARE_DATA = "00001532-0000-3512-2118-0009af100700";
-
BipFirmwareService::BipFirmwareService(const QString &path, QObject *parent) : QBLEService(UUID_SERVICE_FIRMWARE, path, parent)
{
qDebug() << "BipFirmwareService::BipFirmwareService";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/deviceinfoservice.cpp
^
|
@@ -11,7 +11,6 @@
const char* DeviceInfoService::UUID_CHARACTERISTIC_INFO_SYSTEM_ID = "00002a23-0000-1000-8000-00805f9b34fb";
const char* DeviceInfoService::UUID_CHARACTERISTIC_INFO_PNP_ID = "00002a50-0000-1000-8000-00805f9b34fb";
-
DeviceInfoService::DeviceInfoService(const QString &path, QObject *parent) : QBLEService(UUID_SERVICE_DEVICEINFO, path, parent)
{
qDebug() << "BipInfoService::BipInfoService";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/dfuservice.cpp
^
|
@@ -6,15 +6,6 @@
const char* DfuService::UUID_CHARACTERISTIC_DFU_PACKET = "00001532-1212-efde-1523-785feabcd123";
const char* DfuService::UUID_CHARACTERISTIC_DFU_REVISION = "00001534-1212-efde-1523-785feabcd123";
-constexpr uint8_t DfuService::COMMAND_STARTDFU;
-constexpr uint8_t DfuService::COMMAND_RESPONSE;
-constexpr uint8_t DfuService::COMMAND_INITDFUPARAMETERS;
-constexpr uint8_t DfuService::COMMAND_VALIDATE_FIRMWARE;
-constexpr uint8_t DfuService::COMMAND_RECEIVE_FIRMWARE_IMAGE;
-constexpr uint8_t DfuService::COMMAND_ACTIVATE_IMAGE_AND_RESET;
-constexpr uint8_t DfuService::COMMAND_PACKET_RECEIPT_NOTIFICATION;
-constexpr uint8_t DfuService::COMMAND_PACKET_RECEIPT_NOTIFICATION_REQUEST;
-
DfuService::DfuService(const QString &path, QObject *parent) : QBLEService(UUID_SERVICE_DFU, path, parent)
{
qDebug() << Q_FUNC_INFO;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/immediatealertservice.cpp
^
|
@@ -0,0 +1,36 @@
+#include "immediatealertservice.h"
+
+const char* ImmediateAlertService::UUID_SERVICE_IMMEDIATE_ALERT = "00001802-0000-1000-8000-00805f9b34fb";
+const char* ImmediateAlertService::UUID_CHARACTERISTIC_IMMEDIATE_ALERT_LEVEL = "00002a06-0000-1000-8000-00805f9b34fb";
+
+
+ImmediateAlertService::ImmediateAlertService(const QString &path, QObject *parent) : QBLEService(UUID_SERVICE_IMMEDIATE_ALERT, path, parent)
+{
+ qDebug() << Q_FUNC_INFO;
+
+ connect(this, &QBLEService::characteristicRead, this, &ImmediateAlertService::characteristicRead);
+}
+
+void ImmediateAlertService::refreshInformation()
+{
+ qDebug() << Q_FUNC_INFO;
+
+ readAsync(UUID_CHARACTERISTIC_IMMEDIATE_ALERT_LEVEL);
+}
+
+void ImmediateAlertService::characteristicRead(const QString &characteristic, const QByteArray &value)
+{
+ qDebug() << Q_FUNC_INFO << "Read:" << characteristic << value;
+ if (characteristic == UUID_CHARACTERISTIC_IMMEDIATE_ALERT_LEVEL) {
+ m_alertLevel = value[0];
+ emit informationChanged(AbstractDevice::INFO_IMMEDIATE_ALERT, QString::number(m_alertLevel));
+ } else {
+ qWarning() << "Unknown value";
+ }
+}
+
+int ImmediateAlertService::alertLevel() const
+{
+ qDebug() << Q_FUNC_INFO << m_alertLevel;
+ return m_alertLevel;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/immediatealertservice.h
^
|
@@ -0,0 +1,30 @@
+#ifndef IMMEDIATE_ALERT_SERVICE_H
+#define IMMEDIATE_ALERT_SERVICE_H
+
+#include "qble/qbleservice.h"
+#include "devices/abstractdevice.h"
+
+// https://www.bluetooth.com/specifications/specs/immediate-alert-service-1-0/
+
+class ImmediateAlertService : public QBLEService
+{
+ Q_OBJECT
+public:
+ ImmediateAlertService(const QString &path, QObject *parent);
+
+ static const char* UUID_SERVICE_IMMEDIATE_ALERT;
+ static const char* UUID_CHARACTERISTIC_IMMEDIATE_ALERT_LEVEL;
+ enum class Levels : uint8_t { NoAlert = 0, MildAlert = 1, HighAlert = 2 };
+
+ Q_INVOKABLE void refreshInformation();
+
+ int alertLevel() const;
+
+ Q_SIGNAL void informationChanged(AbstractDevice::Info key, const QString &val);
+
+private:
+ int m_alertLevel;
+ Q_SLOT void characteristicRead(const QString &c, const QByteArray &value);
+};
+
+#endif // IMMEDIATE_ALERT_SERVICE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/infinitimemotionservice.cpp
^
|
@@ -11,7 +11,16 @@
{
qDebug() << Q_FUNC_INFO;
connect(this, &QBLEService::characteristicChanged, this, &InfiniTimeMotionService::characteristicChanged);
+}
+
+void InfiniTimeMotionService::refreshSteps()
+{
+ readAsync(UUID_CHARACTERISTIC_MOTION_STEPS);
+}
+void InfiniTimeMotionService::refreshMotion()
+{
+ readAsync(UUID_CHARACTERISTIC_MOTION_MOTION);
}
int InfiniTimeMotionService::steps() const
@@ -21,7 +30,7 @@
void InfiniTimeMotionService::characteristicChanged(const QString &characteristic, const QByteArray &value)
{
- qDebug() << "MiBand Changed:" << characteristic << value.toHex();
+ qDebug() << Q_FUNC_INFO << characteristic << value.toHex();
if (characteristic == UUID_CHARACTERISTIC_MOTION_STEPS) {
qDebug() << "...Got realtime steps:" << value.length();
@@ -29,5 +38,13 @@
m_steps = TypeConversion::toUint32(value[0], value[1], value[2], value[3]);
emit informationChanged(AbstractDevice::INFO_STEPS, QString::number(m_steps));
}
+ } else if (characteristic == UUID_CHARACTERISTIC_MOTION_MOTION) {
+ if (value.length() == 6) {
+ double x = (double) TypeConversion::toInt16(value[0], value[1]) * 0.01;
+ double y = (double) TypeConversion::toInt16(value[2], value[3]) * 0.01;
+ double z = (double) TypeConversion::toInt16(value[4], value[5]) * 0.01;
+ emit motionChanged(x, y, z);
+ qDebug() << "...Got realtime motion: x = " << x << " y = " << y << " z = " << z;
+ }
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/infinitimemotionservice.h
^
|
@@ -19,7 +19,11 @@
static const char *UUID_CHARACTERISTIC_MOTION_STEPS;
static const char *UUID_CHARACTERISTIC_MOTION_MOTION;
+ Q_INVOKABLE void refreshMotion();
+ Q_INVOKABLE void refreshSteps();
+
Q_SIGNAL void informationChanged(AbstractDevice::Info key, const QString &val);
+ Q_SIGNAL void motionChanged(double x, double y, double z);
int steps() const;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/infinitimeweatherservice.cpp
^
|
@@ -31,13 +31,14 @@
for (int f = 0; f < weather->forecastCount(); f++) {
CurrentWeather::Forecast fc = weather->forecast(f);
- qDebug() << "Forecast:" << f << fc.dateTime()<< fc.weatherCode() << fc.maxTemperature() << fc.minTemperature() << fc.humidity() << fc.pressure() << fc.windMaxSpeed() << fc.clouds();
+ qDebug() << "Forecast:" << f << fc.dateTime()<< fc.weatherCode() << (fc.maxTemperature() - 273) << (fc.minTemperature() - 273) << fc.humidity() << fc.pressure() << fc.windMaxSpeed() << fc.clouds();
Temperature t;
t.eventType = eventtype::Temperature;
t.timestamp = fc.dateTime();
t.expires = 86400; //1 day
- t.temperature = fc.maxTemperature();
+ t.temperature = (fc.maxTemperature() - 273.15) * 100;
+ t.dewPoint = fc.maxTemperature() - ((100 - fc.humidity())/5);
writeValue(UUID_CHARACTERISTIC_WEATHER_DATA, t.toCBOR());
Clouds c;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/mibandservice.cpp
^
|
@@ -22,35 +22,6 @@
const char* MiBandService::UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_WRITE = "00000016-0000-3512-2118-0009af100700";
const char* MiBandService::UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_READ = "00000017-0000-3512-2118-0009af100700";
-constexpr uint8_t MiBandService::DATEFORMAT_TIME[];
-constexpr uint8_t MiBandService::DATEFORMAT_DATETIME[];
-constexpr uint8_t MiBandService::DATEFORMAT_TIME_12_HOURS[];
-constexpr uint8_t MiBandService::DATEFORMAT_TIME_24_HOURS[];
-constexpr uint8_t MiBandService::COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST[];
-constexpr uint8_t MiBandService::COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST[];
-constexpr uint8_t MiBandService::COMMAND_SCHEDULE_DISPLAY_ON_LIFT_WRIST[];
-constexpr uint8_t MiBandService::COMMAND_ENABLE_GOAL_NOTIFICATION[];
-constexpr uint8_t MiBandService::COMMAND_DISABLE_GOAL_NOTIFICATION[];
-constexpr uint8_t MiBandService::COMMAND_ENABLE_ROTATE_WRIST_TO_SWITCH_INFO[];
-constexpr uint8_t MiBandService::COMMAND_DISABLE_ROTATE_WRIST_TO_SWITCH_INFO[];
-constexpr uint8_t MiBandService::COMMAND_ENABLE_DISPLAY_CALLER[];
-constexpr uint8_t MiBandService::COMMAND_DISABLE_DISPLAY_CALLER[];
-constexpr uint8_t MiBandService::COMMAND_DISTANCE_UNIT_METRIC[];
-constexpr uint8_t MiBandService::COMMAND_DISTANCE_UNIT_IMPERIAL[];
-constexpr uint8_t MiBandService::COMMAND_SET_FITNESS_GOAL_START[];
-constexpr uint8_t MiBandService::COMMAND_SET_FITNESS_GOAL_END[];
-constexpr uint8_t MiBandService::COMMAND_CHANGE_SCREENS[];
-constexpr uint8_t MiBandService::COMMAND_ENABLE_DISCONNECT_NOTIFICATION[];
-constexpr uint8_t MiBandService::COMMAND_DISABLE_DISCONNECT_NOTIFICATION[];
-
-constexpr uint8_t MiBandService::DISPLAY_XXX[];
-constexpr uint8_t MiBandService::DISPLAY_YYY[];
-constexpr uint8_t MiBandService::WEAR_LOCATION_LEFT_WRIST[];
-constexpr uint8_t MiBandService::WEAR_LOCATION_RIGHT_WRIST[];
-constexpr uint8_t MiBandService::RESPONSE_ACTIVITY_DATA_START_DATE_SUCCESS[];
-constexpr uint8_t MiBandService::RESPONSE_FINISH_SUCCESS[];
-constexpr uint8_t MiBandService::RESPONSE_FINISH_FAIL[];
-
MiBandService::MiBandService(const QString &path, QObject *parent) : QBLEService(UUID_SERVICE_MIBAND, path, parent)
{
qDebug() << "MiBandService::MiBandService";
@@ -110,13 +81,17 @@
if (characteristic == UUID_CHARACTERISTIC_MIBAND_DEVICE_EVENT) {
if (value[0] == EVENT_DECLINE_CALL) {
- emit serviceEvent(EVENT_DECLINE_CALL);
+ emit serviceEvent(AbstractDevice::EVENT_DECLINE_CALL);
} else if (value[0] == EVENT_IGNORE_CALL) {
- emit serviceEvent(EVENT_IGNORE_CALL);
+ emit serviceEvent(AbstractDevice::EVENT_IGNORE_CALL);
} else if (value[0] == EVENT_BUTTON) {
emit buttonPressed();
} else if (value[0] == EVENT_MUSIC) {
emit serviceEvent(value[1]);
+ } else if (value[0] == EVENT_FIND_PHONE) {
+ emit serviceEvent(EVENT_FIND_PHONE);
+ } else if (value[0] == EVENT_CANCEL_FIND_PHONE) {
+ emit serviceEvent(EVENT_CANCEL_FIND_PHONE);
} else {
qDebug() << "device event " << value[0];
if (value[0] == MTU_REQUEST) {
@@ -458,11 +433,21 @@
void MiBandService::setEnableDisplayOnLiftWrist()
{
- auto value = AmazfishConfig::instance()->profileDisplayOnLiftWrist()
- ? COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST
- : COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST;
+ QByteArray cmd;
- writeValue(UUID_CHARACTERISTIC_MIBAND_CONFIGURATION, UCHARARR_TO_BYTEARRAY(value));
+ if (AmazfishConfig::instance()->profileDisplayOnLiftWrist() == AmazfishConfig::DisplayLiftWristOff) {
+ cmd = UCHARARR_TO_BYTEARRAY(COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST);
+ } else if (AmazfishConfig::instance()->profileDisplayOnLiftWrist() == AmazfishConfig::DisplayLiftWristOn) {
+ cmd = UCHARARR_TO_BYTEARRAY(COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST);
+ } else {
+ cmd = UCHARARR_TO_BYTEARRAY(COMMAND_SCHEDULE_DISPLAY_ON_LIFT_WRIST);
+ cmd[4] = AmazfishConfig::instance()->profileWristScheduleStart().time().hour();
+ cmd[5] = AmazfishConfig::instance()->profileWristScheduleStart().time().minute();
+ cmd[6] = AmazfishConfig::instance()->profileWristScheduleEnd().time().hour();
+ cmd[7] = AmazfishConfig::instance()->profileWristScheduleEnd().time().minute();
+ }
+
+ writeValue(UUID_CHARACTERISTIC_MIBAND_CONFIGURATION, cmd);
}
void MiBandService::setDisplayItems()
@@ -781,7 +766,7 @@
QBuffer buffer(&buf);
buffer.open(QIODevice::WriteOnly);
- char temp = weather->temperature() - 273;
+ char temp = weather->temperature() - 273.15;
qint32 dt = qToLittleEndian(weather->dateTime());
qDebug() << dt << temp << condition;
@@ -830,8 +815,8 @@
buffer.putChar(NR_DAYS);
buffer.putChar(condition);
buffer.putChar(condition);
- buffer.putChar((char) (weather->maxTemperature() - 273));
- buffer.putChar((char) (weather->minTemperature() - 273));
+ buffer.putChar((char) (weather->maxTemperature() - 273.15));
+ buffer.putChar((char) (weather->minTemperature() - 273.15));
if (supportsConditionString) {
buffer.write(weather->description().toLatin1());
buffer.putChar((char)0x00);
@@ -845,8 +830,8 @@
buffer.putChar(condition);
buffer.putChar(condition);
- buffer.putChar((char) (fc.maxTemperature() - 273));
- buffer.putChar((char) (fc.minTemperature() - 273));
+ buffer.putChar((char) (fc.maxTemperature() - 273.15));
+ buffer.putChar((char) (fc.minTemperature() - 273.15));
if (supportsConditionString) {
buffer.write(fc.description().toLatin1());
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/mibandservice.h
^
|
@@ -60,6 +60,7 @@
static const uint8_t EVENT_DECLINE_CALL = 0x07;
static const uint8_t EVENT_IGNORE_CALL = 0x09;
static const uint8_t EVENT_FIND_PHONE = 0x08;
+ static const uint8_t EVENT_CANCEL_FIND_PHONE = 0x0f;
static const uint8_t MTU_REQUEST = 0x16;
static const uint8_t EVENT_MUSIC = 0xfe;
static const uint8_t EVENT_MUSIC_OPEN = 0xe0;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/pinetimesimpleweatherservice.cpp
^
|
@@ -0,0 +1,141 @@
+#include "pinetimesimpleweatherservice.h"
+#include "typeconversion.h"
+#include "codec.h"
+
+#include <QDateTime>
+#include <QDebug>
+#include <math.h>
+
+const char* PineTimeSimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER = "00050000-78fc-48fe-8e23-433b3a1942d0";
+const char* PineTimeSimpleWeatherService::UUID_CHARACTERISTIC_SIMPLE_WEATHER_DATA = "00050001-78fc-48fe-8e23-433b3a1942d0";
+
+PineTimeSimpleWeatherService::PineTimeSimpleWeatherService(const QString &path, QObject *parent) : QBLEService(UUID_SERVICE_SIMPLE_WEATHER, path, parent)
+{
+ qDebug() << Q_FUNC_INFO;
+}
+
+
+void PineTimeSimpleWeatherService::sendWeather(CurrentWeather *weather)
+{
+
+ qDebug() << "Current weather data"
+#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
+ << QDateTime::fromSecsSinceEpoch(weather->dateTime())
+#else
+ << QDateTime::fromTime_t(weather->dateTime())
+#endif
+ << weather->dateTime()
+ << weather->temperature() - 273.15
+ << weather->minTemperature() - 273.15
+ << weather->maxTemperature() - 273.15
+ << weather->city()->name()
+ << weather->weatherIcon()
+ << QMetaEnum::fromType<PineTimeSimpleWeatherService::WeatherIcons>().valueToKey(
+ (int)iconToEnum(weather->weatherIcon())
+ )
+ << (int)iconToEnum(weather->weatherIcon())
+// << weather->clouds()
+// << weather->humidity()
+// << weather->windDeg()
+// << weather->windSpeed()
+// << weather->windGusts()
+ ;
+
+ QByteArray cityNameBytes = weather->city()->name().toLocal8Bit().left(32);
+ if(cityNameBytes.size() < 32) {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
+ cityNameBytes.append(32-cityNameBytes.size(), 0x00);
+#else
+ for (int i = 0; i < (32 - cityNameBytes.size()); i++) {
+ cityNameBytes.append( '\0' );
+ }
+#endif
+ }
+
+ QByteArray weatherBytes;
+
+ weatherBytes += TypeConversion::fromInt8(0); // message type
+ weatherBytes += TypeConversion::fromInt8(0); // version information
+ weatherBytes += TypeConversion::fromInt64(weather->dateTime());
+ weatherBytes += TypeConversion::fromInt16( round((weather->temperature() - 273.15) * 100) );
+ weatherBytes += TypeConversion::fromInt16( round((weather->minTemperature() - 273.15) * 100) );
+ weatherBytes += TypeConversion::fromInt16( round((weather->maxTemperature() - 273.15) * 100) );
+ weatherBytes += cityNameBytes;
+ weatherBytes += TypeConversion::fromInt8( (int)iconToEnum(weather->weatherIcon()) );
+
+// weatherBytes += TypeConversion::fromInt8( weather->clouds() );
+// weatherBytes += TypeConversion::fromInt8( weather->humidity() );
+
+// weatherBytes += TypeConversion::fromInt16( (int)(100 * weather->windDeg()));
+// weatherBytes += TypeConversion::fromInt16((int)(100 * weather->windSpeed()));
+// weatherBytes += TypeConversion::fromInt16((int)(100 * weather->windGusts()));
+
+ qDebug() << "Weather bytes" << weatherBytes.toHex();
+
+ writeValue(UUID_CHARACTERISTIC_SIMPLE_WEATHER_DATA, weatherBytes);
+
+
+ int fcDays = std::min(weather->forecastCount(), 5);
+
+ QByteArray forecastBytes;
+ forecastBytes += TypeConversion::fromInt8(1); // message type
+ forecastBytes += TypeConversion::fromInt8(0); // version information
+ forecastBytes += TypeConversion::fromInt64(weather->dateTime());
+ forecastBytes += TypeConversion::fromInt8(fcDays);
+
+
+
+ for (int f = 0; (f < fcDays); f++) {
+ CurrentWeather::Forecast fc = weather->forecast(f);
+// qDebug() << "Forecast:" << f << fc.dateTime()<< fc.weatherCode() << (fc.maxTemperature() - 273) << (fc.minTemperature() - 273) << fc.humidity() << fc.pressure() << fc.windMaxSpeed() << fc.clouds();
+
+
+ qDebug() << "Forecast Day" << f
+#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
+ << QDateTime::fromSecsSinceEpoch(fc.dateTime())
+#else
+ << QDateTime::fromTime_t(fc.dateTime())
+#endif
+ << fc.dateTime()
+ << fc.minTemperature() - 273.15
+ << fc.maxTemperature() - 273.15
+ << fc.weatherIcon()
+ << QMetaEnum::fromType<PineTimeSimpleWeatherService::WeatherIcons>().valueToKey(
+ (int)iconToEnum(fc.weatherIcon())
+ )
+ << (int)iconToEnum(fc.weatherIcon())
+ ;
+
+ forecastBytes += TypeConversion::fromInt16( round((fc.minTemperature() - 273.15) * 100) );
+ forecastBytes += TypeConversion::fromInt16( round((fc.maxTemperature() - 273.15) * 100) );
+ forecastBytes += TypeConversion::fromInt8( (int)iconToEnum(fc.weatherIcon()) );
+
+ }
+
+ qDebug() << "Forecast bytes" << forecastBytes.toHex();
+
+ writeValue(UUID_CHARACTERISTIC_SIMPLE_WEATHER_DATA, forecastBytes);
+
+}
+
+PineTimeSimpleWeatherService::WeatherIcons PineTimeSimpleWeatherService::iconToEnum(const QString& iconName) {
+ if (iconName == "01d") return WeatherIcons::ClearSky;
+ if (iconName == "01n") return WeatherIcons::ClearSky;
+ if (iconName == "02d") return WeatherIcons::FewClouds;
+ if (iconName == "02n") return WeatherIcons::FewClouds;
+ if (iconName == "03d") return WeatherIcons::ScatteredClouds;
+ if (iconName == "03n") return WeatherIcons::ScatteredClouds;
+ if (iconName == "04d") return WeatherIcons::BrokenClouds;
+ if (iconName == "04n") return WeatherIcons::BrokenClouds;
+ if (iconName == "09d") return WeatherIcons::ShowerRain;
+ if (iconName == "09n") return WeatherIcons::ShowerRain;
+ if (iconName == "10d") return WeatherIcons::Rain;
+ if (iconName == "10n") return WeatherIcons::Rain;
+ if (iconName == "11d") return WeatherIcons::Thunderstorm;
+ if (iconName == "11n") return WeatherIcons::Thunderstorm;
+ if (iconName == "13d") return WeatherIcons::Snow;
+ if (iconName == "13n") return WeatherIcons::Snow;
+ if (iconName == "50d") return WeatherIcons::Mist;
+ if (iconName == "50n") return WeatherIcons::Mist;
+ return WeatherIcons::Unknown;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/services/pinetimesimpleweatherservice.h
^
|
@@ -0,0 +1,39 @@
+#ifndef PINETIMESIMPLEWEATHERSERVICE_H
+#define PINETIMESIMPLEWEATHERSERVICE_H
+
+#include <QObject>
+#include "qble/qbleservice.h"
+#include "devices/abstractdevice.h"
+
+class PineTimeSimpleWeatherService : public QBLEService
+{
+ Q_OBJECT
+public:
+ static const char *UUID_SERVICE_SIMPLE_WEATHER;
+ static const char *UUID_CHARACTERISTIC_SIMPLE_WEATHER_DATA;
+
+ explicit PineTimeSimpleWeatherService(const QString &path, QObject *parent);
+
+
+ void sendWeather(CurrentWeather *weather);
+
+ enum class WeatherIcons {
+ ClearSky = 0,
+ FewClouds = 1,
+ ScatteredClouds = 2,
+ BrokenClouds = 3,
+ ShowerRain = 4,
+ Rain = 5,
+ Thunderstorm = 6,
+ Snow = 7,
+ Mist = 8,
+ Unknown = 255 // for any icon not listed above
+ };
+
+ Q_ENUM(WeatherIcons)
+
+ WeatherIcons iconToEnum(const QString& iconName);
+
+};
+
+#endif // #define PINETIMESIMPLEWEATHERSERVICE_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/transliterator.cpp
^
|
@@ -0,0 +1,130 @@
+#include "transliterator.h"
+#include <unicode/unistr.h>
+#include <unicode/translit.h>
+#include <QDebug>
+
+QString Transliterator::convert(const QString& input) {
+ UErrorCode status = U_ZERO_ERROR;
+ icu::UnicodeString uInput = icu::UnicodeString::fromUTF8(icu::StringPiece(input.toUtf8().constData()));
+
+ if (U_FAILURE(status)) {
+ qWarning() << "Transliterator creation failed: " << u_errorName(status);
+ return input;
+ }
+
+ icu::Transliterator* translit = icu::Transliterator::createInstance("Any-Latin; Latin-ASCII", UTRANS_FORWARD, status);
+
+ if (U_FAILURE(status)) {
+ qWarning() << "Transliterator creation failed: " << u_errorName(status);
+ delete translit;
+ return input;
+ }
+
+ translit->transliterate(uInput);
+ delete translit;
+
+ std::string str_result;
+ uInput.toUTF8String(str_result);
+
+ return replaceEmojis(QString::fromStdString(str_result));
+}
+
+
+QString Transliterator::replaceEmojis(const QString &input) {
+ const QMap<QString, QString> emojiTransliterator = {
+ {"\xE2\x9D\xA4", "<3"}, // ❤ heart
+ {"\xE2\x98\xB9", ":-("}, // ☹ frowning_face
+ {"\xF0\x9F\x91\x8D", ":thumbs-up:"}, // 👍 thumbs-up
+ {"\xF0\x9F\x91\x8E", ":thumbs-down:"}, // 👎 thumbs-down
+ {"\xF0\x9F\x91\x8F", ":clap:"}, // 👏 clap
+ {"\xF0\x9F\x94\xA5", ":fire:"}, // 🔥 fire
+ {"\xF0\x9F\x99\x8F", ":praying:"}, // 🙏 praying
+ {"\xF0\x9F\x98\x94", ":think:"}, // 😔 pensive
+ {"\xF0\x9F\x91\x89", ":point:"}, // 👉 point
+ {"\xF0\x9F\x91\x8B", ":wave:"}, // 👋 wave
+ {"\xF0\x9F\x8E\x89", ":party:"}, // 🎉 party
+ {"\xF0\x9F\x98\x8D", ":heart_eyes:"}, // 😍 heart_eyes
+ {"\xF0\x9F\xA4\x94", ":thinking:"}, // 🤔 thinking
+ {"\xF0\x9F\x98\x80", ":-D"}, // 😀 grinning
+ {"\xF0\x9F\x98\x81", ":-D"}, // 😁 grinning_face_with_smiling_eyes
+ {"\xF0\x9F\x98\x82", ":'D"}, // 😂 face_with_tears_of_joy
+ {"\xF0\x9F\x98\x83", ":-D"}, // 😃 smiling_face_with_open_mouth
+ {"\xF0\x9F\x98\x84", ":-D"}, // 😄 smiling_face_with_open_mouth_and_smiling_eyes
+ {"\xF0\x9F\x98\x85", ":'D"}, // 😅 smiling_face_with_open_mouth_and_cold_sweat
+ {"\xF0\x9F\x98\x86", "X-D"}, // 😆 smiling_face_with_open_mouth_and_tightly-closed_eyes
+ {"\xF0\x9F\x98\x87", "O:-)"}, // 😇 innocent
+ {"\xF0\x9F\x98\x89", ";-)"}, // 😉 wink
+ {"\xF0\x9F\x98\x8A", ":-)"}, // 😊 blush
+ {"\xF0\x9F\x98\x8B", ":-p"}, // 😋 yum
+ {"\xF0\x9F\x98\x8E", "B-)"}, // 😎 sunglasses
+ {"\xF0\x9F\x98\x95", ":-/"}, // 😕 confused
+ {"\xF0\x9F\x98\x96", ":-S"}, // 😖 confounded_face
+ {"\xF0\x9F\x98\x97", ":*"}, // 😗 kissing_face
+ {"\xF0\x9F\x98\x98", ";-*"}, // 😘 face_throwing_a_kiss
+ {"\xF0\x9F\x98\x99", ":-*"}, // 😙 kissing_face_with_smiling_eyes
+ {"\xF0\x9F\x98\x9A", ":-*"}, // 😚 kissing_closed_eyes
+ {"\xF0\x9F\x98\x9B", ":-P"}, // 😛 stuck_out_tongue
+ {"\xF0\x9F\x98\x9C", ";-P"}, // 😜 stuck_out_tongue_winking_eye
+ {"\xF0\x9F\x98\x9D", "X-P"}, // 😝 stuck_out_tongue_and_tightly-closed_eyes
+ {"\xF0\x9F\x98\x9E", ":-S"}, // 😞 disappointed
+ {"\xF0\x9F\x98\xA0", ":-@"}, // 😠 angry_face
+ {"\xF0\x9F\x98\xA1", ":-@"}, // 😡 pouting_face
+ {"\xF0\x9F\x98\xA2", ":'("}, // 😢 cry
+ {"\xF0\x9F\x98\xA3", ":'("}, // 😣 persevering_face
+ {"\xF0\x9F\x98\xA4", ":-O"}, // 😤 face_with_steam_from_nose
+ {"\xF0\x9F\x98\xA5", ":'O"}, // 😥 face_with_cold_sweat
+ {"\xF0\x9F\x98\xA8", ":-O"}, // 😨 fearful
+ {"\xF0\x9F\x98\xA9", ":-O"}, // 😩 weary_face
+ {"\xF0\x9F\x98\xAA", ":'("}, // 😪 sleepy_face
+ {"\xF0\x9F\x98\xAB", ":-|"}, // 😫 tired_face
+ {"\xF0\x9F\x98\xAC", ":-|"}, // 😬 grimacing_face
+ {"\xF0\x9F\x98\xAD", ":'("}, // 😭 loudly_crying_face
+ {"\xF0\x9F\x98\xAE", ":-O"}, // 😮 face_with_open_mouth
+ {"\xF0\x9F\x98\xAF", ":-/"}, // 😯 hushed_face
+ {"\xF0\x9F\x98\xB0", ":-/"}, // 😰 face_with_open_mouth_and_cold_sweat
+ {"\xF0\x9F\x98\xB1", ":-O"}, // 😱 face_screaming_in_fear
+ {"\xF0\x9F\x98\xB2", ":-/"}, // 😲 astonished_face
+ {"\xF0\x9F\x98\xB3", ":-S"}, // 😳 flushed_face
+ {"\xF0\x9F\x98\xB4", ":-S"}, // 😴 sleeping_face
+ {"\xF0\x9F\x98\xB5", ":-P"}, // 😵 dizzy_face
+ {"\xF0\x9F\x98\xB7", ":-x"}, // 😷 face_with_medical_mask
+ {"\xF0\x9F\x98\xB8", "O.o"}, // 😸 grinning_cat_face_with_smiling_eyes
+ {"\xF0\x9F\x98\xB9", ":-)"}, // 😹 cat_face_with_tears_of_joy
+ {"\xF0\x9F\x98\xBA", ":-("}, // 😺 grinning_cat_face
+ {"\xF0\x9F\x98\xBB", ":-D"}, // 😻 heart_eyes_cat
+ {"\xF0\x9F\x98\xBC", ":'-("}, // 😼 cat_face_with_wry_smile
+ {"\xF0\x9F\x98\xBD", ":'("}, // 😽 kissing_cat_face
+ {"\xF0\x9F\x98\xBE", ":-@"}, // 😾 pouting_cat_face
+ {"\xF0\x9F\x98\xBF", ":-@"}, // 😿 crying_cat_face
+ {"\xF0\x9F\x99\x80", "O.O"}, // 🙀 screaming_cat_face
+ {"\xF0\x9F\x99\x83", "(-:"}, // 🙃 upside-down_face
+ {"\xF0\x9F\x91\x8C", ":ok:"}, // 👌 OK_hand
+ };
+ QString output(input);
+ for (auto it = emojiTransliterator.begin(); it != emojiTransliterator.end(); ++it) {
+ output.replace(it.key(), it.value());
+ }
+ return output;
+}
+
+void Transliterator::test() {
+
+ QStringList inputStrings = {
+ "The quick brown fox jumps over the lazy dog.", // English
+ "Φάλαινα ψηλά στη ζουμπούλια ξεφτιλίζει κυρά Κλίτσα.", // Greek
+ "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.", // German
+ "Albert edward kyllikki soili jalmari viktor suomela si jönsson.", // Finnish
+ "Frida var den skönaste kvinnan på Gotland.", // Swedish
+ "Příliš žluťoučký kůň úpěl ďábelské ódy", // Czech
+ "Звонко чепуху щеголя прямо фьордом с экземплярами живых бегемотов.", // Russian
+ "❤🙃😂😍👍🙏👏🔥👉🤔😁👌", // emojis
+ };
+
+ // Iterate through the input strings and transliterate each one
+ foreach (const QString& input, inputStrings) {
+ QString transliterated = Transliterator::convert(input);
+ qDebug() << input
+ << "\n >>>" << transliterated;
+ }
+
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/transliterator.h
^
|
@@ -0,0 +1,13 @@
+#ifndef TRANSLITERATOR_H
+#define TRANSLITERATOR_H
+
+#include <QString>
+
+class Transliterator {
+public:
+ static QString convert(const QString& input);
+ static QString replaceEmojis(const QString& input);
+ static void test();
+};
+
+#endif // TRANSLITERATOR_H
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/typeconversion.cpp
^
|
@@ -25,6 +25,23 @@
return QByteArray(1, val & 0xff) + QByteArray(1, ((val >> 8) & 0xff)) + QByteArray(1, ((val >> 16) & 0xff)) + QByteArray(1, ((val >> 24) & 0xff));
}
+QByteArray fromInt64(long long int val)
+{
+ QByteArray ret = QByteArray(1, val & 0xff)
+ + QByteArray(1, ((val >> 8) & 0xff))
+ + QByteArray(1, ((val >> 16) & 0xff))
+ + QByteArray(1, ((val >> 24) & 0xff))
+ + QByteArray(1, ((val >> 32) & 0xff))
+ + QByteArray(1, ((val >> 40) & 0xff))
+ + QByteArray(1, ((val >> 48) & 0xff))
+ + QByteArray(1, ((val >> 56) & 0xff));
+
+ qDebug() << "Converting int64 to char" << val << " " << ret.toHex();
+
+ return ret;
+}
+
+
QByteArray dateTimeToBytes(const QDateTime &dt, int format, bool adjustForTZ)
{
QByteArray ret;
@@ -129,7 +146,6 @@
return (val1 & 0xff) | ((val2 & 0xff) << 8);
}
-
int toUint32(char val1, char val2, char val3, char val4) {
return (val1 & 0xff) | ((val2 & 0xff) << 8) | ((val3 & 0xff) << 16) | ((val4 & 0xff) << 24);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/daemon/src/typeconversion.h
^
|
@@ -9,6 +9,7 @@
QByteArray fromInt16(int val);
QByteArray fromInt24(int val);
QByteArray fromInt32(int val);
+QByteArray fromInt64(long long int val);
QDateTime rawBytesToDateTime(const QByteArray &value, bool honorDeviceTimeOffset);
QByteArray dateTimeToBytes(const QDateTime &dt, int format, bool adjustForTZ = true);
int toUint16(char val1, char val2);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/documentation/build-instructions.md
^
|
@@ -1,4 +1,6 @@
-# This instruction guide is written for the SailfishOS SDK and Ubuntu 20.04 LTS, but may be also available for other Linux distributions, with some changes.
+# Build Instructions
+
+This instruction guide is written for the SailfishOS SDK and Debian based distributions including Ubuntu Touch, but may be also available for other Linux distributions, with some changes.
## SailfishOS SDK
@@ -11,7 +13,7 @@
Use the `sb2-config` command to make your ARM target the default
Add this repo which provides KF5 packages
-`sb2 -R zypper ar http://repo.merproject.org/obs/home:/piggz:/kf5/sailfishos_3.4.0.24/ piggz`
+`sb2 -R zypper ar http://repo.merproject.org/obs/home:/piggz:/kf5/sailfish_latest_aarch64/ piggz`
and
`sb2 -R zypper refresh`
@@ -20,10 +22,7 @@
To install missing packages, as pointed out by build errors, use:
```
-sb2 -R zypper in kcoreaddons-devel
-sb2 -R zypper in kdb-devel
-sb2 -R zypper in libKDb3-3
-sb2 -R zypper in mkcal-qt5-devel
+sb2 -R zypper in kcoreaddons-devel kdb-devel libKDb3-3 mkcal-qt5-devel libicu-devel
```
etc as pointed out by build errors.
@@ -132,3 +131,22 @@
systemctl --user enable harbour-amazfish
systemctl --user start harbour-amazfish
```
+
+## Ubuntu Touch
+
+Clickable is used to build this app for Ubuntu Touch, see [install instructions](https://clickable-ut.dev/en/latest/install.html).
+To build and run the application in Desktop Mode for testing the UI, use the following commands:
+
+```
+clickable build --libs
+clickable desktop
+```
+
+To build the application for ARM architecture and install it on your device, follow these steps:
+
+```
+clickable build --libs --app --arch detect --skip-review
+clickable install
+```
+
+If you do not have a device connected, you can specify the target architecture as `--arch arm64` or `--arch armhf` instead.
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/harbour-amazfish.pro
^
|
@@ -1,8 +1,12 @@
TEMPLATE = subdirs
-CONFIG = ordered
+CONFIG += ordered
SUBDIRS = lib daemon ui
+CONFIG(click) {
+ SUBDIRS += click
+}
+
DISTFILES += \
rpm/harbour-amazfish.changes.in \
rpm/harbour-amazfish.changes.run.in \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/lib/src/amazfishconfig.cpp
^
|
@@ -1,67 +1,67 @@
-#include "amazfishconfig.h"
-
-#include <QCoreApplication>
-
-#ifdef MER_EDITION_SAILFISH
-#include <MDConfGroup>
-#endif
-
-#include <functional>
-
-
-AmazfishConfig::AmazfishConfig(QObject *parent)
- : QObject(parent)
-#ifdef MER_EDITION_SAILFISH
- , m_group(new MDConfGroup(QStringLiteral("/uk/co/piggz/amazfish"), this))
-#endif
-{
-
-}
-
-AmazfishConfig *AmazfishConfig::instance()
-{
- static AmazfishConfig *inst = nullptr;
- if (!inst) {
- inst = new AmazfishConfig(qApp);
- }
- return inst;
-}
-
-QVariant AmazfishConfig::value(const QString &key, const QVariant &def) const
-{
-#ifdef MER_EDITION_SAILFISH
- return m_group->value(key, def);
-#else
- QSettings settings;
- return settings.value(key, def);
-#endif
-}
-
-void AmazfishConfig::setValue(const QString &key, const QVariant &value)
-{
-#ifdef MER_EDITION_SAILFISH
- m_group->setValue(key, value);
-#else
- QSettings settings;
- settings.setValue(key, value);
-#endif
-}
-
-void AmazfishConfig::setValue(const QString &key, const QVariant &value, signal_ptr signal)
-{
-#ifdef MER_EDITION_SAILFISH
- auto prev = m_group->value(key);
-#else
- QSettings settings;
- auto prev = settings.value(key);
-#endif
-
- if (value != prev) {
-#ifdef MER_EDITION_SAILFISH
- m_group->setValue(key, value);
-#else
- settings.setValue(key, value);
-#endif
- emit std::bind(signal, this)();
- }
-}
+#include "amazfishconfig.h"
+
+#include <QCoreApplication>
+
+#ifdef MER_EDITION_SAILFISH
+#include <MDConfGroup>
+#endif
+
+#include <functional>
+
+
+AmazfishConfig::AmazfishConfig(QObject *parent)
+ : QObject(parent)
+#ifdef MER_EDITION_SAILFISH
+ , m_group(new MDConfGroup(QStringLiteral("/uk/co/piggz/amazfish"), this))
+#endif
+{
+
+}
+
+AmazfishConfig *AmazfishConfig::instance()
+{
+ static AmazfishConfig *inst = nullptr;
+ if (!inst) {
+ inst = new AmazfishConfig(qApp);
+ }
+ return inst;
+}
+
+QVariant AmazfishConfig::value(const QString &key, const QVariant &def) const
+{
+#ifdef MER_EDITION_SAILFISH
+ return m_group->value(key, def);
+#else
+ QSettings settings;
+ return settings.value(key, def);
+#endif
+}
+
+void AmazfishConfig::setValue(const QString &key, const QVariant &value)
+{
+#ifdef MER_EDITION_SAILFISH
+ m_group->setValue(key, value);
+#else
+ QSettings settings;
+ settings.setValue(key, value);
+#endif
+}
+
+void AmazfishConfig::setValue(const QString &key, const QVariant &value, signal_ptr signal)
+{
+#ifdef MER_EDITION_SAILFISH
+ auto prev = m_group->value(key);
+#else
+ QSettings settings;
+ auto prev = settings.value(key);
+#endif
+
+ if (value != prev) {
+#ifdef MER_EDITION_SAILFISH
+ m_group->setValue(key, value);
+#else
+ settings.setValue(key, value);
+#endif
+ emit std::bind(signal, this)();
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/lib/src/amazfishconfig.h
^
|
@@ -1,188 +1,198 @@
-#ifndef AMAZFISHCONFIG_H
-#define AMAZFISHCONFIG_H
-
-#include <QObject>
-#include <QVariant>
-#include <QDate>
-
-#ifdef MER_EDITION_SAILFISH
-class MDConfGroup;
-#else
-#include <QSettings>
-#endif
-class QQmlEngine;
-class QJSEngine;
-
-#define OPTION(key, name, setter, def, type, gettertype, settertype) \
- Q_PROPERTY(type name READ name WRITE setter NOTIFY name##Changed) \
- type name() const \
- { return value(key, def).gettertype(); } \
- void setter(settertype value) \
- { setValue(key, value, &AmazfishConfig::name##Changed); } \
- Q_SIGNAL void name##Changed();
-
-#define BOOL_OPTION(key, name, setter, def) \
- OPTION(key, name, setter, def, bool, toBool, bool)
-
-#define INT_OPTION(key, name, setter, def) \
- OPTION(key, name, setter, def, int, toInt, int)
-
-#define UINT_OPTION(key, name, setter, def) \
- OPTION(key, name, setter, def, uint, toInt, uint)
-
-#define INT64_OPTION(key, name, setter, def) \
- OPTION(key, name, setter, def, qint64, toLongLong, qint64)
-
-#define STRING_OPTION(key, name, setter, def) \
- OPTION(key, name, setter, def, QString, toString, const QString &)
-
-#define ENUM_OPTION(key, name, setter, type, def) \
- Q_PROPERTY(type name READ name WRITE setter NOTIFY name##Changed) \
- type name() const \
- { return static_cast<type>(value(key, def).toInt()); } \
- void setter(type value) \
- { setValue(key, static_cast<int>(value), &AmazfishConfig::name##Changed); } \
- Q_SIGNAL void name##Changed();
-
-#define ALARM_OPTION(key, name, setter, type, def, gettertype) \
- Q_INVOKABLE type name(quint8 n) const \
- { return value(key.arg(n), def).gettertype(); } \
- Q_INVOKABLE void setter(quint8 n, type value) \
- { setValue(key.arg(n), value); }
-
-
-class AmazfishConfig : public QObject
-{
- Q_OBJECT
-
- AmazfishConfig(QObject *parent = nullptr);
-
-public:
- enum DeviceLanguage {
- DeviceLanguageEnUs,
- DeviceLanguageEsEs,
- DeviceLanguageZhCn,
- DeviceLanguageZhTw,
- DeviceLanguageRuRu,
- DeviceLanguageDeDe,
- DeviceLanguageItIt,
- DeviceLanguageFrFr,
- DeviceLanguageTrTr,
- };
- Q_ENUM(DeviceLanguage)
-
- enum DeviceDateFormat {
- DeviceDateFormatTime,
- DeviceDateFormatDateTime,
- };
- Q_ENUM(DeviceDateFormat)
-
- enum DeviceTimeFormat {
- DeviceTimeFormat24H,
- DeviceTimeFormat12H,
- };
- Q_ENUM(DeviceTimeFormat)
-
- enum DeviceDistanceUnit {
- DeviceDistanceUnitMetric,
- DeviceDistanceUnitImperial,
- };
- Q_ENUM(DeviceDistanceUnit)
-
- enum ProfileGender {
- ProfileGenderMale,
- ProfileGenderFemale,
- };
- Q_ENUM(ProfileGender)
-
- enum WearLocation {
- WearLocationLeftWrist,
- WearLocationRightWrist,
- };
- Q_ENUM(WearLocation)
-
- static AmazfishConfig *instance();
- static QObject *qmlInstance(QQmlEngine *engine, QJSEngine *scriptEngine)
- {
- Q_UNUSED(engine)
- Q_UNUSED(scriptEngine)
- return instance();
- }
-
- QVariant value(const QString &key, const QVariant &def = QVariant()) const;
- void setValue(const QString &key, const QVariant &value);
-
- STRING_OPTION(QStringLiteral("pairedAddress"), pairedAddress, setPairedAddress, QString())
- STRING_OPTION(QStringLiteral("pairedName"), pairedName, setPairedName, QString())
-
- BOOL_OPTION(QStringLiteral("app/notifyconnect"), appNotifyConnect, setAppNotifyConnect, true)
- BOOL_OPTION(QStringLiteral("app/autosyncdata"), appAutoSyncData, setAppAutoSyncData, true)
- BOOL_OPTION(QStringLiteral("app/notifylowbattery"), appNotifyLowBattery, setAppNotifyLowBattery, true)
- BOOL_OPTION(QStringLiteral("app/overridefwcheck"), appOverrideFwCheck, setAppOverrideFwCheck, false)
- BOOL_OPTION(QStringLiteral("app/navigationnotification"), appNavigationNotification, setAppNavigationNotification, false)
- BOOL_OPTION(QStringLiteral("app/simulateevents"), appSimulateEventSupport, setSimulateEventSupport, false)
-
- STRING_OPTION(QStringLiteral("app/button-double-action"), appButtonDoublePressAction, setAppButtonDoublePressAction, "action-none")
- STRING_OPTION(QStringLiteral("app/button-triple-action"), appButtonTriplePressAction, setAppButtonTriplePressAction, "action-none")
- STRING_OPTION(QStringLiteral("app/button-quad-action"), appButtonQuadPressAction, setAppButtonQuadPressAction, "action-none")
-
- STRING_OPTION(QStringLiteral("localAdapter"), localAdapter, setLocalAdapter, "/org/bluez/hci0")
-
- INT_OPTION(QStringLiteral("app/refreshweather"), appRefreshWeather, setAppRefreshWeather, 80)
- INT_OPTION(QStringLiteral("app/refreshcalendar"), appRefreshCalendar, setAppRefreshCalendar, 60)
-
- BOOL_OPTION(QStringLiteral("device/disconnectnotification"), deviceDisconnectNotification, setDeviceDisconnectNotification, false)
- BOOL_OPTION(QStringLiteral("device/displayweathershortcut"), deviceDisplayWeatherShortcut, setDeviceDisplayWeatherShortcut, true)
- BOOL_OPTION(QStringLiteral("device/displayalipayshortcut"), deviceDisplayAliPayShortcut, setDeviceDisplayAliPayShortcut, true)
- STRING_OPTION(QStringLiteral("device/displayitems"), deviceDisplayItems, setDeviceDisplayItems, "")
-
- ENUM_OPTION(QStringLiteral("device/language"), deviceLanguage, setDeviceLanguage, DeviceLanguage, DeviceLanguageEnUs)
- ENUM_OPTION(QStringLiteral("device/dateformat"), deviceDateFormat, setDeviceDateFormat, DeviceDateFormat, DeviceDateFormatTime)
- ENUM_OPTION(QStringLiteral("device/timeformat"), deviceTimeFormat, setDeviceTimeFormat, DeviceTimeFormat, DeviceTimeFormat24H)
- ENUM_OPTION(QStringLiteral("device/distanceunit"), deviceDistanceUnit, setDeviceDistanceUnit, DeviceDistanceUnit, DeviceDistanceUnitMetric)
-
- INT64_OPTION(QStringLiteral("device/lastactivitysyncmillis"), lastActivitySync, setLastActivitySync, 0)
- INT64_OPTION(QStringLiteral("device/lastsportsyncmillis"), lastSportSync, setLastSportSync, 0)
-
- STRING_OPTION(QStringLiteral("device/authkey"), deviceAuthKey, setDeviceAuthKey, QString())
-
- STRING_OPTION(QStringLiteral("profile/name"), profileName, setProfileName, QString())
- OPTION(QStringLiteral("profile/dob"), profileDOB, setProfileDOB, QDateTime(), QDateTime, toDateTime, const QDateTime &)
-
- ENUM_OPTION(QStringLiteral("profile/gender"), profileGender, setProfileGender, ProfileGender, ProfileGenderMale)
- ENUM_OPTION(QStringLiteral("profile/wearlocation"), profileWearLocation, setProfileWearLocation, WearLocation, WearLocationLeftWrist)
-
- UINT_OPTION(QStringLiteral("profile/height"), profileHeight, setProfileHeight, 200)
- UINT_OPTION(QStringLiteral("profile/weight"), profileWeight, setProfileWeight, 70)
- UINT_OPTION(QStringLiteral("profile/alldayhrm"), profileAllDayHRM, setProfileAllDayHRM, 0)
- UINT_OPTION(QStringLiteral("profile/fitnessgoal"), profileFitnessGoal, setProfileFitnessGoal, 10000)
-
- BOOL_OPTION(QStringLiteral("profile/alertfitnessgoal"), profileAlertFitnessGoal, setProfileAlertFitnessGoal, false)
- BOOL_OPTION(QStringLiteral("profile/hrmsleepsupport"), profileHRMSleepSupport, setProfileHRMSleepSupport, true)
- BOOL_OPTION(QStringLiteral("profile/displayonliftwrist"), profileDisplayOnLiftWrist, setProfileDisplayOnLiftWrist, false)
-
- ALARM_OPTION(QStringLiteral("alarms/alarm%1/enabled"), alarmEnabled, setAlarmEnabled, bool, false, toBool)
- ALARM_OPTION(QStringLiteral("alarms/alarm%1/repeat"), alarmRepeatMask, setAlarmRepeatMask, int, 0, toInt)
- ALARM_OPTION(QStringLiteral("alarms/alarm%1/hour"), alarmHour, setAlarmHour, int, 0, toInt)
- ALARM_OPTION(QStringLiteral("alarms/alarm%1/minute"), alarmMinute, setAlarmMinute, int, 0, toInt)
-
-private:
- using signal_ptr = void(AmazfishConfig::*)();
-
- void setValue(const QString &key, const QVariant &value, signal_ptr signal);
-
-#ifdef MER_EDITION_SAILFISH
- MDConfGroup *m_group;
-#endif
-};
-
-#undef ALARM_OPTION
-#undef ENUM_OPTION
-#undef STRING_OPTION
-#undef INT64_OPTION
-#undef UINT_OPTION
-#undef INT_OPTION
-#undef BOOL_OPTION
-#undef OPTION
-
-#endif // AMAZFISHCONFIG_H
+#ifndef AMAZFISHCONFIG_H
+#define AMAZFISHCONFIG_H
+
+#include <QObject>
+#include <QVariant>
+#include <QDate>
+
+#ifdef MER_EDITION_SAILFISH
+class MDConfGroup;
+#else
+#include <QSettings>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/lib/src/weather/currentweather.cpp
^
|
@@ -61,7 +61,7 @@
}
}
-int CurrentWeather::temperature() const
+qreal CurrentWeather::temperature() const
{
return m_temperature;
}
@@ -109,11 +109,21 @@
QJsonObject weather = object.value("weather").toArray().first().toObject();
m_weatherCode = weather.value("id").toVariant().toInt();
m_description = weather.value("description").toVariant().toString();
+ m_weatherIcon = weather.value("icon").toVariant().toString();
+
+ QJsonObject wind = object.value("wind").toArray().first().toObject();
+ m_windDeg = wind.value("wind_deg").toVariant().toDouble();
+ m_windSpeed = wind.value("wind_speed").toVariant().toDouble();
+ m_windGusts = wind.value("wind_gusts").toVariant().toDouble();
+
+ QJsonObject clouds = object.value("clouds").toArray().first().toObject();
+ m_clouds = clouds.value("all").toVariant().toInt();
QJsonObject main = object.value("main").toObject();
- m_temperature = int(main.value("temp").toDouble());
- m_minTemperature = int(main.value("temp_min").toDouble());
- m_maxTemperature = int(main.value("temp_max").toDouble());
+ m_temperature = main.value("temp").toDouble();
+ m_minTemperature = main.value("temp_min").toDouble();
+ m_maxTemperature = main.value("temp_max").toDouble();
+ m_humidity = main.value("humidity").toDouble();
}
void CurrentWeather::handleForecast(const QByteArray &reply)
@@ -152,27 +162,29 @@
QJsonObject weather = obj.value("weather").toArray().first().toObject();
+ QString weatherIcon = weather.value("icon").toVariant().toString();
+
int code = weather.value("id").toVariant().toInt();
QString desc = weather.value("description").toVariant().toString();
QJsonObject main = obj.value("main").toObject();
- int min_temp = int(main.value("temp_min").toDouble());
- int max_temp = int(main.value("temp_max").toDouble());
+ int min_temp = main.value("temp_min").toDouble();
+ int max_temp = main.value("temp_max").toDouble();
int wind_speed = 0;
f.setWindMaxSpeed(0);
f.setWindMinSpeed(255);
if (obj.contains("rain")) {
QJsonObject rain = obj.value("rain").toObject();
- total_rain += int(rain.value("3h").toDouble());
+ total_rain += rain.value("3h").toDouble();
}
if (obj.contains("snow")) {
QJsonObject snow = obj.value("snow").toObject();
- total_snow += int(snow.value("3h").toDouble());
+ total_snow += snow.value("3h").toDouble();
}
if (obj.contains("wind")) {
QJsonObject wind = obj.value("wind").toObject();
- wind_speed += int(wind.value("speed").toDouble());
+ wind_speed += wind.value("speed").toDouble();
}
qDebug() << "Forecast on " << dt << d << t << min_temp << max_temp << desc << code << "Hour:" << t.hour();
@@ -197,8 +209,9 @@
f.setDateTime(dt);
f.setDescription(desc);
f.setWeatherCode(code);
- f.setPressure(int(main.value("pressure").toDouble()));
- f.setHumidity(int(main.value("humidity").toDouble()));
+ f.setWeatherIcon(weatherIcon);
+ f.setPressure(main.value("pressure").toDouble());
+ f.setHumidity(main.value("humidity").toDouble());
}
if (max_temp > f.maxTemperature()){
f.setMaxTemperature(max_temp);
@@ -308,12 +321,42 @@
return m_weatherCode;
}
-int CurrentWeather::minTemperature() const
+QString CurrentWeather::weatherIcon() const
+{
+ return m_weatherIcon;
+}
+
+qreal CurrentWeather::windDeg() const
+{
+ return m_windDeg;
+}
+
+qreal CurrentWeather::windSpeed() const
+{
+ return m_windSpeed;
+}
+
+qreal CurrentWeather::windGusts() const
+{
+ return m_windGusts;
+}
+
+int CurrentWeather::humidity() const
+{
+ return m_humidity;
+}
+
+int CurrentWeather::clouds() const
+{
+ return m_clouds;
+}
+
+qreal CurrentWeather::minTemperature() const
{
return m_minTemperature;
}
-int CurrentWeather::maxTemperature() const
+qreal CurrentWeather::maxTemperature() const
{
return m_maxTemperature;
}
@@ -328,22 +371,33 @@
return m_description;
}
-int CurrentWeather::Forecast::minTemperature() const
+qreal CurrentWeather::Forecast::minTemperature() const
{
return m_minTemperature;
}
-void CurrentWeather::Forecast::setMinTemperature(int minTemperature)
+void CurrentWeather::Forecast::setMinTemperature(qreal minTemperature)
{
m_minTemperature = minTemperature;
}
-int CurrentWeather::Forecast::maxTemperature() const
+qreal CurrentWeather::Forecast::maxTemperature() const
{
return m_maxTemperature;
}
-void CurrentWeather::Forecast::setMaxTemperature(int maxTemperature)
+void CurrentWeather::Forecast::setWeatherIcon(QString _weatherIcon)
+{
+ m_weatherIcon = _weatherIcon;
+}
+
+QString CurrentWeather::Forecast::weatherIcon() const
+{
+ return m_weatherIcon;
+}
+
+
+void CurrentWeather::Forecast::setMaxTemperature(qreal maxTemperature)
{
m_maxTemperature = maxTemperature;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/lib/src/weather/currentweather.h
^
|
@@ -46,15 +46,18 @@
class Forecast {
public:
- int minTemperature() const;
- void setMinTemperature(int minTemperature);
+ qreal minTemperature() const;
+ void setMinTemperature(qreal minTemperature);
- int maxTemperature() const;
- void setMaxTemperature(int maxTemperature);
+ qreal maxTemperature() const;
+ void setMaxTemperature(qreal maxTemperature);
int weatherCode() const;
void setWeatherCode(int weatherCode);
+ QString weatherIcon() const;
+ void setWeatherIcon(QString weatherIcon);
+
void setDescription(const QString &description);
QString description() const;
@@ -86,9 +89,9 @@
void setWindDirection(uint8_t newWindDirection);
private:
- int m_temperature = 0;
- int m_minTemperature = 0;
- int m_maxTemperature = 0;
+ qreal m_temperature = 0;
+ qreal m_minTemperature = 0;
+ qreal m_maxTemperature = 0;
int m_weatherCode = 0;
QString m_description;
qlonglong m_dateTime = 0;
@@ -100,6 +103,7 @@
uint8_t m_snowMMDay = 0;
uint8_t m_humidity = 0;
uint8_t m_pressure = 0;
+ QString m_weatherIcon;
};
@@ -109,10 +113,29 @@
QString language() const;
void setLanguage(const QString &language);
- int temperature() const;
- int minTemperature() const;
- int maxTemperature() const;
+ Q_PROPERTY(qreal temperature READ temperature NOTIFY ready)
+ Q_PROPERTY(qreal minTemperature READ minTemperature NOTIFY ready)
+ Q_PROPERTY(qreal maxTemperature READ maxTemperature NOTIFY ready)
+ Q_PROPERTY(int weatherCode READ weatherCode NOTIFY ready)
+ Q_PROPERTY(QString weatherIcon READ weatherIcon NOTIFY ready)
+ Q_PROPERTY(qreal windDeg READ windDeg NOTIFY ready)
+ Q_PROPERTY(qreal windSpeed READ windSpeed NOTIFY ready)
+ Q_PROPERTY(qreal windGusts READ windGusts NOTIFY ready)
+ Q_PROPERTY(int humidity READ humidity NOTIFY ready)
+ Q_PROPERTY(int clouds READ clouds NOTIFY ready)
+
+
+ qreal temperature() const;
+ qreal minTemperature() const;
+ qreal maxTemperature() const;
int weatherCode() const;
+ QString weatherIcon() const;
+ qreal windDeg() const;
+ qreal windSpeed() const;
+ qreal windGusts() const;
+ int humidity() const;
+ int clouds() const;
+
QString description() const;
qlonglong dateTime() const;
@@ -139,10 +162,18 @@
City *m_city = nullptr;
QString m_language;
- int m_temperature = 0;
- int m_minTemperature = 0;
- int m_maxTemperature = 0;
+ qreal m_temperature = 0;
+ qreal m_minTemperature = 0;
+ qreal m_maxTemperature = 0;
int m_weatherCode = 0;
+ QString m_weatherIcon;
+
+ qreal m_windDeg = 0;
+ qreal m_windSpeed = 0;
+ qreal m_windGusts = 0;
+ int m_humidity = 0;
+ int m_clouds = 0;
+
QString m_description;
qlonglong m_dateTime = 0;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/resources/icon-m-heartrate2.svg
^
|
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="154.10893mm"
+ height="154.10893mm"
+ viewBox="0 0 154.10893 154.10893"
+ version="1.1"
+ id="svg1"
+ xml:space="preserve"
+ inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+ sodipodi:docname="icon-heartrate2.svg"
+ inkscape:export-filename="icon-heartrate2.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
+ id="namedview1"
+ pagecolor="#ffffff"
+ bordercolor="#000000"
+ borderopacity="0.25"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:document-units="mm"
+ inkscape:zoom="0.43885703"
+ inkscape:cx="-597.00536"
+ inkscape:cy="1025.3909"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="layer1" /><defs
+ id="defs1"><pattern
+ patternUnits="userSpaceOnUse"
+ width="64"
+ height="64"
+ patternTransform="scale(1)"
+ preserveAspectRatio="xMidYMid"
+ id="pattern1"><image
+ width="64"
+ height="64"
+ preserveAspectRatio="none"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAU3SURB VHic7Zrfb1RFFMc/p5RWKYYE0YI/kfJDX9TEXyEVE55IjKjPvvnqX+B/4D/gg2+iUAIx0Qo28cEf EYJIgTelUnFXkYDW+qtCoaXb48Od2d5u7507d3Z2xXg/SdPdnblnz3x3zsyZcy9UVFRUVPx/kViG VHUVcD9wJ7AG6AVmgL+AH0XkZoDNAWAQWA8MAPPAAjAFXA6x2UpbAqiqAFuBneZ/X07Xm0ANGAcm RGTRYbMHeBR4Btjs8HEBmATOGJsaMIRwAVT1QeBlYFPJS38BjojI9xk2twMvAhti2SyitADmF3oe GA653poBPgM+FZFFVV0N7AWeDrRnbZ4ExkSk4XtRqQEYR18BHinnWy4XgM+BFyg/k1w23/FdH7wF ML/8q8C2QMe6yXfAPp+Z0FPC6B7+G4OHxM89Ph29BFDVLcBz7Xj0L7DLLNROCgUwW91eIuYMDrwX Lw+s3058ZsA24i1QRUwClyLau8/M3lx8BGhnaypLDZiIbNPpv1MAVe0Ftkd1x00nBNhhdrBMimbA RvLT29hcB66Yv5mIdm/HEcJFAgxGdKSIuogsmpz+28i2c1PrIgHWRnbERS31OnYYrMtrKBJgVWRH XKQFuEBygoxF7hZeJMB8RCdc2PgHwOTx9Yj2b+Q1FAnwZ0QnXNTteV5V7zGfxVwHpvMaigS4HNEJ FzUAVe0HXjKfxRJASeoFmTgFEJHfgd8iOeLCxv8Q8ICqDpjvnopg+5KIXM1r9MkET0VwwkU6/odI Fqyt5n2MWfC1q9FHgNN0djGsp+p5Nm+3x+7zbdqeI6lD5lIogIhcp7OzwMb/GpLME5YE+AHHCu7B CeN/Lr4FkU+Im56msfH/EEv79TpVHTQVnclAu7+SlNuceAkgInPAISC3nB1IOv5bj632EPZNgN0G 8J5PXbDX16KI1FR1P3C3o1tfhs0ekjNF1qkyK/4tO4DjJGnx0TK+AlMictGnYxmjiMgEAXm62d9f JzmZpcmKf8tmVe0TkXngRNnv9KWUABZTHt8I9Lc0zbEyTKZFZE5VzwLPtrTZdHcLK/P1XmC3ql4k +1ygLF8gleSXX/AbxdKXhKAkd4Xu9eh7HBgDvmL5zRRX/Ft2l/DpJ+CtEv2BcmXxJkblEWDWo/tT qtovItMkpzxLPXWPcCjEjxRXgYNl7ghZggSAZpq8n+JK7m3Ak+Z1Op+oQ/MOsGthLaJBMvg/Qi4O FgBAROrABx5dh01d7hxL+YTd/7PivwyjIlIr7pZNWwIAiMgZilfp9cDDZsqP4xf/PnwhIqfbuL59 AQxjFGdsw+b/OFBLxX+oAOeAjwOvbRJFADOYg7iPr0OquklEZoBRAFVdS1j8XwEOhz4UkSbWDEBE bgD7gGuObsOm79/mfUj8zwIHTHreNtEEgObOcID8neFxVb0j9b7s9G+QDD5akSaqANDcGY7kNPeS PPtjKSvA++2s+FlEFwBARE4BX+Y071TV1WYm3FXC7DEROdu+d8sJTYV9+Aiz/bV8PgA8QbIV+sb/ eSKs+Fl0ZAZAc2c4TFKYaGUX/k+b/EyS6cWuRQBdeOhBVTcAr5E8PLmsyeP7rwFvhqa5PnRsBljM ISjrzFA0+AYw0snBQxcEgObOMFrysg9jr/hZdEUAAJOzn/TsfkxEnOXsWHRNAMNRimv9k3Roxc+i qwKYlfwQ2TsDJPfwRjq14mfR7Rlgb7S8zcozwyzwbqwc35euCwDLqkm2gGlX/G7ciL11UNXHVPUN Ve3mo3i3Fj6Ps1ZUVFRUVFR0hH8AwCZ8e7sYrrYAAAAASUVORK5CYII= "
+ id="image1"
+ x="0"
+ y="0" /></pattern><pattern
+ patternUnits="userSpaceOnUse"
+ width="64"
+ height="64"
+ patternTransform="scale(1)"
+ preserveAspectRatio="xMidYMid"
+ id="pattern1-4"><image
+ width="64"
+ height="64"
+ preserveAspectRatio="none"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAU3SURB VHic7Zrfb1RFFMc/p5RWKYYE0YI/kfJDX9TEXyEVE55IjKjPvvnqX+B/4D/gg2+iUAIx0Qo28cEf EYJIgTelUnFXkYDW+qtCoaXb48Od2d5u7507d3Z2xXg/SdPdnblnz3x3zsyZcy9UVFRUVPx/kViG VHUVcD9wJ7AG6AVmgL+AH0XkZoDNAWAQWA8MAPPAAjAFXA6x2UpbAqiqAFuBneZ/X07Xm0ANGAcm RGTRYbMHeBR4Btjs8HEBmATOGJsaMIRwAVT1QeBlYFPJS38BjojI9xk2twMvAhti2SyitADmF3oe GA653poBPgM+FZFFVV0N7AWeDrRnbZ4ExkSk4XtRqQEYR18BHinnWy4XgM+BFyg/k1w23/FdH7wF ML/8q8C2QMe6yXfAPp+Z0FPC6B7+G4OHxM89Ph29BFDVLcBz7Xj0L7DLLNROCgUwW91eIuYMDrwX Lw+s3058ZsA24i1QRUwClyLau8/M3lx8BGhnaypLDZiIbNPpv1MAVe0Ftkd1x00nBNhhdrBMimbA RvLT29hcB66Yv5mIdm/HEcJFAgxGdKSIuogsmpz+28i2c1PrIgHWRnbERS31OnYYrMtrKBJgVWRH XKQFuEBygoxF7hZeJMB8RCdc2PgHwOTx9Yj2b+Q1FAnwZ0QnXNTteV5V7zGfxVwHpvMaigS4HNEJ FzUAVe0HXjKfxRJASeoFmTgFEJHfgd8iOeLCxv8Q8ICqDpjvnopg+5KIXM1r9MkET0VwwkU6/odI Fqyt5n2MWfC1q9FHgNN0djGsp+p5Nm+3x+7zbdqeI6lD5lIogIhcp7OzwMb/GpLME5YE+AHHCu7B CeN/Lr4FkU+Im56msfH/EEv79TpVHTQVnclAu7+SlNuceAkgInPAISC3nB1IOv5bj632EPZNgN0G 8J5PXbDX16KI1FR1P3C3o1tfhs0ekjNF1qkyK/4tO4DjJGnx0TK+AlMictGnYxmjiMgEAXm62d9f JzmZpcmKf8tmVe0TkXngRNnv9KWUABZTHt8I9Lc0zbEyTKZFZE5VzwLPtrTZdHcLK/P1XmC3ql4k +1ygLF8gleSXX/AbxdKXhKAkd4Xu9eh7HBgDvmL5zRRX/Ft2l/DpJ+CtEv2BcmXxJkblEWDWo/tT qtovItMkpzxLPXWPcCjEjxRXgYNl7ghZggSAZpq8n+JK7m3Ak+Z1Op+oQ/MOsGthLaJBMvg/Qi4O FgBAROrABx5dh01d7hxL+YTd/7PivwyjIlIr7pZNWwIAiMgZilfp9cDDZsqP4xf/PnwhIqfbuL59 AQxjFGdsw+b/OFBLxX+oAOeAjwOvbRJFADOYg7iPr0OquklEZoBRAFVdS1j8XwEOhz4UkSbWDEBE bgD7gGuObsOm79/mfUj8zwIHTHreNtEEgObOcID8neFxVb0j9b7s9G+QDD5akSaqANDcGY7kNPeS PPtjKSvA++2s+FlEFwBARE4BX+Y071TV1WYm3FXC7DEROdu+d8sJTYV9+Aiz/bV8PgA8QbIV+sb/ eSKs+Fl0ZAZAc2c4TFKYaGUX/k+b/EyS6cWuRQBdeOhBVTcAr5E8PLmsyeP7rwFvhqa5PnRsBljM ISjrzFA0+AYw0snBQxcEgObOMFrysg9jr/hZdEUAAJOzn/TsfkxEnOXsWHRNAMNRimv9k3Roxc+i qwKYlfwQ2TsDJPfwRjq14mfR7Rlgb7S8zcozwyzwbqwc35euCwDLqkm2gGlX/G7ciL11UNXHVPUN Ve3mo3i3Fj6Ps1ZUVFRUVFR0hH8AwCZ8e7sYrrYAAAAASUVORK5CYII= "
+ id="image1-5"
+ x="0"
+ y="0" /></pattern></defs><g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-42.048328,-89.143082)"><path
+ id="path1"
+ style="fill:#808080;stroke-width:0.264583;fill-opacity:1"
+ d="m 91.127503,103.30656 c -2.251605,-0.0332 -4.52138,0.13456 -6.783565,0.5116 -18.229772,3.0427 -31.591354,18.81188 -31.591354,37.30625 v 1.53427 c 0,8.23728 2.561263,16.20698 7.236768,22.83581 l 39.073584,0.062 4.154264,0.007 1.49397,3.87677 8.47183,21.98418 13.92215,-59.20052 4.00027,-0.0863 9.34517,33.2388 40.56703,0.0651 c -7.9e-4,0.001 -0.001,0.002 -0.002,0.004 8.5e-4,-0.001 0.002,-0.002 0.003,-0.004 4.65223,-6.61847 7.20111,-14.56738 7.20111,-22.7831 v -1.53427 c 0,-18.49437 -13.36158,-34.26355 -31.59135,-37.30625 -12.06499,-2.01083 -24.34158,1.93157 -32.96698,10.55697 l -3.175,3.175 -3.175,-3.175 c -7.00815,-7.00814 -16.42646,-10.92481 -26.183417,-11.06857 z m 89.888057,62.13884 c -138.967232,-76.302318 -138.967232,-76.302318 0,0 z m -3.11041,3.86178 c -135.856822,-80.164098 -135.856822,-80.164098 0,0 z m -48.63269,-29.37495 -13.61777,57.90551 -4.04523,0.27647 -11.05256,-28.68094 -37.429239,-0.0594 c 0.709963,0.77618 1.443072,1.5344 2.218986,2.25671 l 47.810523,44.63552 c 1.98436,1.85208 4.63558,5.05396 7.36079,5.05396 2.7252,0 5.31233,-3.20188 7.29671,-5.05396 l 47.81052,-44.63552 c 0.79681,-0.74177 1.54911,-1.52073 2.27634,-2.31923 l -36.3616,-0.0584 -4.02611,-0.007 -1.08986,-3.87574 z m -69.270189,25.5788 c -17.953943,-76.367948 -17.953943,-76.367948 0,0 z m 3.123323,3.86075 c -21.077266,-80.228698 -21.077266,-80.228698 0,0 z"
+ sodipodi:nodetypes="scsscccccccccccsscscsscccccccccccsccccccccccc" /></g></svg>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/resources/icon-m-steps2.svg
^
|
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="250mm"
+ height="250mm"
+ viewBox="0 0 250 250"
+ version="1.1"
+ id="svg1"
+ inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+ sodipodi:docname="icon-m-steps2.svg"
+ inkscape:export-filename="icon-m-steps.png"
+ inkscape:export-xdpi="26.0096"
+ inkscape:export-ydpi="26.0096"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview1"
+ pagecolor="#ffffff"
+ bordercolor="#000000"
+ borderopacity="0.25"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:document-units="mm"
+ inkscape:zoom="0.70911897"
+ inkscape:cx="473.1223"
+ inkscape:cy="468.1866"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="layer1" />
+ <defs
+ id="defs1" />
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(20,-23.5)">
+ <g
+ transform="matrix(-0.26458333,0,0,0.26458333,192.54212,40.794475)"
+ id="g6"
+ style="fill:#808080;fill-opacity:1"
+ inkscape:export-filename="./g6.png"
+ inkscape:export-xdpi="26.0096"
+ inkscape:export-ydpi="26.0096">
+ <path
+ d="m 257.87,274.39 c 79.17,-8.33 65.87,-131.13 2.09,-164.58 -42.26,-22.161 -99.31,-21.193 -137.5,-6.25 -72.44,28.35 -91.669,64.58 -102.09,135.42 -10.413,70.83 24.49,258.2 108.34,279.16 75,18.75 103.94,-17.6 95.83,-52.08 -8.33,-35.42 -49.41,-81.29 -52.08,-112.5 -6.25,-72.92 85.41,-79.17 85.41,-79.17 z"
+ id="path1"
+ style="fill:#808080;fill-opacity:1" />
+ <path
+ d="m 398.94,101.5 c -21.21,30.8 -61.45,39.9 -89.88,20.33 -28.43,-19.58 -34.29,-60.414 -13.08,-91.214 21.21,-30.8 61.44,-39.898 89.88,-20.323 28.42,19.575 34.28,60.412 13.08,91.207 z"
+ id="path2"
+ style="fill:#808080;fill-opacity:1" />
+ <path
+ d="m 235.45,82.105 c -18.15,3.09 -35.28,-8.655 -38.28,-26.236 -2.99,-17.581 8.59,-44.006 26.74,-47.096 18.15,-3.092 35.29,8.655 38.28,26.236 3,17.581 -8.59,44.005 -26.74,47.096 z"
+ id="path3"
+ style="fill:#808080;fill-opacity:1" />
+ <path
+ d="m 176.6,69.41 c -10.28,14.576 -25.34,17.381 -40.38,6.774 -15.05,-10.607 -18.59,-40.858 -8.31,-55.435 10.28,-14.575 25.33,-17.38 40.38,-6.773 15.05,10.607 18.59,40.858 8.31,55.434 z"
+ id="path4"
+ style="fill:#808080;fill-opacity:1" />
+ <path
+ d="M 113.75,80.36 C 110.59,95.569 94.793,105.15 78.457,101.76 62.121,98.368 48.841,75.304 51.998,60.095 55.155,44.886 70.956,35.305 87.291,38.696 103.63,42.087 116.91,65.151 113.75,80.36 Z"
+ id="path5"
+ style="fill:#808080;fill-opacity:1" />
+ <path
+ d="M 47.389,102.14 C 56.68,116 54.914,133.46 43.446,141.15 31.978,148.84 15.15,143.84 5.859,129.98 -3.431,116.12 -1.665,98.657 9.803,90.969 21.271,83.281 38.099,88.281 47.389,102.14 Z"
+ id="path6"
+ style="fill:#808080;fill-opacity:1" />
+ </g>
+ <g
+ id="g1"
+ transform="translate(-178.88943,70.665246)"
+ style="fill:#808080;fill-opacity:1">
+ <path
+ d="m 264.57541,119.70278 c 20.94601,-2.20477 17.42784,-34.69481 0.55113,-43.545123 -11.18103,-5.863695 -26.27603,-5.607579 -36.38021,-1.653645 -19.16562,7.499614 -24.25329,17.087585 -27.00866,35.829878 -2.75537,18.74229 6.47964,68.31541 28.66495,73.86108 19.84375,4.96094 27.5008,-4.65852 25.35582,-13.78029 -2.20477,-9.37075 -13.07253,-21.50931 -13.7803,-29.76563 -1.65364,-19.29342 22.59807,-20.94706 22.59807,-20.94706 z"
+ id="path1-6"
+ style="stroke-width:0.264583;fill:#808080;fill-opacity:1" />
+ <path
+ d="m 301.90018,73.95897 c -5.61102,8.149167 -16.25758,10.55661 -23.77969,5.377392 -7.52237,-5.179219 -9.07177,-15.984009 -3.46075,-24.133175 5.61102,-8.149167 16.25733,-10.556346 23.77969,-5.377127 7.51946,5.181335 9.06992,15.986125 3.46075,24.133968 z"
+ id="path2-2"
+ style="stroke-width:0.264583;fill:#808080;fill-opacity:1" />
+ <path
+ d="m 258.64346,68.827376 c -4.80193,0.817563 -9.33662,-2.289968 -10.12878,-6.941608 -0.79243,-4.651639 2.27303,-11.643254 7.07469,-12.460816 4.80166,-0.818092 9.33662,2.289968 10.12878,6.941608 0.79216,4.651639 -2.27277,11.642989 -7.07496,12.460816 z"
+ id="path3-9"
+ style="stroke-width:0.264583;fill:#808080;fill-opacity:1" />
+ <path
+ d="m 243.07273,65.468491 c -2.71886,3.856567 -6.70296,4.598723 -10.68388,1.792287 -3.98092,-2.806435 -4.91728,-10.810345 -2.19842,-14.667176 2.71886,-3.856303 6.70269,-4.598459 10.68387,-1.792023 3.98198,2.806435 4.91861,10.810345 2.19869,14.666912 z"
+ id="path4-1"
+ style="stroke-width:0.264583;fill:#808080;fill-opacity:1" />
+ <path
+ d="m 226.44366,68.365678 c -0.83529,4.024048 -5.01597,6.559021 -9.3382,5.661819 -4.32223,-0.897202 -7.83564,-6.999817 -7.00035,-11.023864 0.83529,-4.024048 5.01597,-6.559021 9.33794,-5.661819 4.32197,0.897202 7.8367,6.999552 7.00061,11.0236 z"
+ id="path5-2"
+ style="stroke-width:0.264583;fill:#808080;fill-opacity:1" />
+ <path
+ d="m 208.88565,74.128303 c 2.45824,3.666332 1.99099,8.287809 -1.04325,10.32219 -3.03424,2.034116 -7.48665,0.7112 -9.9449,-2.955396 -2.45798,-3.666331 -1.99072,-8.287808 1.04352,-10.321925 3.03424,-2.034117 7.48665,-0.710935 9.94463,2.955925 z"
+ id="path6-7"
+ style="stroke-width:0.264583;fill:#808080;fill-opacity:1" />
+ </g>
+ </g>
+</svg>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/transifex.yml
^
|
@@ -0,0 +1,9 @@
+git:
+ filters:
+ - filter_type: file
+ # all supported i18n types: https://docs.transifex.com/formats
+ file_format: QT
+ source_language: en
+ source_file: ui/translations/harbour-amazfish-ui.ts
+ # path expression to translation files, must contain <lang> placeholder
+ translation_files_expression: 'ui/translations/harbour-amazfish-ui-<lang>.ts'
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/DateNavigation.qml
^
|
@@ -13,10 +13,14 @@
IconButtonPL {
id: btnPrev
iconName: styler.iconBackward
+ iconHeight: styler.themeIconSizeSmall
+ iconWidth: styler.themeIconSizeSmall
+
onClicked: {
backward();
}
}
+
LabelPL {
id: lblDay
Layout.fillWidth: true
@@ -28,6 +32,8 @@
IconButtonPL {
id: btnNext
iconName: styler.iconForward
+ iconHeight: styler.themeIconSizeSmall
+ iconWidth: styler.themeIconSizeSmall
onClicked: {
forward();
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/GraphData.qml
^
|
@@ -47,7 +47,7 @@
property bool scale: false
property color lineColor: styler.themeHighlightColor
- property real lineWidth: 1
+ property real lineWidth: 3
property real minY: 0 //Always 0
property real maxY: 0
@@ -233,7 +233,11 @@
//ctx.globalAlpha = 0.8;
//PGZ
- lineWidth = width / end;
+ if (graphType == bar) {
+ lineWidth = width / end;
+ } else {
+ stepX = width / end;
+ }
ctx.lineWidth = lineWidth;
ctx.beginPath();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.qtcontrols/BusyIndicatorPL.qml
^
|
@@ -18,8 +18,10 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
+import QtQuick.Layouts 1.12
BusyIndicator {
- anchors.centerIn: parent
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+// anchors.centerIn: parent
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.qtcontrols/ComboBoxPL.qml
^
|
@@ -32,6 +32,7 @@
property alias model: val.model
property alias label: lab.text
property alias value: val.currentText
+ property alias textRole: val.textRole
Label {
id: lab
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.qtcontrols/DatePickerDialogPL.qml
^
|
@@ -17,7 +17,7 @@
*/
import QtQuick 2.9
-import QtQuick.Controls 1.4
+import QtQuick.Controls 2.2
import "."
DialogPL {
@@ -29,10 +29,22 @@
height: childrenRect.height
width: parent.width
- Calendar {
+ TextField {
id: cal
+ property date selectedDate: new Date()
+
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(parent.width - 2*styler.themeHorizontalPageMargin, implicitWidth)
+ inputMethodHints: Qt.ImhDate
+ text: selectedDate.toISOString().split('T')[0]
+ inputMask:"0000-00-00;_"
+ onTextChanged: {
+ var d = new Date(text)
+ if (!isNaN(d)) {
+ selectedDate = d
+ }
+ }
+
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.qtcontrols/LabelPL.qml
^
|
@@ -18,8 +18,11 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
+import QtQuick.Layouts 1.12
Label {
+ Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
+
leftPadding: styler.themeHorizontalPageMargin
rightPadding: styler.themeHorizontalPageMargin
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/ClipboardPL.qml
^
|
@@ -17,7 +17,7 @@
*/
import QtQuick 2.0
-import Ubuntu.Components 1.3
+import Lomiri.Components 1.3
QtObject {
function copy(t) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/DatePickerDialogPL.qml
^
|
@@ -17,12 +17,27 @@
*/
import QtQuick 2.9
+import QtQuick.Controls 2.2
+import Lomiri.Components 1.3
+import Lomiri.Components.Pickers 1.3
import "."
DialogPL {
id: dialog
- property var date
+ property alias date: datePicker.date
+
+ Item {
+ height: childrenRect.height
+ width: parent.width
+
+ DatePicker {
+ id: datePicker
+ minimum: new Date(1900, 0)
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: Math.min(parent.width - 2*styler.themeHorizontalPageMargin, implicitWidth)
+ }
+
+ }
- Component.onCompleted: console.log("DatePickerDialog is not implemented for UUITK")
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/FileSelectorPL.qml
^
|
@@ -20,7 +20,7 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
-import Ubuntu.Content 1.3
+import Lomiri.Content 1.3
import "."
Page {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/IconButtonPL.qml
^
|
@@ -17,7 +17,7 @@
*/
import QtQuick 2.0
-import Ubuntu.Components 1.3
+import Lomiri.Components 1.3
import "."
Item {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/IconPL.qml
^
|
@@ -17,7 +17,7 @@
*/
import QtQuick 2.0
-import Ubuntu.Components 1.3
+import Lomiri.Components 1.3
Icon {
id: image
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/ListViewPL.qml
^
|
@@ -0,0 +1,4 @@
+import Lomiri.Components 1.3
+LomiriListView {
+// ScrollBar.vertical: ScrollBar {}
+}
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/README.md
^
|
@@ -1,5 +1,5 @@
UUITK implementation used in Ubuntu Touch. Its currently based on
-Ubuntu Components and QtControls platform.
+Lomiri Components and QtControls platform.
Recommended imports are
@@ -7,7 +7,7 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.2
-import Ubuntu.Components 1.3
+import Lomiri.Components 1.3
import "."
```
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/SearchFieldPL.qml
^
|
@@ -17,7 +17,7 @@
*/
import QtQuick 2.9
-import Ubuntu.Components 1.3
+import Lomiri.Components 1.3
import "."
TextField {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/StackPL.qml
^
|
@@ -79,6 +79,15 @@
return attached;
}
+ function pushMain(page, options) {
+ if (ps.depth > 1) {
+ attached = undefined;
+ hasAttached = false;
+ return ps.replace(ps.get(1), page, options);
+ }
+ return push(page, options);
+ }
+
function replace(page, options) {
return ps.replace(page, options ? options : {});
}
@@ -86,4 +95,8 @@
function showRoot() {
ps.currentIndex = 0;
}
+
+ function processCurrentItem() {
+ console.log("function processCurrentItem() dummy implementation")
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/StylerPL.qml
^
|
@@ -18,8 +18,8 @@
import QtQuick 2.0
import QtQuick.Window 2.2
-import Ubuntu.Components 1.3
-import Ubuntu.Components.Themes 1.3
+import Lomiri.Components 1.3
+import Lomiri.Components.Themes 1.3
QtObject {
// font sizes and family
@@ -45,7 +45,7 @@
// navigation items, secondary
property color themeSecondaryColor: theme.palette.normal.baseText
// descriptive items, secondary
- property color themeSecondaryHighlightColor: theme.palette.normal.backgroundSecondaryText
+ property color themeSecondaryHighlightColor: theme.palette.normal.activity;
// button sizes
property real themeButtonWidthLarge: units.gridUnit*32
@@ -55,19 +55,32 @@
property real themeIconSizeLarge: units.gridUnit*7
property real themeIconSizeMedium: units.gridUnit*5
property real themeIconSizeSmall: units.gridUnit*4
+
// used icons
// used icons
+ property string iconBluetooth: "image://theme/bluetooth-active"
+ property string iconBattery: "image://theme/battery-good-symbolic"
+ property string iconSteps: "../../pics/custom-icons/icon-m-steps2.png"
+ property string iconHeartrate: "../../pics/custom-icons/icon-m-heartrate2.png"
+ property string iconDeviceScan: "image://theme/toolkit_input-search"
+
+
+ property string iconStravaLogin: "image://theme/user-admin"
+ property string iconUploadToStrava: "image://theme/share"
+ property string iconDownloadData: "image://theme/transfer-progress-download"
property string iconAbout: "image://theme/info" //Qt.resolvedUrl("../../icons/help-about-symbolic.svg")
property string iconBack: "image://theme/back" //Qt.resolvedUrl("../../icons/go-previous-symbolic.svg")
- property string iconClear: "image://theme/edit-delete" //Qt.resolvedUrl("../../icons/edit-clear-all-symbolic.svg")
+ property string iconBackward: "image://theme/back"
+ property string iconClear: "image://theme/edit-delete" //Qt.resolvedUrl("../../icons/edit-delete-symbolic.svg")
property string iconClose: "image://theme/close" //Qt.resolvedUrl("../../icons/window-close-symbolic.svg")
property string iconDelete: "image://theme/delete" //Qt.resolvedUrl("../../icons/edit-delete-symbolic.svg")
property string iconDot: "image://theme/gps" //Qt.resolvedUrl("../../icons/find-location-symbolic.svg")
property string iconDown: "image://theme/down" //Qt.resolvedUrl("../../icons/go-down-symbolic.svg")
property string iconEdit: "image://theme/edit" //Qt.resolvedUrl("../../icons/document-edit-symbolic.svg")
property string iconEditClear: "image://theme/edit-clear" //Qt.resolvedUrl("../../icons/edit-clear-symbolic.svg")
+ property string iconEmail: "image://theme/mail"
property string iconFavorite: Qt.resolvedUrl("../icons/uuitk/bookmark-new-symbolic.svg")
- property string iconFavoriteSelected: Qt.resolvedUrl("../icons/uuitk/user-bookmarks-symbolic.svg")
+// property string iconFavoriteSelected: Qt.resolvedUrl("../icons/uuitk/user-bookmarks-symbolic.svg")
property string iconForward: "image://theme/next" //Qt.resolvedUrl("../../icons/go-next-symbolic.svg")
property string iconManeuvers: "image://theme/media-playlist-shuffle" //Qt.resolvedUrl("../../icons/maneuvers-symbolic.svg")
property string iconMaps: Qt.resolvedUrl("../icons/uuitk/map-layers-symbolic.svg")
@@ -90,8 +103,20 @@
property string iconShortlistedSelected: "image://theme/select" //Qt.resolvedUrl("../../icons/shortlist-selected-symbolic.svg")
property string iconStart: "image://theme/media-playback-start" //Qt.resolvedUrl("../../icons/media-playback-start-symbolic.svg")
property string iconStop: "image://theme/media-playback-stop" //Qt.resolvedUrl("../../icons/media-playback-stop-symbolic.svg")
+ property string iconUp: "image://theme/up"
property string iconWebLink: "image://theme/stock_website" //Qt.resolvedUrl("../../icons/web-browser-symbolic.svg")
+ property string iconContact: "image://theme/preferences-desktop-accounts-symbolic" // "User Settings"
+ property string iconWatch: "image://theme/smartwatch-symbolic" // "Device settings"
+ property string iconLevels: "image://theme/settings" // "Application settings"
+ property string iconAlarm: "image://theme/alarm" // "Alarms"
+ property string iconWeather: "image://theme/weather-app-symbolic" // "Weather"
+ property string iconStrava: "image://theme/transfer-progress" // "Strava"
+ property string iconDiagnostic: "image://theme/info" // "Debug Info"
+ property string iconFavoriteSelected: "image://theme/bookmark" // "Donate"
+
+ property string customIconPrefix: "../../pics/custom-icons/"
+
// item sizes
property real themeItemSizeLarge: themeFontSizeLarge * 3
property real themeItemSizeSmall: themeFontSizeMedium * 3
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/TextAreaPL.qml
^
|
@@ -17,7 +17,7 @@
*/
import QtQuick 2.9
-import Ubuntu.Components 1.3 as UC
+import Lomiri.Components 1.3 as UC
UC.TextArea {
anchors.left: parent.left
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/components/platform.uuitk/TextFieldPL.qml
^
|
@@ -18,7 +18,7 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
-import Ubuntu.Components 1.3 as UC
+import Lomiri.Components 1.3 as UC
Item {
id: row
|
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/custom-icons/icon-m-heartrate2.png
^
|
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/custom-icons/icon-m-steps2.png
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/AddCityPage.qml
^
|
@@ -9,6 +9,45 @@
property CityManager cityManager
+ property string currentCity: (cityManager !== null) &&
+ (cityManager.cities.length > 0) ? (cityManager.cities[0].name + ", " + cityManager.cities[0].country ) : ''
+
+ CurrentWeather {
+ id: weather
+ }
+
+ function owmIconToLocal(omw) {
+ const weatherIcons = {
+ '01d': 'weather-clear.png',
+ '01n': 'weather-clear-night.png',
+ '02d': 'weather-few-clouds.png',
+ '02n': 'weather-few-clouds-night.png',
+ '03d': 'weather-clouds.png',
+ '03n': 'weather-clouds-night.png',
+ '04d': 'weather-many-clouds.png',
+ '04n': 'weather-many-clouds.png', // Assuming night uses the same icon for "many clouds"
+ '09d': 'weather-showers.png',
+ '09n': 'weather-showers-night.png',
+ '10d': 'weather-showers-scattered-day.png',
+ '10n': 'weather-showers-scattered-night.png',
+ '11d': 'weather-storm-day.png',
+ '11n': 'weather-storm-night.png',
+ '13d': 'weather-snow.png',
+ '13n': 'weather-snow-scattered-night.png', // Assuming scattered snow at night for 13n
+ '50d': 'weather-mist.png',
+ '50n': 'weather-mist.png' // Assuming night uses the same icon for "mist"
+ };
+ return "../pics/" + weatherIcons[omw];
+ }
+
+ onCurrentCityChanged: {
+ if ((cityManager == null) || (cityManager.cities.length <= 0)) {
+ return
+ }
+ weather.setCity(cityManager.cities[0])
+ weather.refresh()
+ }
+
Column {
id: column
anchors.fill: parent
@@ -19,6 +58,28 @@
id: citymodel
}
+
+ Row {
+ width: parent.width - (2 * anchors.margins)
+ LabelPL {
+ text: page.currentCity
+ width: parent.width * 0.75
+ }
+
+ LabelPL {
+ id: temperatureLabel
+ text: (weather.weatherIcon !== "") ? (Math.round(weather.temperature-273.15) + "˚C") : ""
+ width: parent.width * 0.15
+
+ }
+
+ IconPL {
+ source: (weather.weatherIcon !== "") ? owmIconToLocal(weather.weatherIcon) : ""
+ height: temperatureLabel.height
+ }
+
+ }
+
SearchFieldPL {
id: searchField
width: parent.width
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/AnalysisPage.qml
^
|
@@ -86,12 +86,31 @@
updateGraph(day);
}
}
+
+ Graph {
+ id: graphBat
+ graphTitle: qsTr("Battery")
+ graphHeight: 300
+
+ axisY.units: "%"
+ type: DataSource.BatteryLog
+
+ minY: 0
+ maxY: 100
+ valueConverter: function(value) {
+ return value.toFixed(0);
+ }
+ onClicked: {
+ updateGraph(day);
+ }
+ }
}
function updateGraphs() {
graphHeartrate.updateGraph(day);
graphSteps.updateGraph(day);
graphIntensity.updateGraph(day);
+ graphBat.updateGraph(day);
}
Component.onCompleted: {
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/BatteryPage.qml
^
|
@@ -0,0 +1,74 @@
+import QtQuick 2.0
+import uk.co.piggz.amazfish 1.0
+import QtQuick.Layouts 1.1
+import "../components/"
+import "../components/platform"
+
+PagePL {
+ id: page
+ title: qsTr("Battery")
+
+ property var day: new Date()
+
+ Column {
+ id: column
+ width: parent.width
+ anchors.top: parent.top
+ anchors.margins: styler.themePaddingMedium
+ spacing: styler.themePaddingLarge
+
+ LabelPL {
+ id: lblCurrentHeartrate
+ font.pixelSize: styler.themeFontSizeExtraLarge * 3
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: parent.width
+ text: qsTr("%1 %").arg(_InfoBatteryPercent)
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ DateNavigation {
+ text: day.toDateString();
+ onBackward: {
+ day.setDate(day.getDate() - 1);
+ text = day.toDateString();
+ updateGraphs();
+ }
+ onForward: {
+ day.setDate(day.getDate() + 1);
+ text = day.toDateString();
+ updateGraphs();
+ }
+ }
+
+ Graph {
+ id: graphBat
+ graphTitle: qsTr("Battery")
+ graphHeight: 500
+
+ axisY.units: "%"
+ type: DataSource.BatteryLog
+ graphType: 1
+
+ minY: 0
+ maxY: 100
+ valueConverter: function(value) {
+ return value.toFixed(0);
+ }
+ onClicked: {
+ updateGraph(day);
+ }
+ }
+
+ }
+
+
+ function updateGraphs() {
+ graphBat.updateGraph(day);
+ }
+
+ Component.onCompleted: {
+ updateGraphs();
+// DaemonInterfaceInstance.requestManualHeartrate();
+ }
+
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/DebugInfo.qml
^
|
@@ -12,6 +12,7 @@
pageMenu: PageMenuPL {
PageMenuItemPL {
+ iconSource: styler.iconRefresh !== undefined ? styler.iconRefresh : ""
text: qsTr("Refresh")
onClicked: {
DaemonInterfaceInstance.refreshInformation();
@@ -165,7 +166,7 @@
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width * 0.8
onClicked: {
- DaemonInterfaceInstance.miBandService().fetchLogs();
+ DaemonInterfaceInstance.fetchLogs();
}
}
ButtonPL {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/FirstPage.qml
^
|
@@ -11,7 +11,7 @@
function unpairAccepted() {
DaemonInterfaceInstance.disconnect();
- pageStack.replace(Qt.resolvedUrl("./PairSelectDeviceType.qml"));
+ app.pages.push(Qt.resolvedUrl("./PairSelectDeviceType.qml"));
}
pageMenu: PageMenuPL {
@@ -22,7 +22,7 @@
? "UnpairDeviceDialog.qml"
: "PairSelectDeviceType.qml"
- var obj = pageStack.push(Qt.resolvedUrl(page));
+ var obj = app.pages.push(Qt.resolvedUrl(page));
if (AmazfishConfig.pairedAddress) {
obj.accepted.connect(unpairAccepted);
@@ -31,15 +31,15 @@
}
PageMenuItemPL {
text: qsTr("Download File")
- onClicked: pageStack.push(Qt.resolvedUrl("BipFirmwarePage.qml"))
+ onClicked: app.pages.push(Qt.resolvedUrl("BipFirmwarePage.qml"))
}
PageMenuItemPL {
text: qsTr("Settings")
- onClicked: pageStack.push(Qt.resolvedUrl("Settings-menu.qml"))
+ onClicked: app.pages.push(Qt.resolvedUrl("Settings-menu.qml"))
}
PageMenuItemPL {
text: qsTr("Data Graphs")
- onClicked: pageStack.push(Qt.resolvedUrl("AnalysisPage.qml"))
+ onClicked: app.pages.push(Qt.resolvedUrl("AnalysisPage.qml"))
}
PageMenuItemPL {
visible: AmazfishConfig.pairedAddress
@@ -244,7 +244,7 @@
SectionHeaderPL {
text: qsTr("Service")
- visible: !serviceActiveState || !serviceEnabledState
+ visible: (ENABLE_SYSTEMD === "YES") && (!serviceActiveState || !serviceEnabledState)
}
ButtonPL {
@@ -266,7 +266,7 @@
console.log("Start timer triggered");
pushAttached(Qt.resolvedUrl("StepsPage.qml"))
if (!AmazfishConfig.profileName) {
- pageStack.push(Qt.resolvedUrl("Settings-profile.qml"))
+ app.pages.push(Qt.resolvedUrl("Settings-profile.qml"))
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/HeartratePage.qml
^
|
@@ -42,10 +42,10 @@
Row { //Min and Max HR
//height: childrenRect.height
anchors.horizontalCenter: parent.horizontalCenter
- IconPL { iconName: styler.iconDown }
+ IconPL { iconName: styler.iconDown; iconHeight: styler.themeIconSizeSmall; iconWidth: styler.themeIconSizeSmall }
LabelPL { text: minhr; anchors.verticalCenter: parent.verticalCenter
}
- IconPL { iconName: styler.iconUp }
+ IconPL { iconName: styler.iconUp; iconHeight: styler.themeIconSizeSmall; iconWidth: styler.themeIconSizeSmall }
LabelPL { text: maxhr; anchors.verticalCenter: parent.verticalCenter
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/PairPage.qml
^
|
@@ -21,7 +21,11 @@
property QtObject _bluetoothManager : BluezQt.Manager
function startDiscovery() {
- if (!adapter || adapter.discovering) {
+ if (!adapter) {
+ showMessage(qsTr("Bluetooth adapter is not available"))
+ return
+ }
+ if (adapter.discovering) {
return
}
adapter.startDiscovery()
@@ -150,23 +154,24 @@
PageMenuItemPL {
enabled: !DaemonInterfaceInstance.pairing
- text: adapter.discovering
+ iconSource: adapter && adapter.discovering ? "" : (styler.iconDeviceScan !== undefined ? styler.iconDeviceScan : "")
+ text: adapter && adapter.discovering
? qsTr("Stop scanning")
: qsTr("Scan for devices")
onClicked: {
_placeholderText = ""
- if (adapter.discovering) {
+ if (adapter && adapter.discovering) {
stopDiscovery();
} else {
startDiscovery();
- console.log(devicesModel.rowCount());
+ console.log("devicesModel.rowCount:" + devicesModel.rowCount() );
}
}
}
PageMenuItemPL {
- visible: text
- text: adapter.discovering
+ visible: text != ""
+ text: adapter && adapter.discovering
? qsTr("Scanning for devices…")
: DaemonInterfaceInstance.pairing
? qsTr("Pairing…")
@@ -176,7 +181,8 @@
BusyIndicatorPL {
id: busyIndicator
- running: (adapter.discovering && !page.count) || DaemonInterfaceInstance.connectionState == "pairing"
+ anchors.centerIn: parent
+ running: (adapter && adapter.discovering && !page.count) || DaemonInterfaceInstance.connectionState == "pairing"
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/PairSelectDeviceType.qml
^
|
@@ -10,12 +10,12 @@
delegate: DeviceButton {
onSelected: {
if (needsAuth) {
- var authdialog = pageStack.push(Qt.resolvedUrl("./AuthKeyDialog.qml"));
+ var authdialog = app.pages.push(Qt.resolvedUrl("./AuthKeyDialog.qml"));
authdialog.accepted.connect(function() {
- var pairpage = pageStack.push(Qt.resolvedUrl("./PairPage.qml"));
+ var pairpage = app.pages.push(Qt.resolvedUrl("./PairPage.qml"));
pairpage.deviceType = deviceType;})
} else {
- var pairpage = pageStack.push(Qt.resolvedUrl("./PairPage.qml"));
+ var pairpage = app.pages.push(Qt.resolvedUrl("./PairPage.qml"));
pairpage.deviceType = deviceType;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/Settings-alarms.qml
^
|
@@ -57,6 +57,7 @@
text: qsTr("Save Settings")
onClicked: {
saveSettings();
+ app.pages.pop();
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/Settings-app.qml
^
|
@@ -61,6 +61,14 @@
}
TextSwitchPL {
+ id: chkTransliterate
+ visible: supportsFeature(Amazfish.FEATURE_ALERT)
+
+ width: parent.width
+ text: qsTr("Transliterate notifications")
+ }
+
+ TextSwitchPL {
id: chkSimulateEventSupport
visible: supportsFeature(Amazfish.FEATURE_ALERT) && !supportsFeature(Amazfish.FEATURE_EVENT_REMINDER)
@@ -86,7 +94,7 @@
minimumValue: 15
maximumValue: 120
stepSize: 15
- label: qsTr("Refresh weather every (") + value + qsTr(") minutes")
+ label: qsTr("Refresh weather every (%1) minutes").arg(value)
}
SliderPL {
@@ -95,7 +103,7 @@
minimumValue: 15
maximumValue: 240
stepSize: 15
- label: qsTr("Refresh calendar every (") + value + qsTr(") minutes")
+ label: qsTr("Refresh calendar every (%1) minutes").arg(value)
visible: supportsFeature(Amazfish.FEATURE_EVENT_REMINDER)
}
@@ -157,7 +165,7 @@
text: qsTr("Button Actions")
visible: supportsFeature(Amazfish.FEATURE_BUTTON_ACTION)
onClicked: {
- pageStack.push(Qt.resolvedUrl("Settings-button-action.qml"))
+ app.pages.push(Qt.resolvedUrl("Settings-button-action.qml"))
}
}
@@ -169,6 +177,7 @@
text: qsTr("Save Settings")
onClicked: {
saveSettings();
+ app.pages.pop();
}
}
}
@@ -181,6 +190,7 @@
chkNotifyLowBattery.checked = AmazfishConfig.appNotifyLowBattery;
chkNavigationNotification.checked = AmazfishConfig.appNavigationNotification;
chkSimulateEventSupport.checked = AmazfishConfig.appSimulateEventSupport;
+ chkTransliterate.checked = AmazfishConfig.appTransliterate;
chkServiceEnabled.checked = serviceEnabledState;
_ready = true;
@@ -195,6 +205,7 @@
AmazfishConfig.appNavigationNotification = chkNavigationNotification.checked;
AmazfishConfig.appSimulateEventSupport = chkSimulateEventSupport.checked;
AmazfishConfig.localAdapter = cboLocalAdapter.value;
+ AmazfishConfig.appTransliterate = chkTransliterate.checked ;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/Settings-button-action.qml
^
|
@@ -56,6 +56,7 @@
text: qsTr("Save Settings")
onClicked: {
saveSettings();
+ app.pages.pop();
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/Settings-device.qml
^
|
@@ -94,7 +94,7 @@
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Huami Display Items")
onClicked: {
- pageStack.push(Qt.resolvedUrl("Settings-huami-shortcuts.qml"))
+ app.pages.push(Qt.resolvedUrl("Settings-huami-shortcuts.qml"))
}
}
@@ -106,6 +106,7 @@
text: qsTr("Save Settings")
onClicked: {
saveSettings();
+ app.pages.pop();
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/Settings-huami-shortcuts.qml
^
|
@@ -58,6 +58,7 @@
onClicked: {
saveDisplayItems();
saveSettings();
+ app.pages.pop();
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/Settings-profile.qml
^
|
@@ -8,6 +8,8 @@
title: qsTr("Profile Settings")
property string dob
+ property date wristScheduleStart
+ property date wristScheduleEnd
Column {
id: column
@@ -40,8 +42,9 @@
text: new Date(page.dob).toLocaleDateString();
onClicked: {
- var dialog = pageStack.push(pickerComponent, {
- date: new Date(AmazfishConfig.profileDOB)
+ var profile_DOB_date = new Date(AmazfishConfig.profileDOB);
+ var dialog = app.pages.push(pickerComponent, {
+ date: !isNaN(profile_DOB_date) ? profile_DOB_date : new Date()
})
dialog.accepted.connect(function() {
page.dob = dialog.date;
@@ -96,16 +99,79 @@
}
}
+ /*
TextSwitchPL {
id: swDisplayOnLiftWrist
width: parent.width
text: qsTr("Display on lift wrist")
}
+ */
+
+ ComboBoxPL {
+ id: cboDisplayLiftWrist
+ width: parent.width
+ label: qsTr("Display on lift wrist")
+
+ model: ListModel {
+ ListElement { itemText: qsTr("Off") }
+ ListElement { itemText: qsTr("On")}
+ ListElement { itemText: qsTr("Schedule")}
+ }
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: styler.themePaddingSmall
+ ButtonPL {
+ id: btnLiftWristScheduleStart
+ text: new Date(page.wristScheduleStart).toTimeString();
+ enabled: cboDisplayLiftWrist.currentIndex === 2
+
+ onClicked: {
+ var profile_lift_start = new Date(AmazfishConfig.profileWristScheduleStart);
+ var dialog = app.pages.push(pickerComponentScheduleStart, {
+ hour: profile_lift_start.getHours(),
+ minute: profile_lift_start.getMinutes()
+ });
+ dialog.accepted.connect(function() {
+ console.log(dialog.timeText, dialog.time, dialog.hour, dialog.minute);
+ page.wristScheduleStart = dialog.time;
+ })
+ }
+
+ Component {
+ id: pickerComponentScheduleStart
+ TimePickerDialogPL {}
+ }
+ }
+
+ ButtonPL {
+ id: btnLiftWristScheduleEnd
+ text: new Date(page.wristScheduleEnd).toTimeString();
+ enabled: cboDisplayLiftWrist.currentIndex === 2
+
+ onClicked: {
+ var profile_lift_end = new Date(AmazfishConfig.profileWristScheduleEnd);
+ var dialog = app.pages.push(pickerComponentScheduleEnd, {
+ hour: profile_lift_end.getHours(),
+ minute: profile_lift_end.getMinutes()
+ });
+ dialog.accepted.connect(function() {
+ page.wristScheduleEnd = dialog.time;
+ })
+ }
+
+ Component {
+ id: pickerComponentScheduleEnd
+ TimePickerDialogPL {}
+ }
+ }
+ }
SliderPL {
id: sldFitnessGoal
width: parent.width
- minimumValue: 5000
+ minimumValue: 1000
maximumValue: 30000
stepSize: 100
label: qsTr("Goal (steps): ") + value
@@ -143,6 +209,7 @@
text: qsTr("Save Profile")
onClicked: {
saveProfile();
+ app.pages.pop();
}
}
Timer {
@@ -172,8 +239,10 @@
sldFitnessGoal.value = AmazfishConfig.profileFitnessGoal;
swAlertOnGoal.checked = AmazfishConfig.profileAlertFitnessGoal;
sldAllDayHRM.value = AmazfishConfig.profileAllDayHRM;
- swDisplayOnLiftWrist.checked = AmazfishConfig.profileDisplayOnLiftWrist;
+ cboDisplayLiftWrist.currentIndex = AmazfishConfig.profileDisplayOnLiftWrist;
swHRMSleepSupport.checked = AmazfishConfig.profileHRMSleepSupport;
+ wristScheduleStart = AmazfishConfig.profileWristScheduleStart;
+ wristScheduleEnd = AmazfishConfig.profileWristScheduleEnd;
}
function saveProfile() {
AmazfishConfig.profileName = fldName.text;
@@ -185,7 +254,9 @@
AmazfishConfig.profileFitnessGoal = sldFitnessGoal.value;
AmazfishConfig.profileAlertFitnessGoal = swAlertOnGoal.checked;
AmazfishConfig.profileAllDayHRM = sldAllDayHRM.value;
- AmazfishConfig.profileDisplayOnLiftWrist = swDisplayOnLiftWrist.checked;
+ AmazfishConfig.profileDisplayOnLiftWrist = cboDisplayLiftWrist.currentIndex;
+ AmazfishConfig.profileWristScheduleStart = wristScheduleStart;
+ AmazfishConfig.profileWristScheduleEnd = wristScheduleEnd;
AmazfishConfig.profileHRMSleepSupport = swHRMSleepSupport.checked;
tmrSetDelay.start();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/SportPage.qml
^
|
@@ -26,10 +26,11 @@
pageMenu: PageMenuPL {
PageMenuItemPL
{
+ iconSource: styler.iconUploadToStrava !== undefined ? styler.iconUploadToStrava : ""
text: qsTr("Send to Strava")
visible: o2strava.linked
onClicked: {
- var dialog = pageStack.push(Qt.resolvedUrl("StravaUploadPage.qml"));
+ var dialog = app.pages.push(Qt.resolvedUrl("StravaUploadPage.qml"));
dialog.activityID = activitytitle.replace(/\s/g, '');
dialog.tcx = tcx;
dialog.activityName = activitytitle;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/SportsSummaryPage.qml
^
|
@@ -10,6 +10,7 @@
pageMenu: PageMenuPL {
PageMenuItemPL {
+ iconSource: styler.iconDownloadData !== undefined ? styler.iconDownloadData : ""
text: qsTr("Download Next Activity")
onClicked: DaemonInterfaceInstance.downloadSportsData();
enabled: DaemonInterfaceInstance.connectionState === "authenticated"
@@ -106,9 +107,9 @@
text: stravaList.model[index]["total_elevation_gain"] + "m"
}*/
onClicked: {
- //var activityPage = pageStack.push(Qt.resolvedUrl("StravaActivityPage.qml"));
+ //var activityPage = app.pages.push(Qt.resolvedUrl("StravaActivityPage.qml"));
//activityPage.loadActivity(stravaList.model[index]["id"]);
- var sportpage = pageStack.push(Qt.resolvedUrl("SportPage.qml"));
+ var sportpage = app.pages.push(Qt.resolvedUrl("SportPage.qml"));
sportpage.activitytitle = name;
sportpage.date = startdate;
sportpage.location = baselatitude.toFixed(3) + "," + baselongitude.toFixed(3) + " " + basealtitude + "m";
@@ -153,4 +154,9 @@
SportsModel.update();
}
}
+
+ onPageStatusActive: {
+ pushAttached(Qt.resolvedUrl("BatteryPage.qml"))
+ }
+
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/StepsPage.qml
^
|
@@ -55,7 +55,7 @@
graphType: 2
minY: 0
- maxY: 20000
+ maxY: 2 * AmazfishConfig.profileFitnessGoal
valueConverter: function(value) {
return value.toFixed(0);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/qml/pages/StravaSettingsPage.qml
^
|
@@ -32,6 +32,7 @@
PageMenuItemPL
{
id: btnAuth
+ iconSource: styler.iconStravaLogin !== undefined ? styler.iconStravaLogin : ""
text: o2strava.linked ? qsTr("Logout") : qsTr("Login")
onClicked: {
if (o2strava.linked) {
@@ -52,7 +53,7 @@
username = (athlete["username"] !== undefined) ? athlete["username"] : athlete["firstname"] + " " + athlete["lastname"];
country = athlete["country"];
} else {
- username = "not logged in";
+ username = qsTr("not logged in");
country = "";
}
}
@@ -66,7 +67,7 @@
username = (athlete["username"] !== undefined) ? athlete["username"] : athlete["firstname"] + " " + athlete["lastname"];
country = athlete["country"];
} else {
- username = "not logged in";
+ username = qsTr("not logged in");
country = "";
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/src/daemoninterface.cpp
^
|
@@ -55,7 +55,7 @@
void DaemonInterface::pair(const QString &name, QString address)
{
- qDebug(Q_FUNC_INFO);
+ qDebug() << Q_FUNC_INFO;
if (m_connectionState == "pairing") {
return;
@@ -74,7 +74,7 @@
void DaemonInterface::changeConnectionState()
{
- qDebug(Q_FUNC_INFO);
+ qDebug() << Q_FUNC_INFO;
if (!iface || !iface->isValid()) {
QString state(QStringLiteral("disconnected"));
@@ -323,6 +323,13 @@
iface->call(QStringLiteral("enableFeature"), (int)feature);
}
+void DaemonInterface::fetchLogs() {
+ if (!iface || !iface->isValid()) {
+ return;
+ }
+ iface->call(QStringLiteral("fetchLogs"));
+}
+
QStringList DaemonInterface::supportedDisplayItems()
{
if (!iface || !iface->isValid()) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/src/daemoninterface.h
^
|
@@ -51,6 +51,7 @@
Q_INVOKABLE void updateCalendar();
Q_INVOKABLE void reloadCities();
Q_INVOKABLE void enableFeature(Amazfish::Feature feature);
+ Q_INVOKABLE void fetchLogs();
Q_INVOKABLE QStringList supportedDisplayItems();
public slots:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/src/datasource.cpp
^
|
@@ -170,6 +170,10 @@
qry = "SELECT date(timestamp_dt), sum(steps) FROM mi_band_activity WHERE date(timestamp_dt) >= date('" +
day.toString("yyyy-MM-ddT00:00:00") + "','-10 day') AND timestamp_dt <= '" +
day.toString("yyyy-MM-ddT23:59:59") + "' GROUP BY date(timestamp_dt) ORDER BY timestamp_dt ASC";
+ } else if (type == DataSource::BatteryLog) {
+ qry = "SELECT timestamp_dt, value FROM info_log WHERE date(timestamp_dt) >= date('" +
+ day.toString("yyyy-MM-ddT00:00:00") + "','-10 day') AND timestamp_dt <= '" +
+ day.toString("yyyy-MM-ddT23:59:59") + "' AND key = '"+ QString::number((int)Amazfish::Info::INFO_BATTERY) +"' ORDER BY timestamp_dt ASC"; // 7 = AbstractDevice::INFO_BATTERY
}
qDebug() << qry;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/src/datasource.h
^
|
@@ -18,7 +18,8 @@
Sleep = 3,
Intensity = 4,
StepSummary = 5,
- SleepSummary = 6
+ SleepSummary = 6,
+ BatteryLog = 7,
};
Q_ENUM(Type)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/src/harbour-amazfish-ui.cpp
^
|
@@ -12,6 +12,8 @@
#include <QQmlApplicationEngine>
#endif
+#include <QTranslator>
+
#include "datasource.h"
#include "sportsdatamodel.h"
#include "sportsmetamodel.h"
@@ -21,6 +23,7 @@
#include "weather/citysearchmodel.h"
#include "weather/citymanager.h"
#include "weather/city.h"
+#include "weather/currentweather.h"
#include "trackloader.h"
#include "amazfishconfig.h"
@@ -46,8 +49,25 @@
app = SailfishApp::application(argc, argv);
#else
app = new QApplication(argc, argv);
+
+ {
+ QString tr_path(TRANSLATION_FOLDER);
+ if ( !tr_path.isEmpty() ) {
+ QString locale = QLocale::system().name();
+ QTranslator *translator = new QTranslator();
+
+ if ( !translator->load(QLocale(), "harbour-amazfish-ui", "-", tr_path) ) {
+ qWarning() << "Failed to load translation for " << locale << " " << tr_path;
+ }
+
+ app->installTranslator(translator);
+ }
+
+ }
+
#endif
+
QCoreApplication::setOrganizationName("harbour-amazfish");
QCoreApplication::setOrganizationDomain("piggz.co.uk");
QCoreApplication::setApplicationName("harbour-amazfish");
@@ -73,6 +93,7 @@
qmlRegisterType<CitySearchModel>("org.SfietKonstantin.weatherfish", 1, 0, "CitySearchModel");
qmlRegisterType<CityManager>("org.SfietKonstantin.weatherfish", 1, 0, "CityManager");
qmlRegisterType<City>("org.SfietKonstantin.weatherfish", 1, 0, "City");
+ qmlRegisterType<CurrentWeather>("org.SfietKonstantin.weatherfish", 1, 0, "CurrentWeather");
qmlRegisterType<TrackLoader>("uk.co.piggz.amazfish", 1, 0, "TrackLoader");
qmlRegisterType<AdapterModel>("uk.co.piggz.amazfish", 1, 0, "AdapterModel");
qmlRegisterType<O2>("com.pipacs.o2", 1, 0, "O2");
@@ -104,6 +125,8 @@
#ifdef MER_EDITION_SAILFISH
view->setSource(SailfishApp::pathTo("qml/harbour-amazfish.qml"));
view->show();
+#elif UUITK_EDITION
+ view->load("./share/harbour-amazfish-ui/qml/harbour-amazfish.qml");
#else
view->load(QUrl("qrc:/qml/harbour-amazfish.qml"));
#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-cs.ts
^
|
@@ -0,0 +1,1227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="cs">
+<context>
+ <name>AddCityPage</name>
+ <message>
+ <source>Set Location</source>
+ <translation>Nastavit polohu</translation>
+ </message>
+</context>
+<context>
+ <name>Alarm</name>
+ <message>
+ <source>Enabled</source>
+ <translation>Zapnuto</translation>
+ </message>
+ <message>
+ <source>Mon</source>
+ <translation>Po</translation>
+ </message>
+ <message>
+ <source>Tue</source>
+ <translation>Út</translation>
+ </message>
+ <message>
+ <source>Wed</source>
+ <translation>St</translation>
+ </message>
+ <message>
+ <source>Thu</source>
+ <translation>Čt</translation>
+ </message>
+ <message>
+ <source>Fri</source>
+ <translation>Pá</translation>
+ </message>
+ <message>
+ <source>Sat</source>
+ <translation>So</translation>
+ </message>
+ <message>
+ <source>Sun</source>
+ <translation>Ne</translation>
+ </message>
+</context>
+<context>
+ <name>AnalysisPage</name>
+ <message>
+ <source>Analysis</source>
+ <translation>Analýza</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation>Puls</translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation>Kroky</translation>
+ </message>
+ <message>
+ <source>Intensity</source>
+ <translation>Intensita</translation>
+ </message>
+ <message>
+ <source>Battery</source>
+ <translation>Baterie</translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation>Vložte autentizační klíč</translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <source>Battery</source>
+ <translation>Baterie</translation>
+ </message>
+ <message>
+ <source>%1 %</source>
+ <translation>%1 %</translation>
+ </message>
+</context>
+<context>
+ <name>BipFirmwarePage</name>
+ <message>
+ <source>Send file</source>
+ <translation>Odeslat soubor</translation>
+ </message>
+ <message>
+ <source>Download File</source>
+ <translation>Stáhnout soubor</translation>
+ </message>
+ <message>
+ <source>Select a file to download.</source>
+ <translation>Vybrat soubor k stažení</translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation>Žádný</translation>
+ </message>
+ <message>
+ <source>Choose File</source>
+ <translation>Vyberte soubor</translation>
+ </message>
+ <message>
+ <source>File type/version: </source>
+ <translation>Typ souboru/verze: </translation>
+ </message>
+ <message>
+ <source>File not supported on this device</source>
+ <translation>Soubor není podporavný na tomto zařízení</translation>
+ </message>
+</context>
+<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation>Neočekávaná chyba</translation>
+ </message>
+</context>
+<context>
+ <name>DebugInfo</name>
+ <message>
+ <source>Refresh</source>
+ <translation>Оbnovit</translation>
+ </message>
+ <message>
+ <source>Debugging</source>
+ <translation>Ladění</translation>
+ </message>
+ <message>
+ <source>Information</source>
+ <translation>Informace</translation>
+ </message>
+ <message>
+ <source>Address: </source>
+ <translation>Adresa: </translation>
+ </message>
+ <message>
+ <source>Serial No: </source>
+ <translation>Sériové číslo: </translation>
+ </message>
+ <message>
+ <source>Hardware Rev: </source>
+ <translation>Revize hardware: </translation>
+ </message>
+ <message>
+ <source>Software Rev: </source>
+ <translation>Revize software: </translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation>Model: </translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation>Revize firmware: </translation>
+ </message>
+ <message>
+ <source>Manufacturer: </source>
+ <translation>Výrobce: </translation>
+ </message>
+ <message>
+ <source>Connection State: </source>
+ <translation>Stav připojení: </translation>
+ </message>
+ <message>
+ <source>GPS Ver: </source>
+ <translation>Verze GPS: </translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation>A:</translation>
+ </message>
+ <message>
+ <source>S:</source>
+ <translation>S:</translation>
+ </message>
+ <message>
+ <source>Function Tests</source>
+ <translation>Testování funkcí</translation>
+ </message>
+ <message>
+ <source>Test Notification</source>
+ <translation>Test oznámení</translation>
+ </message>
+ <message>
+ <source>Test Email</source>
+ <translation>Test Emailu</translation>
+ </message>
+ <message>
+ <source>Test Call</source>
+ <translation>Test Volání</translation>
+ </message>
+ <message>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-de.ts
^
|
@@ -0,0 +1,1227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="de_DE">
+<context>
+ <name>AddCityPage</name>
+ <message>
+ <source>Set Location</source>
+ <translation>Ort festlegen</translation>
+ </message>
+</context>
+<context>
+ <name>Alarm</name>
+ <message>
+ <source>Enabled</source>
+ <translation>Aktiviert</translation>
+ </message>
+ <message>
+ <source>Mon</source>
+ <translation>Mo</translation>
+ </message>
+ <message>
+ <source>Tue</source>
+ <translation>Di</translation>
+ </message>
+ <message>
+ <source>Wed</source>
+ <translation>Mi</translation>
+ </message>
+ <message>
+ <source>Thu</source>
+ <translation>Do</translation>
+ </message>
+ <message>
+ <source>Fri</source>
+ <translation>Fr</translation>
+ </message>
+ <message>
+ <source>Sat</source>
+ <translation>Sa</translation>
+ </message>
+ <message>
+ <source>Sun</source>
+ <translation>So</translation>
+ </message>
+</context>
+<context>
+ <name>AnalysisPage</name>
+ <message>
+ <source>Analysis</source>
+ <translation>Auswertung</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation>Pulsrate</translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation>Schritte</translation>
+ </message>
+ <message>
+ <source>Intensity</source>
+ <translation>Intensität</translation>
+ </message>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation>Auth-Key Eingeben</translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BipFirmwarePage</name>
+ <message>
+ <source>Send file</source>
+ <translation>Datei senden</translation>
+ </message>
+ <message>
+ <source>Download File</source>
+ <translation>Datei herunterladen</translation>
+ </message>
+ <message>
+ <source>Select a file to download.</source>
+ <translation>Wähle eine Datei zum herunterladen aus.</translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation>Keins</translation>
+ </message>
+ <message>
+ <source>Choose File</source>
+ <translation>Datei wählen</translation>
+ </message>
+ <message>
+ <source>File type/version: </source>
+ <translation>Dateityp/Version: </translation>
+ </message>
+ <message>
+ <source>File not supported on this device</source>
+ <translation>Datei für dieses Gerät nicht unterstützt</translation>
+ </message>
+</context>
+<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation>Unerwarteter Fehler</translation>
+ </message>
+</context>
+<context>
+ <name>DebugInfo</name>
+ <message>
+ <source>Refresh</source>
+ <translation>Aktualisieren</translation>
+ </message>
+ <message>
+ <source>Address: </source>
+ <translation>Adresse:</translation>
+ </message>
+ <message>
+ <source>Serial No: </source>
+ <translation>Serien Nr:</translation>
+ </message>
+ <message>
+ <source>Hardware Rev: </source>
+ <translation>Hardware Rev:</translation>
+ </message>
+ <message>
+ <source>Software Rev: </source>
+ <translation>Software Rev:</translation>
+ </message>
+ <message>
+ <source>Connection State: </source>
+ <translation>Verbindungsstatus:</translation>
+ </message>
+ <message>
+ <source>GPS Ver: </source>
+ <translation>GPS Ver:</translation>
+ </message>
+ <message>
+ <source>Test Notification</source>
+ <translation>Test Benachrichtigung</translation>
+ </message>
+ <message>
+ <source>Test Email</source>
+ <translation>Test E-Mail</translation>
+ </message>
+ <message>
+ <source>Test Call</source>
+ <translation>Testanruf</translation>
+ </message>
+ <message>
+ <source>Fetch debug log</source>
+ <translation>Debugprotokoll abrufen</translation>
+ </message>
+ <message>
+ <source>Test Popup</source>
+ <translation>Test Popup</translation>
+ </message>
+ <message>
+ <source>Send Weather</source>
+ <translation>Sende Wetterdaten</translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation>A:</translation>
+ </message>
+ <message>
+ <source>S:</source>
+ <translation>S:</translation>
+ </message>
+ <message>
+ <source>Update Calendar</source>
+ <translation>Kalender updaten</translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation>Modell: </translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation>Firmware: </translation>
+ </message>
+ <message>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-es.ts
^
|
@@ -0,0 +1,1227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="es">
+<context>
+ <name>AddCityPage</name>
+ <message>
+ <source>Set Location</source>
+ <translation>Establecer ubicación</translation>
+ </message>
+</context>
+<context>
+ <name>Alarm</name>
+ <message>
+ <source>Enabled</source>
+ <translation>Habilitado</translation>
+ </message>
+ <message>
+ <source>Mon</source>
+ <translation>Lun</translation>
+ </message>
+ <message>
+ <source>Tue</source>
+ <translation>Mar</translation>
+ </message>
+ <message>
+ <source>Wed</source>
+ <translation>Mié</translation>
+ </message>
+ <message>
+ <source>Thu</source>
+ <translation>Jue</translation>
+ </message>
+ <message>
+ <source>Fri</source>
+ <translation>Vie</translation>
+ </message>
+ <message>
+ <source>Sat</source>
+ <translation>Sáb</translation>
+ </message>
+ <message>
+ <source>Sun</source>
+ <translation>Dom</translation>
+ </message>
+</context>
+<context>
+ <name>AnalysisPage</name>
+ <message>
+ <source>Analysis</source>
+ <translation>Análisis</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation>Frecuencia cardiaca</translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation>Pasos</translation>
+ </message>
+ <message>
+ <source>Intensity</source>
+ <translation>Intensidad</translation>
+ </message>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation>Introduce clave</translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BipFirmwarePage</name>
+ <message>
+ <source>Send file</source>
+ <translation>Enviar</translation>
+ </message>
+ <message>
+ <source>Download File</source>
+ <translation>Enviar archivo</translation>
+ </message>
+ <message>
+ <source>Select a file to download.</source>
+ <translation>Selecciona archivo para enviar.</translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation>Ninguno</translation>
+ </message>
+ <message>
+ <source>Choose File</source>
+ <translation>Elige archivo</translation>
+ </message>
+ <message>
+ <source>File type/version: </source>
+ <translation>Tipo de archivo/ver.: </translation>
+ </message>
+ <message>
+ <source>File not supported on this device</source>
+ <translation>Archivo no soportado en este dispositivo</translation>
+ </message>
+</context>
+<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation>Error inesperado</translation>
+ </message>
+</context>
+<context>
+ <name>DebugInfo</name>
+ <message>
+ <source>Refresh</source>
+ <translation>Actualizar</translation>
+ </message>
+ <message>
+ <source>Address: </source>
+ <translation>Dirección: </translation>
+ </message>
+ <message>
+ <source>Serial No: </source>
+ <translation>Nº Serie: </translation>
+ </message>
+ <message>
+ <source>Hardware Rev: </source>
+ <translation>Rev. hardware: </translation>
+ </message>
+ <message>
+ <source>Software Rev: </source>
+ <translation>Rev. software: </translation>
+ </message>
+ <message>
+ <source>Connection State: </source>
+ <translation>Estado de conexión: </translation>
+ </message>
+ <message>
+ <source>GPS Ver: </source>
+ <translation>Ver. GPS: </translation>
+ </message>
+ <message>
+ <source>Test Notification</source>
+ <translation>Test de notificación</translation>
+ </message>
+ <message>
+ <source>Test Email</source>
+ <translation>Test de email</translation>
+ </message>
+ <message>
+ <source>Test Call</source>
+ <translation>Test de llamada</translation>
+ </message>
+ <message>
+ <source>Fetch debug log</source>
+ <translation>Registro de depuración</translation>
+ </message>
+ <message>
+ <source>Test Popup</source>
+ <translation>Test de ventana emergente</translation>
+ </message>
+ <message>
+ <source>Send Weather</source>
+ <translation>Enviar Tiempo</translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation>A:</translation>
+ </message>
+ <message>
+ <source>S:</source>
+ <translation>S:</translation>
+ </message>
+ <message>
+ <source>Update Calendar</source>
+ <translation>Actualizar calendario</translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation>Modelo: </translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation>Rev. firmware: </translation>
+ </message>
+ <message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-fr.ts
^
|
@@ -2,10 +2,10 @@
<!DOCTYPE TS>
<TS version="2.1" language="fr_FR">
<context>
- <name>AddCityDialog</name>
+ <name>AddCityPage</name>
<message>
<source>Set Location</source>
- <translation>Définir la localisation</translation>
+ <translation type="unfinished">Définir la localisation</translation>
</message>
</context>
<context>
@@ -46,10 +46,6 @@
<context>
<name>AnalysisPage</name>
<message>
- <source>Download Data</source>
- <translation>Télécharger les données</translation>
- </message>
- <message>
<source>Analysis</source>
<translation>Analyse</translation>
</message>
@@ -65,6 +61,28 @@
<source>Intensity</source>
<translation>Intensité</translation>
</message>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>BipFirmwarePage</name>
@@ -98,16 +116,19 @@
</message>
</context>
<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>DebugInfo</name>
<message>
<source>Refresh</source>
<translation>Actualiser</translation>
</message>
<message>
- <source>AmazFish</source>
- <translation>AmazFish</translation>
- </message>
- <message>
<source>Address: </source>
<translation>Adresse:</translation>
</message>
@@ -153,16 +174,55 @@
</message>
<message>
<source>Send Weather</source>
- <translation">Envoyer la météo</translation>
+ <translation>Envoyer la météo</translation>
</message>
<message>
<source>A:</source>
- <translation">A:</translation>
+ <translation>A:</translation>
</message>
<message>
<source>S:</source>
<translation>S:</translation>
</message>
+ <message>
+ <source>Debugging</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Information</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Manufacturer: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Function Tests</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Update Calendar</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Music Control</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DownloadDataMenuItem</name>
+ <message>
+ <source>Download Data</source>
+ <translation type="unfinished">Télécharger les données</translation>
+ </message>
</context>
<context>
<name>FirstPage</name>
@@ -187,16 +247,32 @@
<translation>Connexion à la montre</translation>
</message>
<message>
- <source>AmazFish</source>
- <translation>AmazFish</translation>
+ <source>Data Graphs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1%</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation type="unfinished">Pas</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation type="unfinished">Rythme cardiaque</translation>
</message>
<message>
- <source>Start Service</source>
- <translation>Démarrer le service</translation>
+ <source>%1 bpm</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Enable Service</source>
- <translation type>Activer le service</translation>
+ <source>Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable on boot</source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -207,45 +283,130 @@
</message>
</context>
<context>
- <name>PairPage</name>
+ <name>HeartratePage</name>
<message>
- <source>Start scan</source>
- <translation>Démarrer le scan</translation>
+ <source>Heartrate</source>
+ <translation type="unfinished">Rythme cardiaque</translation>
</message>
<message>
- <source>Try again</source>
- <translation>Essayer encore</translation>
+ <source>%1 bpm</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BPM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Relaxed</source>
+ <translation type="unfinished"></translation>
+ </message>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-nl.ts
^
|
@@ -0,0 +1,1227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="nl_NL">
+<context>
+ <name>AddCityPage</name>
+ <message>
+ <source>Set Location</source>
+ <translation>Locatie instellen</translation>
+ </message>
+</context>
+<context>
+ <name>Alarm</name>
+ <message>
+ <source>Enabled</source>
+ <translation>Ingeschakeld</translation>
+ </message>
+ <message>
+ <source>Mon</source>
+ <translation>Ma</translation>
+ </message>
+ <message>
+ <source>Tue</source>
+ <translation>Di</translation>
+ </message>
+ <message>
+ <source>Wed</source>
+ <translation>Wo</translation>
+ </message>
+ <message>
+ <source>Thu</source>
+ <translation>Do</translation>
+ </message>
+ <message>
+ <source>Fri</source>
+ <translation>Vr</translation>
+ </message>
+ <message>
+ <source>Sat</source>
+ <translation>Za</translation>
+ </message>
+ <message>
+ <source>Sun</source>
+ <translation>Zo</translation>
+ </message>
+</context>
+<context>
+ <name>AnalysisPage</name>
+ <message>
+ <source>Analysis</source>
+ <translation>Analyse</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation>Hartslag</translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation>Stappen</translation>
+ </message>
+ <message>
+ <source>Intensity</source>
+ <translation>Intensiteit</translation>
+ </message>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation>Auth-sleutel invoeren</translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BipFirmwarePage</name>
+ <message>
+ <source>Send file</source>
+ <translation>Verstuur bestand</translation>
+ </message>
+ <message>
+ <source>Download File</source>
+ <translation>Download bestand</translation>
+ </message>
+ <message>
+ <source>Select a file to download.</source>
+ <translation>Selecteer een bestand om te downloaden.</translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation>Geen</translation>
+ </message>
+ <message>
+ <source>Choose File</source>
+ <translation>Kies bestand</translation>
+ </message>
+ <message>
+ <source>File type/version: </source>
+ <translation>Bestandstype/-versie: </translation>
+ </message>
+ <message>
+ <source>File not supported on this device</source>
+ <translation>Bestand niet ondersteund op dit apparaat</translation>
+ </message>
+</context>
+<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation>Onverwachte fout</translation>
+ </message>
+</context>
+<context>
+ <name>DebugInfo</name>
+ <message>
+ <source>Refresh</source>
+ <translation>Verversen</translation>
+ </message>
+ <message>
+ <source>Address: </source>
+ <translation>Adres: </translation>
+ </message>
+ <message>
+ <source>Serial No: </source>
+ <translation>Serienummer: </translation>
+ </message>
+ <message>
+ <source>Hardware Rev: </source>
+ <translation>Hardware-revisie: </translation>
+ </message>
+ <message>
+ <source>Software Rev: </source>
+ <translation>Software-revisie: </translation>
+ </message>
+ <message>
+ <source>Connection State: </source>
+ <translation>Verbindingsstatus: </translation>
+ </message>
+ <message>
+ <source>GPS Ver: </source>
+ <translation>GPS-versie: </translation>
+ </message>
+ <message>
+ <source>Test Notification</source>
+ <translation>Testmelding</translation>
+ </message>
+ <message>
+ <source>Test Email</source>
+ <translation>Test e-mail</translation>
+ </message>
+ <message>
+ <source>Test Call</source>
+ <translation>Test oproep</translation>
+ </message>
+ <message>
+ <source>Fetch debug log</source>
+ <translation>Foutenlogboek ophalen</translation>
+ </message>
+ <message>
+ <source>Test Popup</source>
+ <translation>Test melding</translation>
+ </message>
+ <message>
+ <source>Debugging</source>
+ <translation>Foutopsporing</translation>
+ </message>
+ <message>
+ <source>Information</source>
+ <translation>Informatie</translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation>Model: </translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation>Firmware-revisie: </translation>
+ </message>
+ <message>
+ <source>Manufacturer: </source>
+ <translation>Fabrikant: </translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation>A:</translation>
+ </message>
+ <message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-pl.ts
^
|
@@ -2,17 +2,10 @@
<!DOCTYPE TS>
<TS version="2.1" language="pl">
<context>
- <name>AbstractDevice</name>
- <message>
- <source>Device doen not support settings</source>
- <translation>Urządzenie nie obsługuje ustawień</translation>
- </message>
-</context>
-<context>
- <name>AddCityDialog</name>
+ <name>AddCityPage</name>
<message>
<source>Set Location</source>
- <translation>Ustaw lokalizację</translation>
+ <translation type="unfinished">Ustaw lokalizację</translation>
</message>
</context>
<context>
@@ -53,10 +46,6 @@
<context>
<name>AnalysisPage</name>
<message>
- <source>Download Data</source>
- <translation>Pobierz dane</translation>
- </message>
- <message>
<source>Analysis</source>
<translation>Analiza</translation>
</message>
@@ -72,20 +61,27 @@
<source>Intensity</source>
<translation>Intensywność</translation>
</message>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
- <name>BipDevice</name>
+ <name>AuthKeyDialog</name>
<message>
- <source>Amazfish</source>
- <translation>Amazfish</translation>
+ <source>Enter auth key</source>
+ <translation type="unfinished"></translation>
</message>
+</context>
+<context>
+ <name>BatteryPage</name>
<message>
- <source>Connected</source>
- <translation>Połączony</translation>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Phone and watch are connected</source>
- <translation>Telefon i zegarek są połączone</translation>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -114,16 +110,16 @@
<source>File type/version: </source>
<translation>Typ/wersja pliku: </translation>
</message>
-</context>
-<context>
- <name>BipFirmwareService</name>
<message>
- <source>An operation is currently running, please try later</source>
- <translation>Operacja jest aktualnie uruchomiona, spróbuj później</translation>
+ <source>File not supported on this device</source>
+ <translation type="unfinished"></translation>
</message>
+</context>
+<context>
+ <name>DaemonInterface</name>
<message>
- <source>No file selected</source>
- <translation>Brak wybranego pliku</translation>
+ <source>Unexpected error</source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -133,10 +129,6 @@
<translation>Odśwież</translation>
</message>
<message>
- <source>AmazFish</source>
- <translation>Amazfish</translation>
- </message>
- <message>
<source>Address: </source>
<translation>Address: </translation>
</message>
@@ -181,24 +173,60 @@
<translation>Testowe powiadomienie</translation>
</message>
<message>
- <source>Reboot watch</source>
- <translation>Restart zegarka</translation>
+ <source>Debugging</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Information</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Manufacturer: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>S:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Function Tests</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Send Weather</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Update Calendar</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Music Control</source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
- <name>DeviceInterface</name>
+ <name>DownloadDataMenuItem</name>
<message>
- <source>Device is not valid, it may not be supported</source>
- <translation>Urządzenie jest nieprawidłowe, może nie być obsługiwane</translation>
+ <source>Download Data</source>
+ <translation type="unfinished">Pobierz dane</translation>
</message>
</context>
<context>
<name>FirstPage</name>
<message>
- <source>Debug Info</source>
- <translation>Informacje debuggowania</translation>
- </message>
- <message>
<source>Pair with watch</source>
<translation>Połącz z zegarkiem</translation>
</message>
@@ -219,8 +247,32 @@
<translation>Połącz z zegarkiem</translation>
</message>
<message>
- <source>AmazFish</source>
- <translation>AmazFish</translation>
+ <source>Data Graphs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1%</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation type="unfinished">Kroki</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation type="unfinished">Tętno</translation>
+ </message>
+ <message>
+ <source>%1 bpm</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Service</source>
+ <translation type="unfinished"></translation>
+ </message>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-ru.ts
^
|
@@ -0,0 +1,1227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1">
+<context>
+ <name>AddCityPage</name>
+ <message>
+ <source>Set Location</source>
+ <translation type="unfinished">Задать местоположение</translation>
+ </message>
+</context>
+<context>
+ <name>Alarm</name>
+ <message>
+ <source>Enabled</source>
+ <translation>Включено</translation>
+ </message>
+ <message>
+ <source>Mon</source>
+ <translation>Пн</translation>
+ </message>
+ <message>
+ <source>Tue</source>
+ <translation>Вт</translation>
+ </message>
+ <message>
+ <source>Wed</source>
+ <translation>Ср</translation>
+ </message>
+ <message>
+ <source>Thu</source>
+ <translation>Чт</translation>
+ </message>
+ <message>
+ <source>Fri</source>
+ <translation>Пт</translation>
+ </message>
+ <message>
+ <source>Sat</source>
+ <translation>Сб</translation>
+ </message>
+ <message>
+ <source>Sun</source>
+ <translation>Вс</translation>
+ </message>
+</context>
+<context>
+ <name>AnalysisPage</name>
+ <message>
+ <source>Analysis</source>
+ <translation>Анализ</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation>ЧСС</translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation>Шаги</translation>
+ </message>
+ <message>
+ <source>Intensity</source>
+ <translation>Нагрузка</translation>
+ </message>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BipFirmwarePage</name>
+ <message>
+ <source>Send file</source>
+ <translation>Отправить файл</translation>
+ </message>
+ <message>
+ <source>Download File</source>
+ <translation>Загрузка файлов</translation>
+ </message>
+ <message>
+ <source>Select a file to download.</source>
+ <translation>Выберите файл для загрузки</translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation>Пусто</translation>
+ </message>
+ <message>
+ <source>Choose File</source>
+ <translation>Файл</translation>
+ </message>
+ <message>
+ <source>File type/version: </source>
+ <translation>Тип/версия файла: </translation>
+ </message>
+ <message>
+ <source>File not supported on this device</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DebugInfo</name>
+ <message>
+ <source>Refresh</source>
+ <translation>Обновить</translation>
+ </message>
+ <message>
+ <source>Address: </source>
+ <translation>Адрес: </translation>
+ </message>
+ <message>
+ <source>Serial No: </source>
+ <translation>Серийный №: </translation>
+ </message>
+ <message>
+ <source>Hardware Rev: </source>
+ <translation>Версия аппаратуры: </translation>
+ </message>
+ <message>
+ <source>Software Rev: </source>
+ <translation>Версия ПО: </translation>
+ </message>
+ <message>
+ <source>Connection State: </source>
+ <translation>Подключение: </translation>
+ </message>
+ <message>
+ <source>GPS Ver: </source>
+ <translation>Версия GPS: </translation>
+ </message>
+ <message>
+ <source>Test Notification</source>
+ <translation>Проверить уведомления</translation>
+ </message>
+ <message>
+ <source>Test Email</source>
+ <translation>Проверить отправку почты</translation>
+ </message>
+ <message>
+ <source>Test Call</source>
+ <translation>Проверить вызовы</translation>
+ </message>
+ <message>
+ <source>Fetch debug log</source>
+ <translation>Получить журнал отладки</translation>
+ </message>
+ <message>
+ <source>Test Popup</source>
+ <translation>Проверить всплывающие уведомления</translation>
+ </message>
+ <message>
+ <source>Send Weather</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>S:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Update Calendar</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-sv.ts
^
|
@@ -0,0 +1,1227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="sv">
+<context>
+ <name>AddCityPage</name>
+ <message>
+ <source>Set Location</source>
+ <translation>Ange plats</translation>
+ </message>
+</context>
+<context>
+ <name>Alarm</name>
+ <message>
+ <source>Enabled</source>
+ <translation>Aktiverad</translation>
+ </message>
+ <message>
+ <source>Mon</source>
+ <translation>Mån</translation>
+ </message>
+ <message>
+ <source>Tue</source>
+ <translation>Tis</translation>
+ </message>
+ <message>
+ <source>Wed</source>
+ <translation>Ons</translation>
+ </message>
+ <message>
+ <source>Thu</source>
+ <translation>Tor</translation>
+ </message>
+ <message>
+ <source>Fri</source>
+ <translation>Fre</translation>
+ </message>
+ <message>
+ <source>Sat</source>
+ <translation>Lör</translation>
+ </message>
+ <message>
+ <source>Sun</source>
+ <translation>Sön</translation>
+ </message>
+</context>
+<context>
+ <name>AnalysisPage</name>
+ <message>
+ <source>Analysis</source>
+ <translation>Analys</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation>Hjärtfrekvens</translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation>Steg</translation>
+ </message>
+ <message>
+ <source>Intensity</source>
+ <translation>Intensitet</translation>
+ </message>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation>Ange autentiseringsnyckel</translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BipFirmwarePage</name>
+ <message>
+ <source>Send file</source>
+ <translation>Skicka fil</translation>
+ </message>
+ <message>
+ <source>Download File</source>
+ <translation>Ladda ner fil</translation>
+ </message>
+ <message>
+ <source>Select a file to download.</source>
+ <translation>Välj en fil att ladda ner.</translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation>Ingen</translation>
+ </message>
+ <message>
+ <source>Choose File</source>
+ <translation>Välj fil</translation>
+ </message>
+ <message>
+ <source>File type/version: </source>
+ <translation>Filtyp/version: </translation>
+ </message>
+ <message>
+ <source>File not supported on this device</source>
+ <translation>Filformatet stöds inte på denna enhet</translation>
+ </message>
+</context>
+<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation>Oväntat fel</translation>
+ </message>
+</context>
+<context>
+ <name>DebugInfo</name>
+ <message>
+ <source>Refresh</source>
+ <translation>Uppdatera</translation>
+ </message>
+ <message>
+ <source>Address: </source>
+ <translation>Adress: </translation>
+ </message>
+ <message>
+ <source>Serial No: </source>
+ <translation>Serienummer: </translation>
+ </message>
+ <message>
+ <source>Hardware Rev: </source>
+ <translation>Hårdvarurevision: </translation>
+ </message>
+ <message>
+ <source>Software Rev: </source>
+ <translation>Mjukvarurevision: </translation>
+ </message>
+ <message>
+ <source>Connection State: </source>
+ <translation>Anslutningsstatus: </translation>
+ </message>
+ <message>
+ <source>GPS Ver: </source>
+ <translation>GPS-version: </translation>
+ </message>
+ <message>
+ <source>Test Notification</source>
+ <translation>Testa avisering</translation>
+ </message>
+ <message>
+ <source>Test Email</source>
+ <translation>Testa e-post</translation>
+ </message>
+ <message>
+ <source>Test Call</source>
+ <translation>Testa samtal</translation>
+ </message>
+ <message>
+ <source>Fetch debug log</source>
+ <translation>Hämta felsökningslogg</translation>
+ </message>
+ <message>
+ <source>Test Popup</source>
+ <translation>Testa popup</translation>
+ </message>
+ <message>
+ <source>Send Weather</source>
+ <translation>Skicka väder</translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation>A:</translation>
+ </message>
+ <message>
+ <source>S:</source>
+ <translation>S:</translation>
+ </message>
+ <message>
+ <source>Update Calendar</source>
+ <translation>Uppdatera kalender</translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation>Modell: </translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation>Mjukvara: </translation>
+ </message>
+ <message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui-zh_CN.ts
^
|
@@ -2,52 +2,52 @@
<!DOCTYPE TS>
<TS version="2.1">
<context>
- <name>AddCityDialog</name>
+ <name>AddCityPage</name>
<message>
- <location filename="../qml/pages/AddCityDialog.qml" line="40"/>
+ <location filename="../qml/pages/AddCityPage.qml" line="8"/>
<source>Set Location</source>
- <translation>设置位置</translation>
+ <translation type="unfinished">设置位置</translation>
</message>
</context>
<context>
<name>Alarm</name>
<message>
- <location filename="../qml/components/Alarm.qml" line="58"/>
+ <location filename="../qml/components/Alarm.qml" line="34"/>
<source>Enabled</source>
<translation>已启用</translation>
</message>
<message>
- <location filename="../qml/components/Alarm.qml" line="113"/>
+ <location filename="../qml/components/Alarm.qml" line="92"/>
<source>Mon</source>
<translation>周一</translation>
</message>
<message>
- <location filename="../qml/components/Alarm.qml" line="119"/>
+ <location filename="../qml/components/Alarm.qml" line="98"/>
<source>Tue</source>
<translation>周二</translation>
</message>
<message>
- <location filename="../qml/components/Alarm.qml" line="125"/>
+ <location filename="../qml/components/Alarm.qml" line="104"/>
<source>Wed</source>
<translation>周三</translation>
</message>
<message>
- <location filename="../qml/components/Alarm.qml" line="131"/>
+ <location filename="../qml/components/Alarm.qml" line="110"/>
<source>Thu</source>
<translation>周四</translation>
</message>
<message>
- <location filename="../qml/components/Alarm.qml" line="137"/>
+ <location filename="../qml/components/Alarm.qml" line="116"/>
<source>Fri</source>
<translation>周五</translation>
</message>
<message>
- <location filename="../qml/components/Alarm.qml" line="143"/>
+ <location filename="../qml/components/Alarm.qml" line="122"/>
<source>Sat</source>
<translation>周六</translation>
</message>
<message>
- <location filename="../qml/components/Alarm.qml" line="149"/>
+ <location filename="../qml/components/Alarm.qml" line="128"/>
<source>Sun</source>
<translation>周日</translation>
</message>
@@ -55,338 +55,506 @@
<context>
<name>AnalysisPage</name>
<message>
- <location filename="../qml/pages/AnalysisPage.qml" line="24"/>
- <source>Download Data</source>
- <translation>下载数据</translation>
- </message>
- <message>
- <location filename="../qml/pages/AnalysisPage.qml" line="38"/>
+ <location filename="../qml/pages/AnalysisPage.qml" line="8"/>
<source>Analysis</source>
<translation>分析</translation>
</message>
<message>
- <location filename="../qml/pages/AnalysisPage.qml" line="76"/>
+ <location filename="../qml/pages/AnalysisPage.qml" line="40"/>
<source>Heartrate</source>
<translation>心率</translation>
</message>
<message>
- <location filename="../qml/pages/AnalysisPage.qml" line="93"/>
+ <location filename="../qml/pages/AnalysisPage.qml" line="57"/>
<source>Steps</source>
<translation>步数</translation>
</message>
<message>
- <location filename="../qml/pages/AnalysisPage.qml" line="110"/>
+ <location filename="../qml/pages/AnalysisPage.qml" line="74"/>
<source>Intensity</source>
<translation>强度</translation>
</message>
+ <message>
+ <location filename="../qml/pages/AnalysisPage.qml" line="92"/>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <location filename="../qml/pages/AuthKeyDialog.qml" line="18"/>
+ <source>Enter auth key</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <location filename="../qml/pages/BatteryPage.qml" line="9"/>
+ <location filename="../qml/pages/BatteryPage.qml" line="45"/>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/BatteryPage.qml" line="25"/>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>BipFirmwarePage</name>
<message>
<location filename="../qml/pages/BipFirmwarePage.qml" line="9"/>
- <location filename="../qml/pages/BipFirmwarePage.qml" line="41"/>
+ <location filename="../qml/pages/BipFirmwarePage.qml" line="27"/>
<source>None</source>
<translation>无</translation>
</message>
<message>
- <location filename="../qml/pages/BipFirmwarePage.qml" line="31"/>
+ <location filename="../qml/pages/BipFirmwarePage.qml" line="7"/>
<source>Download File</source>
<translation>下载文件</translation>
</message>
<message>
- <location filename="../qml/pages/BipFirmwarePage.qml" line="36"/>
+ <location filename="../qml/pages/BipFirmwarePage.qml" line="22"/>
<source>Select a file to download.</source>
<translation>选择要下载的文件。</translation>
</message>
<message>
- <location filename="../qml/pages/BipFirmwarePage.qml" line="40"/>
+ <location filename="../qml/pages/BipFirmwarePage.qml" line="26"/>
<source>Choose File</source>
<translation>选择文件</translation>
</message>
<message>
- <location filename="../qml/pages/BipFirmwarePage.qml" line="49"/>
+ <location filename="../qml/pages/BipFirmwarePage.qml" line="44"/>
<source>File type/version: </source>
<translation>文件类型/版本:</translation>
</message>
<message>
- <location filename="../qml/pages/BipFirmwarePage.qml" line="54"/>
+ <location filename="../qml/pages/BipFirmwarePage.qml" line="49"/>
<source>Send file</source>
<translation>发送文件</translation>
</message>
<message>
- <location filename="../qml/pages/BipFirmwarePage.qml" line="58"/>
+ <location filename="../qml/pages/BipFirmwarePage.qml" line="53"/>
<source>File not supported on this device</source>
<translation>文件不受此设备支持</translation>
</message>
</context>
<context>
+ <name>DaemonInterface</name>
+ <message>
+ <location filename="../src/daemoninterface.cpp" line="65"/>
+ <source>Unexpected error</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>DebugInfo</name>
<message>
- <location filename="../qml/pages/DebugInfo.qml" line="40"/>
+ <location filename="../qml/pages/DebugInfo.qml" line="16"/>
<source>Refresh</source>
<translation>刷新</translation>
</message>
<message>
- <location filename="../qml/pages/DebugInfo.qml" line="56"/>
- <source>AmazFish</source>
- <translation>AmazFish</translation>
+ <location filename="../qml/pages/DebugInfo.qml" line="8"/>
+ <source>Debugging</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/DebugInfo.qml" line="60"/>
- <source>Informations</source>
- <translation>信息</translation>
+ <location filename="../qml/pages/DebugInfo.qml" line="32"/>
+ <source>Information</source>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/translations/harbour-amazfish-ui.ts
^
|
@@ -0,0 +1,1227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1">
+<context>
+ <name>AddCityPage</name>
+ <message>
+ <source>Set Location</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Alarm</name>
+ <message>
+ <source>Enabled</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Mon</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tue</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Wed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Thu</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Fri</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sun</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AnalysisPage</name>
+ <message>
+ <source>Analysis</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Intensity</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BatteryPage</name>
+ <message>
+ <source>Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 %</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>BipFirmwarePage</name>
+ <message>
+ <source>Send file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Download File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select a file to download.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File type/version: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File not supported on this device</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DebugInfo</name>
+ <message>
+ <source>Refresh</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Address: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Serial No: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Hardware Rev: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Software Rev: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connection State: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>GPS Ver: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Test Notification</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Test Email</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Test Call</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Fetch debug log</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Test Popup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Debugging</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Information</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Manufacturer: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.2.0.tar.bz2/ui/ui.pro
^
|
@@ -166,11 +166,17 @@
# planning to localize your app, remember to comment out the
# following TRANSLATIONS line. And also do not forget to
# modify the localized app name in the the .desktop file.
-TRANSLATIONS += translations/harbour-amazfish-ui-de.ts \
- translations/harbour-amazfish-ui-nl.ts \
- translations/harbour-amazfish-ui-ru.ts \
- translations/harbour-amazfish-ui-sv.ts \
- translations/harbour-amazfish-ui-es.ts
+TRANSLATIONS += \
+ translations/harbour-amazfish-ui-cs.ts \
+ translations/harbour-amazfish-ui-de.ts \
+ translations/harbour-amazfish-ui-es.ts \
+ translations/harbour-amazfish-ui-fr.ts \
+ translations/harbour-amazfish-ui-nl.ts \
+ translations/harbour-amazfish-ui-pl.ts \
+ translations/harbour-amazfish-ui-ru.ts \
+ translations/harbour-amazfish-ui-sv.ts \
+ translations/harbour-amazfish-ui-zh_CN.ts
+
HEADERS += \
src/datasource.h \
src/daemoninterface.h \ \
@@ -199,10 +205,54 @@
DEFINES += DISABLE_SYSTEMD
}
+flavor_uuitk {
+ DEFINES += TRANSLATION_FOLDER=\\\"./translations\\\"
+} else {
+ DEFINES += TRANSLATION_FOLDER=\\\"$${PREFIX}/share/$${TARGET}/translations\\\"
+}
+
flavor_silica {
message(SailfishOS build)
CONFIG += sailfishapp sailfishapp_no_deploy_qml sailfishapp_i18n
DEFINES += MER_EDITION_SAILFISH
+
+ qtPrepareTool(LRELEASE, lrelease)
+ for(tsfile, TRANSLATIONS) {
+ qmfile = $$shadowed($$tsfile)
+ qmfile ~= s,.ts$,.qm,
+ qmdir = $$dirname(qmfile)
+ !exists($$qmdir) {
+ mkpath($$qmdir)|error("Aborting.")
+ }
+ command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile
+ system($$command)|error("Failed to run: $$command")
+ TRANSLATIONS_FILES += $$qmfile
+ }
+
+ translations_files.files = $${TRANSLATIONS_FILES}
+ translations_files.path = $${PREFIX}/share/$${TARGET}/translations
+ INSTALLS += translations_files
+}
+
+flavor_uuitk {
+ message(UUITK build)
+ DEFINES += UUITK_EDITION
+
+ qtPrepareTool(LRELEASE, lrelease)
+ for(tsfile, TRANSLATIONS) {
+ qmfile = $$shadowed($$tsfile)
+ qmfile ~= s,.ts$,.qm,
+ qmdir = $$dirname(qmfile)
+ !exists($$qmdir) {
+ mkpath($$qmdir)|error("Aborting.")
+ }
+ command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile
+ system($$command)|error("Failed to run: $$command")
+ TRANSLATIONS_FILES += $$qmfile
+ }
+ translations_files.files = $${TRANSLATIONS_FILES}
+ translations_files.path = /translations
+ INSTALLS += translations_files
}
# PREFIX
|