From 16b4a80576dce784f9ab9ea6d5401f86a7567ea8 Mon Sep 17 00:00:00 2001 From: Arseniy Movshev Date: Fri, 26 May 2023 22:57:53 +0100 Subject: initial commit: rename and add demo code Based on asteroid-helloworld --- CMakeLists.txt | 10 +++++----- asteroid-health.desktop.template | 7 +++++++ asteroid-health.in | 3 +++ asteroid-helloworld.desktop.template | 7 ------- asteroid-helloworld.in | 3 --- i18n/asteroid-health.desktop.h | 6 ++++++ i18n/asteroid-helloworld.desktop.h | 6 ------ src/CMakeLists.txt | 8 ++++---- src/main.qml | 12 +++++++++--- 9 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 asteroid-health.desktop.template create mode 100644 asteroid-health.in delete mode 100644 asteroid-helloworld.desktop.template delete mode 100644 asteroid-helloworld.in create mode 100644 i18n/asteroid-health.desktop.h delete mode 100644 i18n/asteroid-helloworld.desktop.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b7965f..bf0a494 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) -project(asteroid-helloworld +project(asteroid-health VERSION 0.0.1 DESCRIPTION "Sample application to get started on Asteroid") @@ -17,14 +17,14 @@ include(AsteroidTranslations) add_subdirectory(src) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/asteroid-helloworld.in - ${CMAKE_BINARY_DIR}/asteroid-helloworld +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/asteroid-health.in + ${CMAKE_BINARY_DIR}/asteroid-health @ONLY) -install(PROGRAMS ${CMAKE_BINARY_DIR}/asteroid-helloworld +install(PROGRAMS ${CMAKE_BINARY_DIR}/asteroid-health DESTINATION ${CMAKE_INSTALL_BINDIR}) -generate_desktop(${CMAKE_SOURCE_DIR} asteroid-helloworld) +generate_desktop(${CMAKE_SOURCE_DIR} asteroid-health) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/asteroid-health.desktop.template b/asteroid-health.desktop.template new file mode 100644 index 0000000..c7c33b5 --- /dev/null +++ b/asteroid-health.desktop.template @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Categories=Applications; +Exec=asteroid-health +Icon=ios-pulse-outline +X-Asteroid-Center-Color=#b04d1c +X-Asteroid-Outer-Color=#421c0a diff --git a/asteroid-health.in b/asteroid-health.in new file mode 100644 index 0000000..acc92e2 --- /dev/null +++ b/asteroid-health.in @@ -0,0 +1,3 @@ +#!/bin/sh + +exec invoker --single-instance --type=qt5 @CMAKE_INSTALL_FULL_LIBDIR@/asteroid-health.so diff --git a/asteroid-helloworld.desktop.template b/asteroid-helloworld.desktop.template deleted file mode 100644 index 7276d69..0000000 --- a/asteroid-helloworld.desktop.template +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Categories=Applications; -Exec=asteroid-helloworld -Icon=ios-pulse-outline -X-Asteroid-Center-Color=#b04d1c -X-Asteroid-Outer-Color=#421c0a diff --git a/asteroid-helloworld.in b/asteroid-helloworld.in deleted file mode 100644 index 1083798..0000000 --- a/asteroid-helloworld.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec invoker --single-instance --type=qt5 @CMAKE_INSTALL_FULL_LIBDIR@/asteroid-helloworld.so diff --git a/i18n/asteroid-health.desktop.h b/i18n/asteroid-health.desktop.h new file mode 100644 index 0000000..f5e8875 --- /dev/null +++ b/i18n/asteroid-health.desktop.h @@ -0,0 +1,6 @@ +/* This dummy header is just used to generate a translatable Qt string that + * will be integrated to i18n/.ts files, translated on Weblate and then merged + * back with the .desktop.template file into a single .desktop file. */ + +//% "Hello World App" +qtTrId("id-app-launcher-name"); diff --git a/i18n/asteroid-helloworld.desktop.h b/i18n/asteroid-helloworld.desktop.h deleted file mode 100644 index f5e8875..0000000 --- a/i18n/asteroid-helloworld.desktop.h +++ /dev/null @@ -1,6 +0,0 @@ -/* This dummy header is just used to generate a translatable Qt string that - * will be integrated to i18n/.ts files, translated on Weblate and then merged - * back with the .desktop.template file into a single .desktop file. */ - -//% "Hello World App" -qtTrId("id-app-launcher-name"); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c6b802c..f6a79d1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,8 @@ -add_library(asteroid-helloworld main.cpp resources.qrc) -set_target_properties(asteroid-helloworld PROPERTIES PREFIX "") +add_library(asteroid-health main.cpp resources.qrc) +set_target_properties(asteroid-health PROPERTIES PREFIX "") -target_link_libraries(asteroid-helloworld PUBLIC +target_link_libraries(asteroid-health PUBLIC AsteroidApp) -install(TARGETS asteroid-helloworld +install(TARGETS asteroid-health DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/main.qml b/src/main.qml index 9c181e2..04e5c21 100644 --- a/src/main.qml +++ b/src/main.qml @@ -1,5 +1,6 @@ /* - * Copyright (C) 2019 Florent Revest + * Copyright (C) 2023 Arseniy Movshev + * 2019 Florent Revest * * 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 @@ -18,16 +19,21 @@ import QtQuick 2.9 import org.asteroid.controls 1.0 +import org.asteroid.sensorlogd 1.0 + Application { id: app centerColor: "#b04d1c" outerColor: "#421c0a" + StepsDataLoader { + Component.onCompleted: stepsLabel.text = getTodayData() + } + Label { - id: hello + id: stepsLabel anchors.centerIn: parent horizontalAlignment: Text.AlignHCenter - text: "Hello World!" } } -- cgit v1.2.3-70-g09d2