diff options
Diffstat (limited to '')
60 files changed, 381 insertions, 916 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b27f88..a4707e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.6.0) -project(asteroid-compass +project(asteroid-toolwatch VERSION 0.0.1 - DESCRIPTION "Default compass app for AsteroidOS") + DESCRIPTION "An app for showing sensors data on AsteroidOS") find_package(ECM REQUIRED NO_MODULE) find_package(AsteroidApp REQUIRED) @@ -19,14 +19,14 @@ ecm_find_qmlmodule(QtSensors 5.3) add_subdirectory(src) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/asteroid-compass.in - ${CMAKE_BINARY_DIR}/asteroid-compass +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/asteroid-toolwatch.in + ${CMAKE_BINARY_DIR}/asteroid-toolwatch @ONLY) -install(PROGRAMS ${CMAKE_BINARY_DIR}/asteroid-compass +install(PROGRAMS ${CMAKE_BINARY_DIR}/asteroid-toolwatch DESTINATION ${CMAKE_INSTALL_BINDIR}) build_translations(i18n) -generate_desktop(${CMAKE_SOURCE_DIR} asteroid-compass) +generate_desktop(${CMAKE_SOURCE_DIR} asteroid-toolwatch) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) @@ -1,11 +1,14 @@ -# Asteroid Compass -A compass app for [AsteroidOS](http://asteroidos.org/) +# Asteroid Toolwatch +An app to display multiple sensors (currently compass and barometer) for AsteroidOS. + +This extends and replaces the asteroid-compass app. ## Dependencies * [qml-asteroid](https://github.com/AsteroidOS/qml-asteroid) ## Copyright and License -(C) Copyright 2017 - Florent Revest & Niels Tholenaar +(C) Copyright 2017 - Florent Revest & Niels Tholenaar + 2023 - Arseniy Movshev <dodoradio@outlook.com> This application is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/asteroid-compass.desktop.template b/asteroid-toolwatch.desktop.template index 180fab0..99eecd7 100644 --- a/asteroid-compass.desktop.template +++ b/asteroid-toolwatch.desktop.template @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Categories=Applications; -Exec=asteroid-compass +Exec=asteroid-toolwatch Icon=ios-compass-outline X-Asteroid-Center-Color=#29A600 X-Asteroid-Outer-Color=#070C00 diff --git a/asteroid-compass.in b/asteroid-toolwatch.in index 595b1ef..daf7de1 100755 --- a/asteroid-compass.in +++ b/asteroid-toolwatch.in @@ -1,3 +1,3 @@ #!/bin/sh -exec invoker --single-instance --type=qt5 @CMAKE_INSTALL_FULL_LIBDIR@/asteroid-compass.so +exec invoker --single-instance --type=qt5 @CMAKE_INSTALL_FULL_LIBDIR@/asteroid-toolwatch.so diff --git a/i18n/asteroid-compass.ar.ts b/i18n/asteroid-compass.ar.ts deleted file mode 100644 index 0c5dc37..0000000 --- a/i18n/asteroid-compass.ar.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ar"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3> لا توجد بيانات</h3> معايرة المستشعر عن طريق تحريكه في شكل ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>البوصلة</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ast.ts b/i18n/asteroid-compass.ast.ts deleted file mode 100644 index bef686b..0000000 --- a/i18n/asteroid-compass.ast.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ast"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Nun hai datos</h3>Calibra'l sensor faciendo'l movimientu ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Brúxula</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.az.ts b/i18n/asteroid-compass.az.ts deleted file mode 100644 index 49e7af7..0000000 --- a/i18n/asteroid-compass.az.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="az"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Məlumat yoxdur</h3> Sensoru ∞ formalı hərəkət etdirərək kalibrləyin.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Kompas</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ca.ts b/i18n/asteroid-compass.ca.ts deleted file mode 100644 index e59bf13..0000000 --- a/i18n/asteroid-compass.ca.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ca"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.cs.ts b/i18n/asteroid-compass.cs.ts deleted file mode 100644 index baa0467..0000000 --- a/i18n/asteroid-compass.cs.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="cs"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Žádná data</h3>Zkalibrujte senzor pohybem zápěstí po dráze ∞ („osmička“).</translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation>Kompas</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.da.ts b/i18n/asteroid-compass.da.ts deleted file mode 100644 index 596a49b..0000000 --- a/i18n/asteroid-compass.da.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="da"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.de_DE.ts b/i18n/asteroid-compass.de_DE.ts deleted file mode 100644 index 7e2ed8f..0000000 --- a/i18n/asteroid-compass.de_DE.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="de_DE"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Keine Daten</h3>Kalibrieren Sie den Sensor, indem Sie ihn in einer ∞-Figur bewegen.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Kompass</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.el.ts b/i18n/asteroid-compass.el.ts deleted file mode 100644 index 4950690..0000000 --- a/i18n/asteroid-compass.el.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="el"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.en_GB.ts b/i18n/asteroid-compass.en_GB.ts deleted file mode 100644 index d56fe9e..0000000 --- a/i18n/asteroid-compass.en_GB.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="en_GB"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Compass</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.eo.ts b/i18n/asteroid-compass.eo.ts deleted file mode 100644 index a432bcf..0000000 --- a/i18n/asteroid-compass.eo.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="eo"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.es.ts b/i18n/asteroid-compass.es.ts deleted file mode 100644 index f55a193..0000000 --- a/i18n/asteroid-compass.es.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="es"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Sin datos</h3>Calibra el sensor moviéndolo haciendo una figura ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Brújula</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.es_AR.ts b/i18n/asteroid-compass.es_AR.ts deleted file mode 100644 index efce793..0000000 --- a/i18n/asteroid-compass.es_AR.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="es_AR"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.fa.ts b/i18n/asteroid-compass.fa.ts deleted file mode 100644 index 80d1abe..0000000 --- a/i18n/asteroid-compass.fa.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="fa"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>بدون داده</h3>واسنجی حسگر با چرخاندنش به شکل ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>قطبنما</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.fi.ts b/i18n/asteroid-compass.fi.ts deleted file mode 100644 index 3ab106c..0000000 --- a/i18n/asteroid-compass.fi.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="fi"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.fr.ts b/i18n/asteroid-compass.fr.ts deleted file mode 100644 index 2d53dd1..0000000 --- a/i18n/asteroid-compass.fr.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="fr"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Aucune donnée</h3>Calibrez le capteur en le déplaçant suivant la figure ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Compass</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.gl.ts b/i18n/asteroid-compass.gl.ts deleted file mode 100644 index cbc092d..0000000 --- a/i18n/asteroid-compass.gl.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="gl"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Sen datos</h3>Calibralo sensor movéndose nunha figura ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Compás</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.he.ts b/i18n/asteroid-compass.he.ts deleted file mode 100644 index 109d302..0000000 --- a/i18n/asteroid-compass.he.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="he"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>אין נתונים</h3>נא לסנכרן את החיישן על ידי הזזתו בצורת ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>מצפן</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.hi.ts b/i18n/asteroid-compass.hi.ts deleted file mode 100644 index d08222d..0000000 --- a/i18n/asteroid-compass.hi.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="hi"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>कोई डेटा नहीं</h3>सेंसर को ∞ की गति में ले जाकर कैलिब्रेट करें।</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>कंपास</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.hr.ts b/i18n/asteroid-compass.hr.ts deleted file mode 100644 index 4266408..0000000 --- a/i18n/asteroid-compass.hr.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="hr"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Nema podataka</h3>Kalibriraj senzor pomicanjem senzora u ∞ znak.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Kompas</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.hu.ts b/i18n/asteroid-compass.hu.ts deleted file mode 100644 index b92e7da..0000000 --- a/i18n/asteroid-compass.hu.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="hu"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.id.ts b/i18n/asteroid-compass.id.ts deleted file mode 100644 index 553a424..0000000 --- a/i18n/asteroid-compass.id.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="id"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.it.ts b/i18n/asteroid-compass.it.ts deleted file mode 100644 index 0390041..0000000 --- a/i18n/asteroid-compass.it.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="it"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Nessun dato</h3>Calibra il sensore muovendolo, disegnando un ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation>Bussola</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ja.ts b/i18n/asteroid-compass.ja.ts deleted file mode 100644 index 6e80f10..0000000 --- a/i18n/asteroid-compass.ja.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ja"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ka.ts b/i18n/asteroid-compass.ka.ts deleted file mode 100644 index c69375a..0000000 --- a/i18n/asteroid-compass.ka.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ka"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ko.ts b/i18n/asteroid-compass.ko.ts deleted file mode 100644 index 65e6493..0000000 --- a/i18n/asteroid-compass.ko.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ko"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>데이터 없음</h3>센서를 ∞ 피규어로 움직여 보정하세요.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>컴퍼스</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.lb.ts b/i18n/asteroid-compass.lb.ts deleted file mode 100644 index 6835476..0000000 --- a/i18n/asteroid-compass.lb.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="lb"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.lt.ts b/i18n/asteroid-compass.lt.ts deleted file mode 100644 index 696dee5..0000000 --- a/i18n/asteroid-compass.lt.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="lt"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Nėra duomenų</h3>Kalibruokite jutiklį judindami jį ∞ figūra.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Kompasas</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.mr.ts b/i18n/asteroid-compass.mr.ts deleted file mode 100644 index 5ff6c79..0000000 --- a/i18n/asteroid-compass.mr.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="mr"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>कोणताही डेटा नाही</h3>सेन्सरला ∞ आकृतीमध्ये हलवून कॅलिब्रेट करा.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>होकायंत्र</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ms.ts b/i18n/asteroid-compass.ms.ts deleted file mode 100644 index 412115f..0000000 --- a/i18n/asteroid-compass.ms.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ms"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.nb_NO.ts b/i18n/asteroid-compass.nb_NO.ts deleted file mode 100644 index 7278942..0000000 --- a/i18n/asteroid-compass.nb_NO.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="nb_NO"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Ingen data</h3>Kalibrer sensoren ved å bevege den i en ∞-figur.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Kompass</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.nl_BE.ts b/i18n/asteroid-compass.nl_BE.ts deleted file mode 100644 index b0bbfac..0000000 --- a/i18n/asteroid-compass.nl_BE.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="nl_BE"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.nl_NL.ts b/i18n/asteroid-compass.nl_NL.ts deleted file mode 100644 index c774d97..0000000 --- a/i18n/asteroid-compass.nl_NL.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="nl_NL"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Geen data</h3>Kalibreer de sensor door het in een ∞ figuur te bewegen.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Compass</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.pl.ts b/i18n/asteroid-compass.pl.ts deleted file mode 100644 index ed0d7e0..0000000 --- a/i18n/asteroid-compass.pl.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="pl"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Brak danych</h3>Skalibruj czujnik, wykonując nim ruch w kształcie ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Kompas</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.pt.ts b/i18n/asteroid-compass.pt.ts deleted file mode 100644 index 63b0dfe..0000000 --- a/i18n/asteroid-compass.pt.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="pt"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3> Nenhuns dados</h3>Calibre o sensor movendo-o numa figura ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Bússola</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.pt_BR.ts b/i18n/asteroid-compass.pt_BR.ts deleted file mode 100644 index bc8fc8c..0000000 --- a/i18n/asteroid-compass.pt_BR.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="pt_BR"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Nenhum dado</h3>Calibre o sensor movendo-o em ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Bússola</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.pt_PT.ts b/i18n/asteroid-compass.pt_PT.ts deleted file mode 100644 index ed2e34c..0000000 --- a/i18n/asteroid-compass.pt_PT.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="pt_PT"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3> Nenhuns dados</h3>Calibre o sensor movendo-o numa figura ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Bússola</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ro.ts b/i18n/asteroid-compass.ro.ts deleted file mode 100644 index 79d5824..0000000 --- a/i18n/asteroid-compass.ro.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ro"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Nu sunt date</h3>Calibrează senzorul mișcându-l în formă de ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Busolă</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ru.ts b/i18n/asteroid-compass.ru.ts deleted file mode 100644 index f28bc77..0000000 --- a/i18n/asteroid-compass.ru.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ru"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Нет данных</h3>Откалибруйте сенсор, перемещая часы по фигуре ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Компас</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.sk.ts b/i18n/asteroid-compass.sk.ts deleted file mode 100644 index d9879cf..0000000 --- a/i18n/asteroid-compass.sk.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="sk"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Žiadne dáta</h3>Nakalibrujte snímač pohybom zápästia po dráhe ∞ („osmička“).</translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation>Kompas</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.sv.ts b/i18n/asteroid-compass.sv.ts deleted file mode 100644 index a7800c3..0000000 --- a/i18n/asteroid-compass.sv.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="sv"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Ingen data</h3>Kalibrera sensorn genom att flytta den i en ∞-figur.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Kompass</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.ta.ts b/i18n/asteroid-compass.ta.ts deleted file mode 100644 index 28d8647..0000000 --- a/i18n/asteroid-compass.ta.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ta"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.te.ts b/i18n/asteroid-compass.te.ts deleted file mode 100644 index 0b09b6b..0000000 --- a/i18n/asteroid-compass.te.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="te"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.th.ts b/i18n/asteroid-compass.th.ts deleted file mode 100644 index 39d179b..0000000 --- a/i18n/asteroid-compass.th.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="th"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>ไม่พบข้อมูล</h3>ปรับเทียบเซ็นเซอร์ด้วยการขยับเซ็นเซอร์ในรูป ∞</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>เข็มทิศ</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.tr.ts b/i18n/asteroid-compass.tr.ts deleted file mode 100644 index 44e8a00..0000000 --- a/i18n/asteroid-compass.tr.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="tr"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Veri yok</h3>Sensörü ∞ şeklinde hareket ettirerek kalibre edin.</translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation>Pusula</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.uk.ts b/i18n/asteroid-compass.uk.ts deleted file mode 100644 index d18d1c3..0000000 --- a/i18n/asteroid-compass.uk.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="uk"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Дані відсутні</h3> Відкалібруйте датчик, рухаючи його фігурою ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>Компас</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.vi.ts b/i18n/asteroid-compass.vi.ts deleted file mode 100644 index f2bf689..0000000 --- a/i18n/asteroid-compass.vi.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="vi"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>Không dữ liệu</h3>Hiệu chỉnh cảm biến bằng cách di chuyển nó theo hình ∞.</translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation>La bàn</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.zgh.ts b/i18n/asteroid-compass.zgh.ts deleted file mode 100644 index 51cfd88..0000000 --- a/i18n/asteroid-compass.zgh.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="zgh"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.zh_Hans.ts b/i18n/asteroid-compass.zh_Hans.ts deleted file mode 100644 index e1dabe3..0000000 --- a/i18n/asteroid-compass.zh_Hans.ts +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="zh_Hans"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation><h3>无数据</h3>以 ∞ 移动来校准传感器。</translation> - </message> - <message id="id-app-launcher-name"> - <source>Compass</source> - <translation>罗盘</translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.zh_Hant.ts b/i18n/asteroid-compass.zh_Hant.ts deleted file mode 100644 index ede4d8d..0000000 --- a/i18n/asteroid-compass.zh_Hant.ts +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="zh_Hant"> -<context> - <name></name> - <message id="id-no-data-calibrate"> - <location filename="../src/main.qml" line="45"/> - <source><h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure.</source> - <translation type="unfinished"></translation> - </message> - <message id="id-app-launcher-name"> - <location filename="asteroid-compass.desktop.h" line="6"/> - <source>Compass</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/i18n/asteroid-compass.desktop.h b/i18n/asteroid-toolwatch.desktop.h index 076160c..950e9a4 100644 --- a/i18n/asteroid-compass.desktop.h +++ b/i18n/asteroid-toolwatch.desktop.h @@ -2,5 +2,5 @@ * will be integrated to i18n/.ts files, translated on Weblate and then merged * back with the .desktop.template file into a single .desktop file. */ -//% "Compass" +//% "Toolwatch" qtTrId("id-app-launcher-name"); diff --git a/src/Barometer.qml b/src/Barometer.qml new file mode 100644 index 0000000..c34f51d --- /dev/null +++ b/src/Barometer.qml @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2023 Arseniy Movshev <dodoradio@outlook.com> + * 2021 Timo Könnecke <github.com/eLtMosen> + * 2021 Darrel Griët <dgriet@gmail.com> + * 2019 Florent Revest <revestflo@gmail.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/>. + */ + +import QtQuick 2.9 +import QtSensors 5.11 +import org.asteroid.controls 1.0 +import org.asteroid.utils 1.0 +import Nemo.Configuration 1.0 + +Item { + id: barometerRoot + + + PressureSensor { + id: pressureSensor + active: true + } + IconButton { + onClicked: pageStack.push(settingsPage) + iconName: "ios-settings-outline" + width: parent.width*0.2 + height: width + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: pressureText.top + } + Label { + id: pressureText + anchors.centerIn: parent + horizontalAlignment: Text.AlignHCenter + text: (pressureSensor.reading.pressure + barometerOffset.value)/100 + font.pixelSize: parent.height / 4 + } + ConfigurationValue { + id: barometerOffset + key: "/org/asteroidos/sensors/barometer-offset" + defaultValue: 0 + } + Label { + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: pressureText.bottom + horizontalAlignment: Text.AlignHCenter + text: "hPa" + font.pixelSize: parent.height / 6 + } +} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b5930c5..5c71d10 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,8 @@ -add_library(asteroid-compass main.cpp resources.qrc) -set_target_properties(asteroid-compass PROPERTIES PREFIX "") +add_library(asteroid-toolwatch main.cpp resources.qrc) +set_target_properties(asteroid-toolwatch PROPERTIES PREFIX "") -target_link_libraries(asteroid-compass PUBLIC +target_link_libraries(asteroid-toolwatch PUBLIC AsteroidApp) -install(TARGETS asteroid-compass +install(TARGETS asteroid-toolwatch DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/Compass.qml b/src/Compass.qml new file mode 100644 index 0000000..48e9557 --- /dev/null +++ b/src/Compass.qml @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2022 - Darrel Griët <dgriet@gmail.com> + * 2017 - Florent Revest <revestflo@gmail.com> + * - Niels Tholenaar <info@123quality.nl> + * + * 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/>. + */ + +import QtQuick 2.5 +import org.asteroid.controls 1.0 +import QtSensors 5.3 +import QtGraphicalEffects 1.15 + +Item { + id: compassRoot + + property int rotation: 0; + property int calibration: 0; + property int ringValueOffset: Math.sqrt(Math.pow(Dims.l(40), 2) / 2); + + Compass { + active: true + onReadingChanged: { + compassRoot.rotation = reading.azimuth; + compassRoot.calibration = reading.calibrationLevel; + } + } + + StatusPage { + //% "<h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure." + text: qsTrId("id-no-data-calibrate") + icon: "ios-infinite-outline" + visible: !compassRoot.calibration + } + + Item { + visible: compassRoot.calibration + anchors.fill: parent + + Item { + id: centerDisplay + anchors.fill: parent + Label { + id: magneticRotation + anchors.centerIn: parent + text: compassRoot.rotation + font { + pixelSize: parent.height / 4 + capitalization: Font.Capitalize + styleName: "SemiCondensed" + kerning: true + preferShaping: true + } + } + Label { + id: degreeSymbol + anchors.top: magneticRotation.top + anchors.left: magneticRotation.right + text: "°" + font { + pixelSize: parent.height / 4 + capitalization: Font.Capitalize + styleName: "SemiCondensed" + kerning: true + preferShaping: true + } + } + Image { + anchors.top: parent.top + anchors.centerIn: parent + anchors.verticalCenterOffset: -Dims.l(35) + width: Dims.l(10) + height: width + source: "compass.svg" + } + } + + Item { + anchors.fill: parent + rotation: -compassRoot.rotation + Repeater { + id: outerRing + anchors.fill: parent + model: 8 + Label { + property var angle: (index / outerRing.count) * 2 * Math.PI + property var cardinalDirections: ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] + rotation: compassRoot.rotation + color: index == 0 ? "#c2620c" : "white" + text: cardinalDirections[index] + anchors { + centerIn: parent + verticalCenterOffset: -Math.cos(angle) * Dims.l(40) + horizontalCenterOffset: Math.sin(angle) * Dims.l(40) + } + font { + pixelSize: index % 2 ? Dims.l(8) : Dims.l(10) + capitalization: Font.Capitalize + styleName: "Condensed Bold" + kerning: true + preferShaping: true + } + } + } + } + } +} diff --git a/src/SettingsPage.qml b/src/SettingsPage.qml new file mode 100644 index 0000000..c5c81f1 --- /dev/null +++ b/src/SettingsPage.qml @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2023 Arseniy Movshev <dodoradio@outlook.com> + * 2019 Florent Revest <revestflo@gmail.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/>. + */ + +import QtQuick 2.15 +import org.asteroid.utils 1.0 +import org.asteroid.controls 1.0 +import QtSensors 5.11 +import Nemo.Configuration 1.0 + +Item { + PageHeader { + text: "Settings" + z: 5 + } + Flickable { + anchors.fill: parent + contentHeight: contentColumn.implicitHeight + Column { + id: contentColumn + anchors.fill: parent + + Item { width: parent.width; height: parent.width*0.2} + LabeledActionButton { + width: parent.width + height: width*0.2 + text: qsTr("Adjust barometer") + icon: "ios-settings-outline" + onClicked: pageStack.push(barometerAdjustDialog,{}) + } + } + } + PressureSensor { + id: pressureSensor + active: true + } + ConfigurationValue { + id: barometerOffset + key: "/org/asteroidos/sensors/barometer-offset" + defaultValue: 0 + } + Component { + id: barometerAdjustDialog + Item { + id: root + Row { + id: valueSelector + anchors { + left: parent.left + leftMargin: DeviceInfo.hasRoundScreen ? Dims.w(5) : 0 + right: parent.right + rightMargin: DeviceInfo.hasRoundScreen ? Dims.w(5) : 0 + verticalCenter: parent.verticalCenter + } + height: parent.height*0.6 + + CircularSpinner { + id: hundredsSelector + height: parent.height + width: parent.width/5 + model: 11 + showSeparator: false + delegate: SpinnerDelegate { text: index } + } + CircularSpinner { + id: tensSelector + height: parent.height + width: parent.width/5 + model: 10 + delegate: SpinnerDelegate { text: index } + } + CircularSpinner { + id: onesSelector + height: parent.height + width: parent.width/5 + model: 10 + showSeparator: true + delegate: SpinnerDelegate { text: index } + } + CircularSpinner { + id: tenthsSelector + height: parent.height + width: parent.width/5 + model: 10 + showSeparator: false + delegate: SpinnerDelegate { text: index } + } + CircularSpinner { + id: hundredthsSelector + height: parent.height + width: parent.width/5 + model: 10 + showSeparator: false + delegate: SpinnerDelegate { text: index } + } + } + + Component.onCompleted: { + var currValue = barometerOffset.value + pressureSensor.reading.pressure; + console.log(currValue) + hundredsSelector.currentIndex = Math.floor((currValue/10000)) + tensSelector.currentIndex = Math.floor((currValue/1000)%10) + onesSelector.currentIndex = Math.floor((currValue/100)%10) + tenthsSelector.currentIndex = Math.floor((currValue/10)%10) + hundredthsSelector.currentIndex = Math.floor(currValue%10) + } + + IconButton { + iconName: "ios-checkmark-circle-outline" + anchors { + bottom: parent.bottom + horizontalCenter: parent.horizontalCenter + bottomMargin: Dims.iconButtonMargin + } + + onClicked: { + var newValue = hundredsSelector.currentIndex*10000 + tensSelector.currentIndex*1000 + onesSelector.currentIndex*100 + tenthsSelector.currentIndex*10 + hundredthsSelector.currentIndex + barometerOffset.value = newValue - pressureSensor.reading.pressure + pageStack.pop(pageStack.currentLayer) + } + } + } + } +} diff --git a/src/main.qml b/src/main.qml index 70bfc13..5471752 100644 --- a/src/main.qml +++ b/src/main.qml @@ -1,5 +1,6 @@ /* - * Copyright (C) 2022 - Darrel Griët <dgriet@gmail.com> + * Copyright (C) 2023 Arseniy Movshev <dodoradio@outlook.com> + * 2022 - Darrel Griët <dgriet@gmail.com> * 2017 - Florent Revest <revestflo@gmail.com> * - Niels Tholenaar <info@123quality.nl> * @@ -19,8 +20,8 @@ import QtQuick 2.5 import org.asteroid.controls 1.0 -import QtSensors 5.3 import QtGraphicalEffects 1.15 +import QtQml.Models 2.15 Application { id: app @@ -28,94 +29,49 @@ Application { centerColor: "#29A600" outerColor: "#070C00" - property int rotation: 0; - property int calibration: 0; - property int ringValueOffset: Math.sqrt(Math.pow(Dims.l(40), 2) / 2); - - Compass { - active: true - onReadingChanged: { - app.rotation = reading.azimuth; - app.calibration = reading.calibrationLevel; - } - } - - StatusPage { - //% "<h3>No data</h3>Calibrate the sensor by moving it in an ∞ figure." - text: qsTrId("id-no-data-calibrate") - icon: "ios-infinite-outline" - visible: !app.calibration - } - - Item { - visible: app.calibration - anchors.fill: parent + LayerStack { + id: pageStack + firstPage: Component { + MouseArea { + id: mainPage + PathView { // modified from circularspinner in qml-asteroid + id: pv + width: parent.width + height: Dims.h(100) + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + highlightRangeMode: PathView.StrictlyEnforceRange + highlightMoveDuration: 0 + clip: true + model: ObjectModel { + id: contentColumn + Compass { + height: pv.height + width: pv.width + property string name: qsTr("Compass") + } + Barometer { + height: pv.height + width: pv.width + property string name: qsTr("Barometer") + } + } - Item { - id: centerDisplay - anchors.fill: parent - Label { - id: magneticRotation - anchors.centerIn: parent - text: app.rotation - font { - pixelSize: parent.height / 4 - capitalization: Font.Capitalize - styleName: "SemiCondensed" - kerning: true - preferShaping: true - } - } - Label { - id: degreeSymbol - anchors.top: magneticRotation.top - anchors.left: magneticRotation.right - text: "°" - font { - pixelSize: parent.height / 4 - capitalization: Font.Capitalize - styleName: "SemiCondensed" - kerning: true - preferShaping: true + path: Path { + startX: pv.width/2; startY: pv.height/2-pv.count*pv.height/2 + PathLine { x: pv.width/2; y: pv.height/2+pv.count*pv.height/2 } + } } - } - Image { - anchors.top: parent.top - anchors.centerIn: parent - anchors.verticalCenterOffset: -Dims.l(35) - width: Dims.l(10) - height: width - source: "compass.svg" - } - } - Item { - anchors.fill: parent - rotation: -app.rotation - Repeater { - id: outerRing - anchors.fill: parent - model: 8 - Label { - property var angle: (index / outerRing.count) * 2 * Math.PI - property var cardinalDirections: ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] - rotation: app.rotation - color: index == 0 ? "#c2620c" : "white" - text: cardinalDirections[index] - anchors { - centerIn: parent - verticalCenterOffset: -Math.cos(angle) * Dims.l(40) - horizontalCenterOffset: Math.sin(angle) * Dims.l(40) - } - font { - pixelSize: index % 2 ? Dims.l(8) : Dims.l(10) - capitalization: Font.Capitalize - styleName: "Condensed Bold" - kerning: true - preferShaping: true - } + PageHeader { + text: pv.currentItem.name + z: 5 } } } } + Component { + id: settingsPage + SettingsPage {} + } } diff --git a/src/resources.qrc b/src/resources.qrc index acd1a74..804fc9e 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -1,6 +1,9 @@ <RCC> <qresource prefix="/"> <file>main.qml</file> + <file>Compass.qml</file> + <file>Barometer.qml</file> <file>compass.svg</file> + <file>SettingsPage.qml</file> </qresource> </RCC> |