From e323e66b19ddc8d85d54f6df9c6c2928c5366a01 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Fri, 19 Jan 2024 14:24:27 +0100 Subject: [PATCH 1/2] Update to Ubuntu Touch 20.04 focal --- app/qml/components/ExpandableListItem.qml | 4 ++-- app/qml/components/InfoBar.qml | 10 +++++----- app/qml/components/NotificationServiceItem.qml | 2 +- app/qml/components/StandardListItem.qml | 2 +- app/qml/pages/ExportPage.qml | 4 ++-- app/qml/pages/InfoPage.qml | 8 ++++---- app/qml/pages/LoadingPage.qml | 2 +- app/qml/pages/LocationPicker.qml | 2 +- app/qml/pages/MainMenuPage.qml | 2 +- app/qml/pages/ScreenshotPage.qml | 4 ++-- app/qml/pages/WatchesPage.qml | 2 +- app/qml/pages/WeatherSettingsDialog.qml | 2 +- app/qml/telescope.qml | 2 +- asteroidsyncservice | 2 +- asteroidsyncserviced.apparmor | 2 +- clickable.yaml | 2 +- manifest.json.in | 2 +- telescope.apparmor | 2 +- telescope.desktop.in | 2 +- 19 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/qml/components/ExpandableListItem.qml b/app/qml/components/ExpandableListItem.qml index c3e7def..4ebbda0 100644 --- a/app/qml/components/ExpandableListItem.qml +++ b/app/qml/components/ExpandableListItem.qml @@ -1,5 +1,5 @@ import QtQuick 2.4 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 ListItem { id: expandableListItem @@ -45,7 +45,7 @@ ListItem { rotation: expandableListItem.expansion.expanded ? 180 : 0 Behavior on rotation { - UbuntuNumberAnimation {} + LomiriNumberAnimation {} } } } diff --git a/app/qml/components/InfoBar.qml b/app/qml/components/InfoBar.qml index ea08fc5..8738e76 100644 --- a/app/qml/components/InfoBar.qml +++ b/app/qml/components/InfoBar.qml @@ -1,5 +1,5 @@ import QtQuick 2.4 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 Rectangle { id: infoBar @@ -49,14 +49,14 @@ Rectangle { SequentialAnimation { id: animaDestroy - UbuntuNumberAnimation { + LomiriNumberAnimation { target: infoBar.anchors property: "bottomMargin" to: -infoBar.height duration: 500; easing.type: Easing.InOutCirc } - UbuntuNumberAnimation { + LomiriNumberAnimation { target: infoBar property: "opacity" to: 0 @@ -66,10 +66,10 @@ Rectangle { Behavior on opacity { - UbuntuNumberAnimation { duration: 500; easing.type: Easing.InOutCirc } + LomiriNumberAnimation { duration: 500; easing.type: Easing.InOutCirc } } Behavior on anchors.bottomMargin { - UbuntuNumberAnimation { duration: 500; easing.type: Easing.InOutCirc } + LomiriNumberAnimation { duration: 500; easing.type: Easing.InOutCirc } } } diff --git a/app/qml/components/NotificationServiceItem.qml b/app/qml/components/NotificationServiceItem.qml index 3c2cb42..001aec5 100644 --- a/app/qml/components/NotificationServiceItem.qml +++ b/app/qml/components/NotificationServiceItem.qml @@ -1,5 +1,5 @@ import QtQuick 2.4 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 import "../components" Item { diff --git a/app/qml/components/StandardListItem.qml b/app/qml/components/StandardListItem.qml index 7438f0f..015a693 100644 --- a/app/qml/components/StandardListItem.qml +++ b/app/qml/components/StandardListItem.qml @@ -1,5 +1,5 @@ import QtQuick 2.4 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 ListItem { id: listItem diff --git a/app/qml/pages/ExportPage.qml b/app/qml/pages/ExportPage.qml index 32e7c17..7325d8d 100644 --- a/app/qml/pages/ExportPage.qml +++ b/app/qml/pages/ExportPage.qml @@ -1,6 +1,6 @@ import QtQuick 2.9 -import Ubuntu.Components 1.3 -import Ubuntu.Content 1.3 +import Lomiri.Components 1.3 +import Lomiri.Content 1.3 import "../components" Page { diff --git a/app/qml/pages/InfoPage.qml b/app/qml/pages/InfoPage.qml index c9d8927..284a990 100644 --- a/app/qml/pages/InfoPage.qml +++ b/app/qml/pages/InfoPage.qml @@ -1,6 +1,6 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 Page { @@ -33,7 +33,7 @@ Page { anchors.top: header.bottom width:parent.width - UbuntuShape { + LomiriShape { width: units.gu(15); height: units.gu(15) anchors.horizontalCenter: parent.horizontalCenter radius: "medium" @@ -53,7 +53,7 @@ Page { Label { width: parent.width - color: UbuntuColors.ash + color: LomiriColors.ash horizontalAlignment: Text.AlignHCenter text: i18n.tr("Version ") + "0.0.7" } @@ -67,7 +67,7 @@ Page { Label { width: parent.width - linkColor: UbuntuColors.orange + linkColor: LomiriColors.orange horizontalAlignment: Text.AlignHCenter wrapMode: Text.WrapAtWordBoundaryOrAnywhere //TRANSLATORS: Please make sure the URLs are correct diff --git a/app/qml/pages/LoadingPage.qml b/app/qml/pages/LoadingPage.qml index 861e291..42fd64d 100644 --- a/app/qml/pages/LoadingPage.qml +++ b/app/qml/pages/LoadingPage.qml @@ -1,6 +1,6 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 Page { id: root diff --git a/app/qml/pages/LocationPicker.qml b/app/qml/pages/LocationPicker.qml index 2b67018..f022ac7 100644 --- a/app/qml/pages/LocationPicker.qml +++ b/app/qml/pages/LocationPicker.qml @@ -1,6 +1,6 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 Page { diff --git a/app/qml/pages/MainMenuPage.qml b/app/qml/pages/MainMenuPage.qml index 4fcf518..44bae88 100644 --- a/app/qml/pages/MainMenuPage.qml +++ b/app/qml/pages/MainMenuPage.qml @@ -1,7 +1,7 @@ import QtQuick 2.4 import QtQuick.Controls.Suru 2.2 import QtQuick.Layouts 1.1 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 import "../components" Page { diff --git a/app/qml/pages/ScreenshotPage.qml b/app/qml/pages/ScreenshotPage.qml index 4638dfe..80ecf4b 100644 --- a/app/qml/pages/ScreenshotPage.qml +++ b/app/qml/pages/ScreenshotPage.qml @@ -1,7 +1,7 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 -import Ubuntu.Components 1.3 -import Ubuntu.Content 1.3 +import Lomiri.Components 1.3 +import Lomiri.Content 1.3 Page { id: scrShot diff --git a/app/qml/pages/WatchesPage.qml b/app/qml/pages/WatchesPage.qml index 391a192..a60e669 100644 --- a/app/qml/pages/WatchesPage.qml +++ b/app/qml/pages/WatchesPage.qml @@ -1,7 +1,7 @@ import QtQuick 2.4 import QtQuick.Controls.Suru 2.2 import QtQuick.Layouts 1.1 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 Page { id: watchesPage diff --git a/app/qml/pages/WeatherSettingsDialog.qml b/app/qml/pages/WeatherSettingsDialog.qml index 0026a39..e0ed869 100644 --- a/app/qml/pages/WeatherSettingsDialog.qml +++ b/app/qml/pages/WeatherSettingsDialog.qml @@ -1,6 +1,6 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 Page { diff --git a/app/qml/telescope.qml b/app/qml/telescope.qml index 984b855..d2ccb79 100644 --- a/app/qml/telescope.qml +++ b/app/qml/telescope.qml @@ -1,6 +1,6 @@ import QtQuick 2.4 import QtQuick.Controls.Suru 2.2 -import Ubuntu.Components 1.3 +import Lomiri.Components 1.3 import org.asteroid.syncservice 1.0 import "controller" diff --git a/asteroidsyncservice b/asteroidsyncservice index 96126da..eacc910 160000 --- a/asteroidsyncservice +++ b/asteroidsyncservice @@ -1 +1 @@ -Subproject commit 96126da22054657d649fca4501647321500176f4 +Subproject commit eacc9103bfb11c373a8301123be6e4b62d33352d diff --git a/asteroidsyncserviced.apparmor b/asteroidsyncserviced.apparmor index ed6e2d5..bb1e075 100644 --- a/asteroidsyncserviced.apparmor +++ b/asteroidsyncserviced.apparmor @@ -8,5 +8,5 @@ "content_exchange_source" ], "template": "unconfined", - "policy_version": 16.04 + "policy_version": 20.04 } diff --git a/clickable.yaml b/clickable.yaml index 9e642a0..4edb27e 100644 --- a/clickable.yaml +++ b/clickable.yaml @@ -1,4 +1,4 @@ -clickable_minimum_required: 7.1.2 +clickable_minimum_required: 8.0.0 builder: qmake kill: telescope build_args: CONFIG+=telescope diff --git a/manifest.json.in b/manifest.json.in index 6adc49c..4e30356 100644 --- a/manifest.json.in +++ b/manifest.json.in @@ -15,6 +15,6 @@ }, "version": "0.0.7", "maintainer": "Stefan Weng ", - "framework" : "ubuntu-sdk-16.04.5" + "framework" : "ubuntu-sdk-20.04" } diff --git a/telescope.apparmor b/telescope.apparmor index 62c8236..c55fa0c 100644 --- a/telescope.apparmor +++ b/telescope.apparmor @@ -5,5 +5,5 @@ "accounts" ], "template": "unconfined", - "policy_version": 16.04 + "policy_version": 20.04 } diff --git a/telescope.desktop.in b/telescope.desktop.in index e23a85b..37a54e5 100644 --- a/telescope.desktop.in +++ b/telescope.desktop.in @@ -4,4 +4,4 @@ Exec=env QML2_IMPORT_PATH=usr/lib/$${ARCH_TRIPLET}/qt5/qml telescope Icon=assets/icon.svg Terminal=false Type=Application -X-Ubuntu-Touch=true +X-Lomiri-Touch=true \ No newline at end of file From b8bcda78411a199754a349fa0505362e84362f04 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Mon, 12 Feb 2024 17:31:50 +0100 Subject: [PATCH 2/2] move to cmake --- CMakeLists.txt | 87 ++++++++++++++++++++++++++++++++++++++++++++++ app/CMakeLists.txt | 5 +++ clickable.yaml | 6 ++-- po/CMakeLists.txt | 36 +++++++++++++++++++ telescope.pro | 45 ------------------------ version.pri | 2 -- 6 files changed, 131 insertions(+), 50 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 app/CMakeLists.txt create mode 100644 po/CMakeLists.txt delete mode 100644 telescope.pro delete mode 100644 version.pri diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0831b80 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,87 @@ +cmake_minimum_required(VERSION 3.0.0) +project(telescope C CXX) + +# Automatically create moc files +set(CMAKE_AUTOMOC ON) + +find_package(Qt5Core REQUIRED) +find_package(Qt5Qml REQUIRED) +find_package(Qt5Quick REQUIRED) +find_package(Qt5QuickControls2 REQUIRED) + +execute_process( + COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH + OUTPUT_VARIABLE ARCH_TRIPLET + OUTPUT_STRIP_TRAILING_WHITESPACE +) +set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}") + +set(PROJECT_NAME "telescope") +set(FULL_PROJECT_NAME "telescope.asteroidos") +set(DATA_DIR /) +set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop) + +# This command figures out the minimum SDK framework for use in the manifest +# file via the environment variable provided by Clickable or sets a default value otherwise. +if(DEFINED ENV{SDK_FRAMEWORK}) + set(CLICK_FRAMEWORK "$ENV{SDK_FRAMEWORK}") +else() + set(CLICK_FRAMEWORK "ubuntu-sdk-20.04") +endif() + +# This figures out the target architecture for use in the manifest file. +if(DEFINED ENV{ARCH}) + set(CLICK_ARCH "$ENV{ARCH}") +else() + execute_process( + COMMAND dpkg-architecture -qDEB_HOST_ARCH + OUTPUT_VARIABLE CLICK_ARCH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() + +configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR}) +install(FILES asteroidsyncserviced.apparmor DESTINATION ${DATA_DIR}) +install(FILES assets/icon.svg assets/icon.png DESTINATION assets) + +# Translations +file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js) +list(APPEND I18N_SRC_FILES ${DESKTOP_FILE_NAME}.in.h) + +find_program(INTLTOOL_MERGE intltool-merge) +if(NOT INTLTOOL_MERGE) + message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package") +endif() +find_program(INTLTOOL_EXTRACT intltool-extract) +if(NOT INTLTOOL_EXTRACT) + message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package") +endif() + +add_custom_target(${DESKTOP_FILE_NAME} ALL + COMMENT "Merging translations into ${DESKTOP_FILE_NAME}..." + COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${CMAKE_SOURCE_DIR}/${DESKTOP_FILE_NAME}.in ${DESKTOP_FILE_NAME} + COMMAND sed -i 's/${PROJECT_NAME}-//g' ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} +) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR}) + +add_subdirectory(po) +add_subdirectory(app) +add_subdirectory(asteroidsyncservice) + +# Make source files visible in qtcreator +file(GLOB_RECURSE PROJECT_SRC_FILES + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + qml/*.qml + qml/*.js + app/* + asteroidsyncservice/* + *.json + *.json.in + *.apparmor + *.desktop.in +) + +add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES}) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt new file mode 100644 index 0000000..8cc918e --- /dev/null +++ b/app/CMakeLists.txt @@ -0,0 +1,5 @@ +qt5_add_resources(QT_RESOURCES app.qrc) +add_executable(${PROJECT_NAME} main.cpp ${QT_RESOURCES}) +set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS_RELEASE -s) +target_link_libraries(${PROJECT_NAME} Qt5::Gui Qt5::Qml Qt5::Quick Qt5::QuickControls2) +install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/clickable.yaml b/clickable.yaml index 4edb27e..518fed8 100644 --- a/clickable.yaml +++ b/clickable.yaml @@ -1,7 +1,7 @@ clickable_minimum_required: 8.0.0 -builder: qmake +builder: cmake kill: telescope -build_args: CONFIG+=telescope -make_jobs: 2 +build_args: -DUBUNTU_TOUCH_PLATFORM=ON +make_jobs: 1 ignore_review_warnings: true diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..91b6741 --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,36 @@ +include(FindGettext) +find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext) + +set(DOMAIN ${FULL_PROJECT_NAME}) +set(POT_FILE ${DOMAIN}.pot) +file(GLOB PO_FILES *.po) + +# Creates the .pot file containing the translations template +add_custom_target(${POT_FILE} ALL + COMMENT "Generating translation template" + COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini + --srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE_NAME}.in + + COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE} + -D ${CMAKE_CURRENT_SOURCE_DIR} + -D ${CMAKE_CURRENT_BINARY_DIR} + --from-code=UTF-8 + --c++ --qt --language=javascript --add-comments=TRANSLATORS + --keyword=tr --keyword=tr:1,2 --keyword=ctr:1c,2 --keyword=dctr:2c,3 --keyword=N_ --keyword=_ + --keyword=dtr:2 --keyword=dtr:2,3 --keyword=tag --keyword=tag:1c,2 + --package-name='${DOMAIN}' + --sort-by-file + ${I18N_SRC_FILES} +# COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR} +) + +# Builds the binary translations catalog for each language +# it finds source translations (*.po) for +foreach(PO_FILE ${PO_FILES}) + get_filename_component(LANG ${PO_FILE} NAME_WE) + gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE}) + set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/share/locale/${LANG}/LC_MESSAGES) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo + DESTINATION ${INSTALL_DIR} + RENAME ${DOMAIN}.mo) +endforeach(PO_FILE) diff --git a/telescope.pro b/telescope.pro deleted file mode 100644 index dc4da77..0000000 --- a/telescope.pro +++ /dev/null @@ -1,45 +0,0 @@ -TEMPLATE = subdirs - -load(ubuntu-click) - -SUBDIRS += app asteroidsyncservice - -# specify the manifest file, this file is required for click -# packaging and for the IDE to create runconfigurations -UBUNTU_MANIFEST_FILE=manifest.json.in - -# specify translation domain, this must be equal with the -# app name in the manifest file -UBUNTU_TRANSLATION_DOMAIN="telescope.asteroidos" - -# specify the source files that should be included into -# the translation file, from those files a translation -# template is created in po/template.pot, to create a -# translation copy the template to e.g. de.po and edit the sources -UBUNTU_TRANSLATION_SOURCES+= \ - $$files(app/qml/*.qml,true) - -# specifies all translations files and makes sure they are -# compiled and installed into the right place in the click package -UBUNTU_PO_FILES+=$$files(po/*.po) - -ASSETS_FILES += assets/icon.svg - -ARCH_TRIPLET=$$(ARCH_TRIPLET) -QMAKE_SUBSTITUTES += telescope.desktop.in - -#specify where the config files are installed to -assets_files.path = /assets -assets_files.files += $${ASSETS_FILES} -message($$assets_files.files) -INSTALLS+=assets_files - -OTHER_FILES += asteroidsyncserviced.apparmor \ - telescope.apparmor \ - telescope.desktop - -#specify where the config files are installed to -config_files.path = / -config_files.files += $${OTHER_FILES} -message($$config_files.files) -INSTALLS+=config_files diff --git a/version.pri b/version.pri deleted file mode 100644 index 1c42433..0000000 --- a/version.pri +++ /dev/null @@ -1,2 +0,0 @@ -VERSION = "1.0" -DEFINES += VERSION=\\\"$$VERSION\\\"