From 60be21ead988b97c6a0793c0ec9fe1594fbdefd1 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Fri, 13 Dec 2024 12:50:05 +0100 Subject: [PATCH 01/31] compile with cmake --- .gitignore | 1 + CMakeLists.txt | 41 +++++++ daemon/CMakeLists.txt | 235 +++++++++++++++++++++++++++++++++++++ lib/CMakeLists.txt | 33 ++++++ ui/CMakeLists.txt | 88 ++++++++++++++ ui/amazfish.qrc | 54 --------- ui/o2/src/CMakeLists.txt | 6 +- ui/platform-kirigami.qrc | 58 +++++++++ ui/platform-qtcontrols.qrc | 57 +++++++++ ui/platform-silica.qrc | 59 ++++++++++ ui/platform-uuitk.qrc | 59 ++++++++++ ui/update-qrc.sh | 23 ++++ 12 files changed, 657 insertions(+), 57 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 daemon/CMakeLists.txt create mode 100644 lib/CMakeLists.txt create mode 100644 ui/CMakeLists.txt create mode 100644 ui/platform-kirigami.qrc create mode 100644 ui/platform-qtcontrols.qrc create mode 100644 ui/platform-silica.qrc create mode 100644 ui/platform-uuitk.qrc create mode 100755 ui/update-qrc.sh diff --git a/.gitignore b/.gitignore index 335f3799..738287d1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ harbour-amazfish.pro.user* .clickable/ 3rdparty/ build/ +CMakeLists.txt.* \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..b6d5a470 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.16) + +project(harbour-amazfish LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +include(GNUInstallDirs) +include(FeatureSummary) + +find_package(Qt5 COMPONENTS Core Gui Quick Sql DBus LinguistTools REQUIRED) + +if(NOT DEFINED FLAVOR) + message(FATAL_ERROR "Please specify the platform using -DFLAVOR=platform as a CMake option. Supported platforms: kirigami, silica, qtcontrols, uuitk.") +elseif(FLAVOR STREQUAL "silica") + add_definitions(-DMER_EDITION_SAILFISH) +elseif(FLAVOR STREQUAL "kirigami") + add_definitions(-Dflavor_kirigami) +elseif(FLAVOR STREQUAL "qtcontrols") + add_definitions(-Dflavor_qtcontrols) +elseif(FLAVOR STREQUAL "uuitk") + add_definitions(-DUUITK_EDITION) + add_subdirectory(click) +else() + message(FATAL_ERROR "Unsupported platform '${FLAVOR}'. Supported platforms: kirigami, silica, qtcontrols, uuitk.") +endif() + +add_subdirectory(qble) +add_subdirectory(lib) +add_subdirectory(daemon) +add_subdirectory(ui) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt new file mode 100644 index 00000000..c1ac8de9 --- /dev/null +++ b/daemon/CMakeLists.txt @@ -0,0 +1,235 @@ + +set(SOURCES +./src/activitycoordinate.cpp +./src/activitykind.cpp +./src/activitysample.cpp +./src/activitysummary.cpp +./src/bipactivitydetailparser.cpp +./src/bipbatteryinfo.cpp +./src/dbushrm.cpp +./src/devicefactory.cpp +./src/deviceinterface.cpp +./src/devices/abstractdevice.cpp +./src/devices/abstractfirmwareinfo.cpp +./src/devices/asteroidosdevice.cpp +./src/devices/banglejsdevice.cpp +./src/devices/bipdevice.cpp +./src/devices/bipfirmwareinfo.cpp +./src/devices/biplitedevice.cpp +./src/devices/biplitefirmwareinfo.cpp +./src/devices/bipsdevice.cpp +./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/gtsdevice.cpp +./src/devices/gtsfirmwareinfo.cpp +./src/devices/huamidevice.cpp +./src/devices/huamifirmwareinfo.cpp +./src/devices/infinitimefirmwareinfo.cpp +./src/devices/neodevice.cpp +./src/devices/neofirmwareinfo.cpp +./src/devices/pinetimejfdevice.cpp +./src/harbour-amazfish-daemon.cpp +./src/huamiweathercondition.cpp +./src/navigationinterface.cpp +./src/operations/abstractfetchoperation.cpp +./src/operations/abstractoperation.cpp +./src/operations/activityfetchoperation.cpp +./src/operations/adafruitblefsoperation.cpp +./src/operations/adafruitblefsworker.cpp +./src/operations/dfuoperation.cpp +./src/operations/dfuworker.cpp +./src/operations/huamiupdatefirmwareoperation2020.cpp +./src/operations/logfetchoperation.cpp +./src/operations/sportsdetailoperation.cpp +./src/operations/sportssummaryoperation.cpp +./src/operations/updatefirmwareoperation.cpp +./src/operations/updatefirmwareoperationnew.cpp +./src/qaesencryption.cpp +./src/realtimeactivitysample.cpp +./src/services/adafruitblefsservice.cpp +./src/services/alertnotificationservice.cpp +./src/services/asteroidmediaservice.cpp +./src/services/asteroidnotificationservice.cpp +./src/services/asteroidscreenshotservice.cpp +./src/services/asteroidtimeservice.cpp +./src/services/asteroidweatherservice.cpp +./src/services/batteryservice.cpp +./src/services/bipfirmwareservice.cpp +./src/services/currenttimeservice.cpp +./src/services/deviceinfoservice.cpp +./src/services/dfuservice.cpp +./src/services/hrmservice.cpp +./src/services/immediatealertservice.cpp +./src/services/infinitimemotionservice.cpp +./src/services/infinitimenavservice.cpp +#./src/services/infinitimeresourceservice.cpp +./src/services/infinitimeweatherservice.cpp +./src/services/miband2service.cpp +./src/services/mibandservice.cpp +./src/services/pinetimemusicservice.cpp +./src/services/pinetimesimpleweatherservice.cpp +./src/services/uartservice.cpp +./src/transliterator.cpp +./src/typeconversion.cpp +) + +set(HEADERS +./src/activitycoordinate.h +./src/activitykind.h +./src/activitysample.h +./src/activitysummary.h +./src/bipactivitydetailparser.h +./src/bipbatteryinfo.h +./src/codec.h +./src/dbushrm.h +./src/devicefactory.h +./src/deviceinterface.h +./src/devices/abstractdevice.h +./src/devices/abstractfirmwareinfo.h +./src/devices/asteroidosdevice.h +./src/devices/banglejsdevice.h +./src/devices/bipdevice.h +./src/devices/bipfirmwareinfo.h +./src/devices/biplitedevice.h +./src/devices/biplitefirmwareinfo.h +./src/devices/bipsdevice.h +./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/gtsdevice.h +./src/devices/gtsfirmwareinfo.h +./src/devices/huamidevice.h +./src/devices/huamifirmwareinfo.h +./src/devices/infinitimefirmwareinfo.h +./src/devices/neodevice.h +./src/devices/neofirmwareinfo.h +./src/devices/pinetimejfdevice.h +./src/huamiweathercondition.h +./src/navigationinterface.h +./src/operations/abstractfetchoperation.h +./src/operations/abstractoperation.h +./src/operations/activityfetchoperation.h +./src/operations/adafruitblefsoperation.h +./src/operations/adafruitblefsworker.h +./src/operations/dfuoperation.h +./src/operations/dfuworker.h +./src/operations/huamiupdatefirmwareoperation2020.h +./src/operations/logfetchoperation.h +./src/operations/sportsdetailoperation.h +./src/operations/sportssummaryoperation.h +./src/operations/updatefirmwareoperation.h +./src/operations/updatefirmwareoperationnew.h +./src/qaesencryption.h +./src/realtimeactivitysample.h +./src/services/adafruitblefsservice.h +./src/services/alertnotificationservice.h +./src/services/asteroidmediaservice.h +./src/services/asteroidnotificationservice.h +./src/services/asteroidscreenshotservice.h +./src/services/asteroidtimeservice.h +./src/services/asteroidweatherservice.h +./src/services/batteryservice.h +./src/services/bipfirmwareservice.h +./src/services/currenttimeservice.h +./src/services/deviceinfoservice.h +./src/services/dfuservice.h +./src/services/hrmservice.h +./src/services/immediatealertservice.h +./src/services/infinitimemotionservice.h +./src/services/infinitimenavservice.h +#./src/services/infinitimeresourceservice.h +./src/services/infinitimeweatherservice.h +./src/services/miband2service.h +./src/services/mibandservice.h +./src/services/pinetimemusicservice.h +./src/services/pinetimesimpleweatherservice.h +./src/services/uartservice.h +./src/transliterator.h +./src/typeconversion.h +) + + +set(WATCHFISH_FEATURES "notificationmonitor;walltime;music;calendar;voicecall;volume") + +if(FLAVOR STREQUAL "silica") + +# message(SailfishOS daemon build) +# DEFINES += MER_EDITION_SAILFISH +# LIBS += -lkeepalive -lpulse-simple +# CONFIG += sailfishapp +# CONFIG += link_pkgconfig +# PKGCONFIG += mlite5 libpulse +# WATCHFISH_FEATURES += music \ +# voicecall \ +# notificationmonitor \ +# calendar + +elseif(FLAVOR STREQUAL "uuitk") + +# DEFINES += UUITK_EDITION +# LIBS += -lpulse-simple +# PKGCONFIG += libpulse +# WATCHFISH_FEATURES += music \ +# voicecall \ +# notificationmonitor \ +# calendar + +else() + set(WATCHFISH_FEATURES "notificationmonitor;music;calendar") +endif() + +add_subdirectory(libwatchfish) + +find_package(Qt5 COMPONENTS Gui Widgets Positioning Network REQUIRED) +find_package(KF5Archive REQUIRED) +find_package(ZLIB REQUIRED) +find_package(ICU REQUIRED COMPONENTS uc i18n data) +find_package(KDb REQUIRED) + +add_executable(harbour-amazfishd ${SOURCES} ${HEADERS}) + +install(TARGETS harbour-amazfishd RUNTIME + DESTINATION ${CMAKE_INSTALL_BINDIR}) + +target_include_directories(harbour-amazfishd PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/src/devices + ${CMAKE_CURRENT_SOURCE_DIR}/src/operations + ${CMAKE_CURRENT_SOURCE_DIR}/src/services + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + +target_compile_definitions(harbour-amazfishd + PRIVATE $<$,$>:QT_QML_DEBUG>) + +target_link_libraries(harbour-amazfishd + PRIVATE + libwatchfish libamazfish qble + Qt5::Gui Qt5::Widgets Qt5::Core Qt5::Positioning Qt5::Network + KF5::Archive + ZLIB::ZLIB + ICU::uc ICU::i18n ICU::data + KDb +) + + +## translations +file(GLOB TS_FILES translations/*.ts) + +# TODO check if translation path is correct on all platforms +if(FLAVOR STREQUAL "uuitk") + add_definitions(-DTRANSLATION_FOLDER="./share/harbour-amazfish/translations") +else() + add_definitions(-DTRANSLATION_FOLDER=".") +endif() + +QT5_ADD_TRANSLATION(QM_FILES ${TS_FILES}) +add_custom_target(daemon_translations DEPENDS ${QM_FILES}) +add_dependencies(harbour-amazfishd daemon_translations) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 00000000..519aba03 --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.16) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_library(libamazfish STATIC) + +find_package(Qt5 REQUIRED COMPONENTS Core DBus Xml) + +target_include_directories(libamazfish PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) +target_link_libraries(libamazfish PUBLIC Qt5::Core Qt5::DBus Qt5::Xml) + +set(SOURCES + ./src/amazfish.cpp + ./src/amazfishconfig.cpp + ./src/weather/city.cpp + ./src/weather/citymanager.cpp + ./src/weather/citysearchmodel.cpp + ./src/weather/currentweather.cpp +) + +set(HEADERS + ./src/weather/apikey.h + ./src/weather/city.h + ./src/weather/citymanager.h + ./src/weather/citysearchmodel.h + ./src/weather/currentweather.h + ./src/amazfish.h + ./src/amazfishconfig.h +) + +target_sources(libamazfish PUBLIC ${SOURCES} ${HEADERS}) + diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt new file mode 100644 index 00000000..df94c0eb --- /dev/null +++ b/ui/CMakeLists.txt @@ -0,0 +1,88 @@ +set(o2_WITH_KEYCHAIN OFF CACHE BOOL "keychain store" FORCE) +add_subdirectory(o2) + + +file(GLOB TS_FILES translations/*.ts) + +if(FLAVOR STREQUAL "uuitk") + add_definitions(-DTRANSLATION_FOLDER="./share/harbour-amazfish/translations") +else() + add_definitions(-DTRANSLATION_FOLDER=".") +endif() + +list(APPEND RESOURCES amazfish.qrc) +list(APPEND RESOURCES icons.qrc) +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/platform-${FLAVOR}.qrc") + list(APPEND RESOURCES "platform-${FLAVOR}.qrc") +else() + message(WARNING "Resource file 'platform-${FLAVOR}.qrc' not found. Proceeding without it.") +endif() + +set(SOURCES + ./src/datasource.cpp + ./src/sportsdatamodel.cpp + ./src/sportsmetamodel.cpp + ./src/timeformatter.cpp + ./src/harbour-amazfish-ui.cpp + ./src/trackloader.cpp + ./src/daemoninterface.cpp +) + +set(HEADERS + ./src/datasource.h + ./src/sportsdatamodel.h + ./src/sportsmetamodel.h + ./src/timeformatter.h + ./src/trackloader.h + ./src/daemoninterface.h +) + +add_executable(harbour-amazfish-ui + ${SOURCES} + ${HEADERS} + ${RESOURCES} + ${TS_FILES} +) + +find_package(Qt5 COMPONENTS Gui Widgets Quick Positioning REQUIRED) +find_package(KDb REQUIRED) + +QT5_ADD_TRANSLATION(QM_FILES ${TS_FILES}) +add_custom_target(ui_translations DEPENDS ${QM_FILES}) +add_dependencies(harbour-amazfish-ui ui_translations) + +QT5_CREATE_TRANSLATION(QT_FILES "${CMAKE_SOURCE_DIR}" + OPTIONS "-no-obsolete") + +install(FILES ${QM_FILES} + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfish/translations") + +install(TARGETS harbour-amazfish-ui RUNTIME + DESTINATION ${CMAKE_INSTALL_BINDIR}) + +target_include_directories(harbour-amazfish-ui PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + +target_compile_definitions(harbour-amazfish-ui + PRIVATE $<$,$>:QT_QML_DEBUG>) + +target_link_libraries(harbour-amazfish-ui + PRIVATE + libamazfish libwatchfish qble + Qt5::Core Qt5::Widgets Qt5::Quick Qt5::Positioning + KDb + o2 +) + +#install(FILES "harbour-amazfish.desktop" +# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") + +install(FILES "icons/256x256/harbour-amazfish.png" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps") + +install(FILES "icons/512x512/harbour-amazfish.png" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps") + +# install(FILES "harbour-amazfish.appdata.xml" +# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") diff --git a/ui/amazfish.qrc b/ui/amazfish.qrc index 9a76efe9..6ada08c3 100644 --- a/ui/amazfish.qrc +++ b/ui/amazfish.qrc @@ -1,57 +1,5 @@ - qml/components/platform.kirigami/ApplicationWindowPL.qml - qml/components/platform.kirigami/BusyIndicatorPL.qml - qml/components/platform.kirigami/BusyIndicatorSmallPL.qml - qml/components/platform.kirigami/ButtonPL.qml - qml/components/platform.kirigami/ClipboardPL.qml - qml/components/platform.kirigami/ComboBoxPL.qml - qml/components/platform.kirigami/ContextMenuItemPL.qml - qml/components/platform.kirigami/ContextMenuPL.qml - qml/components/platform.kirigami/DatePickerDialogPL.qml - qml/components/platform.kirigami/DialogAutoPL.qml - qml/components/platform.kirigami/DialogListPL.qml - qml/components/platform.kirigami/DialogPL.qml - qml/components/platform.kirigami/ExpandingSectionGroupPL.qml - qml/components/platform.kirigami/ExpandingSectionPL.qml - qml/components/platform.kirigami/FileSelectorPL.qml - qml/components/platform.kirigami/FormLayoutPL.qml - qml/components/platform.kirigami/IconButtonPL.qml - qml/components/platform.kirigami/IconPL.qml - qml/components/platform.kirigami/LabelPL.qml - qml/components/platform.kirigami/ListViewPL.qml - qml/components/platform.kirigami/ListItemPL.qml - qml/components/platform.kirigami/MenuDrawerItemPL.qml - qml/components/platform.kirigami/MenuDrawerPL.qml - qml/components/platform.kirigami/MenuDrawerSubmenuItemPL.qml - qml/components/platform.kirigami/MenuDrawerSubmenuPL.qml - qml/components/platform.kirigami/PageEmptyPL.qml - qml/components/platform.kirigami/PageListPL.qml - qml/components/platform.kirigami/PageMenuItemPL.qml - qml/components/platform.kirigami/PageMenuPL.qml - qml/components/platform.kirigami/PagePL.qml - qml/components/platform.kirigami/PopupPL.qml - qml/components/platform.kirigami/RemorsePopupPL.qml - qml/components/platform.kirigami/SearchFieldPL.qml - qml/components/platform.kirigami/SectionHeaderPL.qml - qml/components/platform.kirigami/SliderPL.qml - qml/components/platform.kirigami/StackPL.qml - qml/components/platform.kirigami/StylerPL.qml - qml/components/platform.kirigami/TextAreaPL.qml - qml/components/platform.kirigami/TextFieldPL.qml - qml/components/platform.kirigami/TextSwitchPL.qml - qml/components/platform.kirigami/TimePickerDialogPL.qml - qml/components/platform.kirigami/ToolItemPL.qml - qml/components/platform.kirigami/ValueButtonPL.qml - qml/components/DraggableItemDropArea.qml - qml/components/DraggableItem.qml - qml/components/Alarm.qml - qml/components/Axis.qml - qml/components/DeviceButton.qml - qml/components/DownloadDataMenuItem.qml - qml/components/Graph.qml - qml/components/GraphData.qml - qml/components/PercentCircle.qml qml/cover/CoverPage.qml qml/pages/AddCityPage.qml qml/pages/AnalysisPage.qml @@ -121,8 +69,6 @@ qml/pics/weather-storm.png qml/tools/JSTools.js qml/harbour-amazfish.qml - qml/components/TruncationModes.qml - qml/components/DateNavigation.qml icons/172x172/harbour-amazfish-ui.png diff --git a/ui/o2/src/CMakeLists.txt b/ui/o2/src/CMakeLists.txt index cad487b8..d8bdf85d 100644 --- a/ui/o2/src/CMakeLists.txt +++ b/ui/o2/src/CMakeLists.txt @@ -235,6 +235,6 @@ install(FILES ${o2_HDRS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/o2 ) -message(STATUS "Writing pkg-config file...") -configure_file(${CMAKE_SOURCE_DIR}/o2.pc.cmake ${CMAKE_BINARY_DIR}/o2.pc @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/o2.pc DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${o2_LIB_SUFFIX}/pkgconfig/") +#message(STATUS "Writing pkg-config file...") +#configure_file(${CMAKE_SOURCE_DIR}/o2.pc.cmake ${CMAKE_BINARY_DIR}/o2.pc @ONLY) +#install(FILES ${CMAKE_BINARY_DIR}/o2.pc DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${o2_LIB_SUFFIX}/pkgconfig/") diff --git a/ui/platform-kirigami.qrc b/ui/platform-kirigami.qrc new file mode 100644 index 00000000..d4003dd8 --- /dev/null +++ b/ui/platform-kirigami.qrc @@ -0,0 +1,58 @@ + + +./qml/components/platform.kirigami/BusyIndicatorPL.qml +./qml/components/platform.kirigami/BusyIndicatorSmallPL.qml +./qml/components/platform.kirigami/ButtonPL.qml +./qml/components/platform.kirigami/ClipboardPL.qml +./qml/components/platform.kirigami/ComboBoxPL.qml +./qml/components/platform.kirigami/ContextMenuItemPL.qml +./qml/components/platform.kirigami/ContextMenuPL.qml +./qml/components/platform.kirigami/DatePickerDialogPL.qml +./qml/components/platform.kirigami/DialogAutoPL.qml +./qml/components/platform.kirigami/DialogListPL.qml +./qml/components/platform.kirigami/ExpandingSectionGroupPL.qml +./qml/components/platform.kirigami/ExpandingSectionPL.qml +./qml/components/platform.kirigami/FileSelectorPL.qml +./qml/components/platform.kirigami/FormLayoutPL.qml +./qml/components/platform.kirigami/IconButtonPL.qml +./qml/components/platform.kirigami/IconPL.qml +./qml/components/platform.kirigami/LabelPL.qml +./qml/components/platform.kirigami/ListViewPL.qml +./qml/components/platform.kirigami/MenuDrawerItemPL.qml +./qml/components/platform.kirigami/MenuDrawerPL.qml +./qml/components/platform.kirigami/MenuDrawerSubmenuItemPL.qml +./qml/components/platform.kirigami/MenuDrawerSubmenuPL.qml +./qml/components/platform.kirigami/PageEmptyPL.qml +./qml/components/platform.kirigami/PageMenuItemPL.qml +./qml/components/platform.kirigami/PageMenuPL.qml +./qml/components/platform.kirigami/PopupPL.qml +./qml/components/platform.kirigami/RemorsePopupPL.qml +./qml/components/platform.kirigami/SearchFieldPL.qml +./qml/components/platform.kirigami/SectionHeaderPL.qml +./qml/components/platform.kirigami/SliderPL.qml +./qml/components/platform.kirigami/StackPL.qml +./qml/components/platform.kirigami/StylerPL.qml +./qml/components/platform.kirigami/TextAreaPL.qml +./qml/components/platform.kirigami/TextFieldPL.qml +./qml/components/platform.kirigami/TextSwitchPL.qml +./qml/components/platform.kirigami/TimePickerDialogPL.qml +./qml/components/platform.kirigami/ToolItemPL.qml +./qml/components/platform.kirigami/ValueButtonPL.qml +./qml/components/platform.kirigami/ListItemPL.qml +./qml/components/platform.kirigami/PageListPL.qml +./qml/components/platform.kirigami/PagePL.qml +./qml/components/platform.kirigami/ApplicationWindowPL.qml +./qml/components/platform.kirigami/DialogPL.qml +./qml/components/Alarm.qml +./qml/components/Axis.qml +./qml/components/DateNavigation.qml +./qml/components/DeviceButton.qml +./qml/components/DownloadDataMenuItem.qml +./qml/components/DraggableItem.qml +./qml/components/DraggableItemDropArea.qml +./qml/components/Graph.qml +./qml/components/GraphData.qml +./qml/components/PercentCircle.qml +./qml/components/TruncationModes.qml + + diff --git a/ui/platform-qtcontrols.qrc b/ui/platform-qtcontrols.qrc new file mode 100644 index 00000000..136ac2eb --- /dev/null +++ b/ui/platform-qtcontrols.qrc @@ -0,0 +1,57 @@ + + +./qml/components/platform.qtcontrols/ButtonPL.qml +./qml/components/platform.qtcontrols/ClipboardPL.qml +./qml/components/platform.qtcontrols/ComboBoxPL.qml +./qml/components/platform.qtcontrols/ContextMenuItemPL.qml +./qml/components/platform.qtcontrols/ContextMenuPL.qml +./qml/components/platform.qtcontrols/DatePickerDialogPL.qml +./qml/components/platform.qtcontrols/DialogAutoPL.qml +./qml/components/platform.qtcontrols/DialogListPL.qml +./qml/components/platform.qtcontrols/ExpandingSectionGroupPL.qml +./qml/components/platform.qtcontrols/ExpandingSectionPL.qml +./qml/components/platform.qtcontrols/FileSelectorPL.qml +./qml/components/platform.qtcontrols/FormLayoutPL.qml +./qml/components/platform.qtcontrols/HeaderBarImpl.qml +./qml/components/platform.qtcontrols/IconButtonPL.qml +./qml/components/platform.qtcontrols/IconPL.qml +./qml/components/platform.qtcontrols/LabelPL.qml +./qml/components/platform.qtcontrols/ListItemPL.qml +./qml/components/platform.qtcontrols/MenuDrawerItemPL.qml +./qml/components/platform.qtcontrols/MenuDrawerPL.qml +./qml/components/platform.qtcontrols/MenuDrawerSubmenuItemPL.qml +./qml/components/platform.qtcontrols/MenuDrawerSubmenuPL.qml +./qml/components/platform.qtcontrols/PageEmptyPL.qml +./qml/components/platform.qtcontrols/PageListPL.qml +./qml/components/platform.qtcontrols/PageMenuItemPL.qml +./qml/components/platform.qtcontrols/PageMenuPL.qml +./qml/components/platform.qtcontrols/PagePL.qml +./qml/components/platform.qtcontrols/RemorsePopupPL.qml +./qml/components/platform.qtcontrols/SearchFieldPL.qml +./qml/components/platform.qtcontrols/SectionHeaderPL.qml +./qml/components/platform.qtcontrols/SliderPL.qml +./qml/components/platform.qtcontrols/StackPL.qml +./qml/components/platform.qtcontrols/StylerPL.qml +./qml/components/platform.qtcontrols/TextAreaPL.qml +./qml/components/platform.qtcontrols/TextFieldPL.qml +./qml/components/platform.qtcontrols/TextSwitchPL.qml +./qml/components/platform.qtcontrols/ToolItemPL.qml +./qml/components/platform.qtcontrols/ValueButtonPL.qml +./qml/components/platform.qtcontrols/TimePickerDialogPL.qml +./qml/components/platform.qtcontrols/BusyIndicatorSmallPL.qml +./qml/components/platform.qtcontrols/ApplicationWindowPL.qml +./qml/components/platform.qtcontrols/BusyIndicatorPL.qml +./qml/components/platform.qtcontrols/DialogPL.qml +./qml/components/Alarm.qml +./qml/components/Axis.qml +./qml/components/DateNavigation.qml +./qml/components/DeviceButton.qml +./qml/components/DownloadDataMenuItem.qml +./qml/components/DraggableItem.qml +./qml/components/DraggableItemDropArea.qml +./qml/components/Graph.qml +./qml/components/GraphData.qml +./qml/components/PercentCircle.qml +./qml/components/TruncationModes.qml + + diff --git a/ui/platform-silica.qrc b/ui/platform-silica.qrc new file mode 100644 index 00000000..afe895bf --- /dev/null +++ b/ui/platform-silica.qrc @@ -0,0 +1,59 @@ + + +./qml/components/platform.silica/ApplicationWindowPL.qml +./qml/components/platform.silica/BusyIndicatorPL.qml +./qml/components/platform.silica/BusyIndicatorSmallPL.qml +./qml/components/platform.silica/ButtonPL.qml +./qml/components/platform.silica/ClipboardPL.qml +./qml/components/platform.silica/ComboBoxPL.qml +./qml/components/platform.silica/ContextMenuItemPL.qml +./qml/components/platform.silica/ContextMenuPL.qml +./qml/components/platform.silica/Cover.qml +./qml/components/platform.silica/DatePickerDialogPL.qml +./qml/components/platform.silica/DialogAutoPL.qml +./qml/components/platform.silica/DialogListPL.qml +./qml/components/platform.silica/DialogPL.qml +./qml/components/platform.silica/ExpandingSectionGroupPL.qml +./qml/components/platform.silica/ExpandingSectionPL.qml +./qml/components/platform.silica/FileSelectorPL.qml +./qml/components/platform.silica/FormLayoutPL.qml +./qml/components/platform.silica/IconButtonPL.qml +./qml/components/platform.silica/IconPL.qml +./qml/components/platform.silica/LabelPL.qml +./qml/components/platform.silica/ListItemPL.qml +./qml/components/platform.silica/ListViewPL.qml +./qml/components/platform.silica/MenuDrawerItemPL.qml +./qml/components/platform.silica/MenuDrawerPL.qml +./qml/components/platform.silica/MenuDrawerSubmenuItemPL.qml +./qml/components/platform.silica/MenuDrawerSubmenuPL.qml +./qml/components/platform.silica/PageEmptyPL.qml +./qml/components/platform.silica/PageMenuItemPL.qml +./qml/components/platform.silica/PageMenuPL.qml +./qml/components/platform.silica/PagePL.qml +./qml/components/platform.silica/PopupPL.qml +./qml/components/platform.silica/RemorsePopupPL.qml +./qml/components/platform.silica/SearchFieldPL.qml +./qml/components/platform.silica/SectionHeaderPL.qml +./qml/components/platform.silica/SliderPL.qml +./qml/components/platform.silica/StackPL.qml +./qml/components/platform.silica/StylerPL.qml +./qml/components/platform.silica/TextAreaPL.qml +./qml/components/platform.silica/TextFieldPL.qml +./qml/components/platform.silica/TextSwitchPL.qml +./qml/components/platform.silica/TimePickerDialogPL.qml +./qml/components/platform.silica/ToolItemPL.qml +./qml/components/platform.silica/ValueButtonPL.qml +./qml/components/platform.silica/PageListPL.qml +./qml/components/Alarm.qml +./qml/components/Axis.qml +./qml/components/DateNavigation.qml +./qml/components/DeviceButton.qml +./qml/components/DownloadDataMenuItem.qml +./qml/components/DraggableItem.qml +./qml/components/DraggableItemDropArea.qml +./qml/components/Graph.qml +./qml/components/GraphData.qml +./qml/components/PercentCircle.qml +./qml/components/TruncationModes.qml + + diff --git a/ui/platform-uuitk.qrc b/ui/platform-uuitk.qrc new file mode 100644 index 00000000..f00d8f82 --- /dev/null +++ b/ui/platform-uuitk.qrc @@ -0,0 +1,59 @@ + + +./qml/components/platform.uuitk/BusyIndicatorPL.qml +./qml/components/platform.uuitk/BusyIndicatorSmallPL.qml +./qml/components/platform.uuitk/ButtonPL.qml +./qml/components/platform.uuitk/ClipboardPL.qml +./qml/components/platform.uuitk/ComboBoxPL.qml +./qml/components/platform.uuitk/ContextMenuItemPL.qml +./qml/components/platform.uuitk/ContextMenuPL.qml +./qml/components/platform.uuitk/DatePickerDialogPL.qml +./qml/components/platform.uuitk/DialogAutoPL.qml +./qml/components/platform.uuitk/DialogListPL.qml +./qml/components/platform.uuitk/DialogPL.qml +./qml/components/platform.uuitk/ExpandingSectionGroupPL.qml +./qml/components/platform.uuitk/ExpandingSectionPL.qml +./qml/components/platform.uuitk/FileSelectorPL.qml +./qml/components/platform.uuitk/FormLayoutPL.qml +./qml/components/platform.uuitk/HeaderBarImpl.qml +./qml/components/platform.uuitk/IconButtonPL.qml +./qml/components/platform.uuitk/LabelPL.qml +./qml/components/platform.uuitk/ListItemPL.qml +./qml/components/platform.uuitk/ListViewPL.qml +./qml/components/platform.uuitk/MenuDrawerItemPL.qml +./qml/components/platform.uuitk/MenuDrawerPL.qml +./qml/components/platform.uuitk/MenuDrawerSubmenuItemPL.qml +./qml/components/platform.uuitk/MenuDrawerSubmenuPL.qml +./qml/components/platform.uuitk/PageEmptyPL.qml +./qml/components/platform.uuitk/PageListPL.qml +./qml/components/platform.uuitk/PageMenuItemPL.qml +./qml/components/platform.uuitk/PageMenuPL.qml +./qml/components/platform.uuitk/PagePL.qml +./qml/components/platform.uuitk/PopupPL.qml +./qml/components/platform.uuitk/RemorsePopupPL.qml +./qml/components/platform.uuitk/SearchFieldPL.qml +./qml/components/platform.uuitk/SectionHeaderPL.qml +./qml/components/platform.uuitk/SliderPL.qml +./qml/components/platform.uuitk/StackPL.qml +./qml/components/platform.uuitk/TextAreaPL.qml +./qml/components/platform.uuitk/TextFieldPL.qml +./qml/components/platform.uuitk/TextSwitchPL.qml +./qml/components/platform.uuitk/TimePickerDialogPL.qml +./qml/components/platform.uuitk/ToolItemPL.qml +./qml/components/platform.uuitk/ValueButtonPL.qml +./qml/components/platform.uuitk/IconPL.qml +./qml/components/platform.uuitk/StylerPL.qml +./qml/components/platform.uuitk/ApplicationWindowPL.qml +./qml/components/Alarm.qml +./qml/components/Axis.qml +./qml/components/DateNavigation.qml +./qml/components/DeviceButton.qml +./qml/components/DownloadDataMenuItem.qml +./qml/components/DraggableItem.qml +./qml/components/DraggableItemDropArea.qml +./qml/components/Graph.qml +./qml/components/GraphData.qml +./qml/components/PercentCircle.qml +./qml/components/TruncationModes.qml + + diff --git a/ui/update-qrc.sh b/ui/update-qrc.sh new file mode 100755 index 00000000..05a4efaf --- /dev/null +++ b/ui/update-qrc.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +declare -a platforms=("kirigami" "uuitk" "silica" "qtcontrols") + +for platform in ${platforms[@]}; do + + ( + echo "" + echo " " + replace=platform.${platform} + for i in $(find ./qml/components/ -path '*platform.'"$platform"'*' -name '*.qml'); do + x=${i//$replace/platform}; + echo "$i"; + done + + for i in $(find ./qml/components/ -maxdepth 1 -name '*.qml'); do + echo "$i"; + done + echo " " + echo "" + ) > platform-${platform}.qrc + +done From e054ab589a647b2f28e36e4a53baa78d3e2df269 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Wed, 25 Dec 2024 10:33:06 +0100 Subject: [PATCH 02/31] Build with ubuntu touch --- click/CMakeLists.txt | 36 ++++++++++++++++++++++++++++++++++++ clickable.yaml | 11 +++++------ daemon/CMakeLists.txt | 28 +++++++++++++++------------- ui/CMakeLists.txt | 8 ++++---- 4 files changed, 60 insertions(+), 23 deletions(-) create mode 100644 click/CMakeLists.txt diff --git a/click/CMakeLists.txt b/click/CMakeLists.txt new file mode 100644 index 00000000..a1519215 --- /dev/null +++ b/click/CMakeLists.txt @@ -0,0 +1,36 @@ +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 "harbour-amazfish") +set(FULL_PROJECT_NAME "uk.co.piggz.amazfish") +set(DATA_DIR /) +set(DESKTOP_FILE_NAME ${PROJECT_NAME}-ui.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 ${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR}) +install(FILES ./run.sh PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/clickable.yaml b/clickable.yaml index b89a4014..f1c92472 100644 --- a/clickable.yaml +++ b/clickable.yaml @@ -5,15 +5,14 @@ prebuild: git submodule update --init kill: harbour-amazfish ignore_review_errors: true -builder: qmake +builder: cmake 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} +- -DFLAVOR=uuitk +- -DCMAKE_CXX_FLAGS=-I${QTMPRIS_LIB_INSTALL_DIR}/usr/include/${ARCH_TRIPLET}/qt5/\ -I${QTMPRIS_LIB_INSTALL_DIR}/usr/include/${ARCH_TRIPLET}/qt5/MprisQt +- -DCMAKE_EXE_LINKER_FLAGS=-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 diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index c1ac8de9..61622840 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -155,13 +155,20 @@ set(HEADERS ./src/typeconversion.h ) +add_executable(harbour-amazfishd ${SOURCES} ${HEADERS}) + +find_package(PkgConfig REQUIRED) +find_package(Qt5 COMPONENTS Gui Widgets Positioning Network REQUIRED) +find_package(KF5Archive REQUIRED) +find_package(ZLIB REQUIRED) +find_package(ICU REQUIRED COMPONENTS uc i18n data) +find_package(KDb REQUIRED) -set(WATCHFISH_FEATURES "notificationmonitor;walltime;music;calendar;voicecall;volume") if(FLAVOR STREQUAL "silica") + set(WATCHFISH_FEATURES "notificationmonitor;music;calendar;voicecall") # message(SailfishOS daemon build) -# DEFINES += MER_EDITION_SAILFISH # LIBS += -lkeepalive -lpulse-simple # CONFIG += sailfishapp # CONFIG += link_pkgconfig @@ -172,14 +179,15 @@ if(FLAVOR STREQUAL "silica") # calendar elseif(FLAVOR STREQUAL "uuitk") + set(WATCHFISH_FEATURES "notificationmonitor;music;calendar;voicecall") -# DEFINES += UUITK_EDITION # LIBS += -lpulse-simple # PKGCONFIG += libpulse -# WATCHFISH_FEATURES += music \ -# voicecall \ -# notificationmonitor \ -# calendar + + pkg_check_modules(PULSE REQUIRED libpulse) + target_include_directories(harbour-amazfishd PUBLIC ${PULSE_INCLUDE_DIRS}) + target_link_libraries(harbour-amazfishd PUBLIC ${PULSE_LIBRARIES} pulse-simple) + else() set(WATCHFISH_FEATURES "notificationmonitor;music;calendar") @@ -187,13 +195,7 @@ endif() add_subdirectory(libwatchfish) -find_package(Qt5 COMPONENTS Gui Widgets Positioning Network REQUIRED) -find_package(KF5Archive REQUIRED) -find_package(ZLIB REQUIRED) -find_package(ICU REQUIRED COMPONENTS uc i18n data) -find_package(KDb REQUIRED) -add_executable(harbour-amazfishd ${SOURCES} ${HEADERS}) install(TARGETS harbour-amazfishd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index df94c0eb..d968980a 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -78,11 +78,11 @@ target_link_libraries(harbour-amazfish-ui #install(FILES "harbour-amazfish.desktop" # DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") -install(FILES "icons/256x256/harbour-amazfish.png" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps") +#install(FILES "icons/256x256/harbour-amazfish.png" +# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps") -install(FILES "icons/512x512/harbour-amazfish.png" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps") +#install(FILES "icons/512x512/harbour-amazfish.png" +# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps") # install(FILES "harbour-amazfish.appdata.xml" # DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") From debfaf5e610d6ba5d59157e89ec40acf12ae962e Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Wed, 25 Dec 2024 10:54:25 +0100 Subject: [PATCH 03/31] Make sure ubuntu touch is using qmls from qrc --- click/harbour-amazfish-ui.desktop | 2 +- ui/src/harbour-amazfish-ui.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/click/harbour-amazfish-ui.desktop b/click/harbour-amazfish-ui.desktop index 152f9d06..601c032b 100644 --- a/click/harbour-amazfish-ui.desktop +++ b/click/harbour-amazfish-ui.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Icon=harbour-amazfish-ui.png -Exec=run.sh +Exec=./bin/run.sh Name=Amazfish X-Ubuntu-Touch=true X-Ubuntu-Splash-Color=#F5F5F5 diff --git a/ui/src/harbour-amazfish-ui.cpp b/ui/src/harbour-amazfish-ui.cpp index 6a0ffc32..84d711b8 100644 --- a/ui/src/harbour-amazfish-ui.cpp +++ b/ui/src/harbour-amazfish-ui.cpp @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) view->setSource(SailfishApp::pathTo("qml/harbour-amazfish.qml")); view->show(); #elif UUITK_EDITION - view->load("./share/harbour-amazfish-ui/qml/harbour-amazfish.qml"); + view->load(QUrl("qrc:/qml/harbour-amazfish.qml")); #else view->load(QUrl("qrc:/qml/harbour-amazfish.qml")); From b346ef25d607b7b177df23753627715631427f01 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Wed, 25 Dec 2024 13:28:58 +0100 Subject: [PATCH 04/31] Try to fix spec file --- CMakeLists.txt | 2 ++ rpm/harbour-amazfish.spec | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6d5a470..a0d5f1a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,8 @@ if(NOT DEFINED FLAVOR) message(FATAL_ERROR "Please specify the platform using -DFLAVOR=platform as a CMake option. Supported platforms: kirigami, silica, qtcontrols, uuitk.") elseif(FLAVOR STREQUAL "silica") add_definitions(-DMER_EDITION_SAILFISH) + include(FindPkgConfig) + pkg_search_module(SAILFISH sailfishapp REQUIRED) elseif(FLAVOR STREQUAL "kirigami") add_definitions(-Dflavor_kirigami) elseif(FLAVOR STREQUAL "qtcontrols") diff --git a/rpm/harbour-amazfish.spec b/rpm/harbour-amazfish.spec index 615fcfbb..999cca9c 100644 --- a/rpm/harbour-amazfish.spec +++ b/rpm/harbour-amazfish.spec @@ -56,6 +56,7 @@ BuildRequires: libkeepalive-devel BuildRequires: libkf5archive-devel BuildRequires: pulseaudio-devel BuildRequires: libicu-devel +BuildRequires: cmake %description Watch companion application for SalfishOS @@ -88,12 +89,18 @@ Links: %build %if 0%{?sailfishos} -%qmake5 VERSION='%{version}-%{release}' FLAVOR=silica + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH='/usr' \ + -DFLAVOR=silica \ + . %else -%qmake5 VERSION='%{version}-%{release}' FLAVOR=kirigami + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH='/usr' \ + -DFLAVOR=kirigami \ + . %endif -%qtc_make %{?_smp_mflags} +cmake --build "." %{?_smp_mflags} --verbose # >> build post # << build post @@ -102,7 +109,9 @@ Links: rm -rf %{buildroot} # >> install pre # << install pre -%qmake5_install + +DESTDIR=%{buildroot} cmake --install build + # >> install post # << install post From 1aac7c59bb373b19c929de754b23d749710c2727 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Wed, 25 Dec 2024 14:57:58 +0100 Subject: [PATCH 05/31] fix lib+mlite --- lib/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 519aba03..e830e5c3 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -7,6 +7,15 @@ add_library(libamazfish STATIC) find_package(Qt5 REQUIRED COMPONENTS Core DBus Xml) +if(FLAVOR STREQUAL "silica") + + pkg_check_modules(MLITE5 REQUIRED mlite5) + include_directories(${MLITE5_INCLUDE_DIRS}) + link_libraries(${MLITE5_LIBRARIES}) + +endif() + + target_include_directories(libamazfish PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) target_link_libraries(libamazfish PUBLIC Qt5::Core Qt5::DBus Qt5::Xml) From 11537b2fe1dcf076d17fb805a93eb44f6affb7aa Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Wed, 25 Dec 2024 15:33:54 +0100 Subject: [PATCH 06/31] update qble --- qble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qble b/qble index 8994af4a..e0fc9ef3 160000 --- a/qble +++ b/qble @@ -1 +1 @@ -Subproject commit 8994af4aa82617b98cd4b63518441a2596652b2b +Subproject commit e0fc9ef3e87a28e16f2d855b0fa3ed674e1fef45 From 408052d92820d71715fee560997251b607d6ae4b Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Thu, 26 Dec 2024 08:18:59 +0100 Subject: [PATCH 07/31] update to current libwatchfish --- daemon/libwatchfish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/libwatchfish b/daemon/libwatchfish index d5e4bf96..d41b3740 160000 --- a/daemon/libwatchfish +++ b/daemon/libwatchfish @@ -1 +1 @@ -Subproject commit d5e4bf96f880757b617bb605fd6ddb4e2cf88a22 +Subproject commit d41b37405f9f0b1428776c089ac0afdefb180967 From 810b8f1c1a969e875c70a5cb73cb2182d20e1fab Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 28 Dec 2024 07:53:38 +0100 Subject: [PATCH 08/31] Install daemon translations --- daemon/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 61622840..b61b7c1b 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -235,3 +235,9 @@ endif() QT5_ADD_TRANSLATION(QM_FILES ${TS_FILES}) add_custom_target(daemon_translations DEPENDS ${QM_FILES}) add_dependencies(harbour-amazfishd daemon_translations) + +QT5_CREATE_TRANSLATION(QT_FILES "${CMAKE_SOURCE_DIR}" + OPTIONS "-no-obsolete") + +install(FILES ${QM_FILES} + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfish/translations") From 0d44379a52fbd17748e80dd12be400b959449a18 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 28 Dec 2024 09:08:33 +0100 Subject: [PATCH 09/31] Make sure to resolve relative path for translations --- daemon/CMakeLists.txt | 2 +- daemon/src/harbour-amazfish-daemon.cpp | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index b61b7c1b..748c1b77 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -227,7 +227,7 @@ file(GLOB TS_FILES translations/*.ts) # TODO check if translation path is correct on all platforms if(FLAVOR STREQUAL "uuitk") - add_definitions(-DTRANSLATION_FOLDER="./share/harbour-amazfish/translations") + add_definitions(-DTRANSLATION_FOLDER="../share/harbour-amazfish/translations") else() add_definitions(-DTRANSLATION_FOLDER=".") endif() diff --git a/daemon/src/harbour-amazfish-daemon.cpp b/daemon/src/harbour-amazfish-daemon.cpp index 0db5b4c9..2a04d9c4 100644 --- a/daemon/src/harbour-amazfish-daemon.cpp +++ b/daemon/src/harbour-amazfish-daemon.cpp @@ -42,15 +42,20 @@ int main(int argc, char **argv) { QString tr_path(TRANSLATION_FOLDER); - if ( !tr_path.isEmpty() ) { - QString locale = QLocale::system().name(); - QTranslator *translator = new QTranslator(); + if (QDir::isRelativePath(tr_path)) { + tr_path = QDir(QFileInfo(QCoreApplication::applicationFilePath()).absolutePath() + "/" + tr_path ).absolutePath(); + } - if ( !translator->load(QLocale(), "harbour-amazfishd", "-", tr_path) ) { - qWarning() << "Failed to load translation for " << locale << " " << tr_path; + QString locale = QLocale::system().name(); + QTranslator *translator = new QTranslator(); + if ( translator->load(QLocale(), "harbour-amazfishd", "-", tr_path) ) { + if (app.installTranslator(translator)) { + qDebug() << "Install translation success for " << locale << " " << tr_path; + } else { + qWarning() << "Install translation failed for " << locale << " " << tr_path; } - - app.installTranslator(translator); + } else { + qWarning() << "Failed to load translation for " << locale << " " << tr_path; } } From c23a3068e3c91ac8f5e934ede75f28b1169ce314 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 28 Dec 2024 12:34:16 +0100 Subject: [PATCH 10/31] Update spec --- rpm/harbour-amazfish.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm/harbour-amazfish.spec b/rpm/harbour-amazfish.spec index 999cca9c..4fa2317f 100644 --- a/rpm/harbour-amazfish.spec +++ b/rpm/harbour-amazfish.spec @@ -57,6 +57,7 @@ BuildRequires: libkf5archive-devel BuildRequires: pulseaudio-devel BuildRequires: libicu-devel BuildRequires: cmake +BuildRequires: ninja %description Watch companion application for SalfishOS @@ -112,7 +113,6 @@ rm -rf %{buildroot} DESTDIR=%{buildroot} cmake --install build - # >> install post # << install post From a1b2b02b18e97c13d4934999a56de48472eae6ac Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 28 Dec 2024 13:13:16 +0100 Subject: [PATCH 11/31] Update build for SFOS --- daemon/CMakeLists.txt | 1 - lib/CMakeLists.txt | 6 ++---- ui/CMakeLists.txt | 9 +++++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 748c1b77..8e648e20 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -1,4 +1,3 @@ - set(SOURCES ./src/activitycoordinate.cpp ./src/activitykind.cpp diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index e830e5c3..f2d6f66c 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -10,14 +10,12 @@ find_package(Qt5 REQUIRED COMPONENTS Core DBus Xml) if(FLAVOR STREQUAL "silica") pkg_check_modules(MLITE5 REQUIRED mlite5) - include_directories(${MLITE5_INCLUDE_DIRS}) - link_libraries(${MLITE5_LIBRARIES}) endif() -target_include_directories(libamazfish PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) -target_link_libraries(libamazfish PUBLIC Qt5::Core Qt5::DBus Qt5::Xml) +target_include_directories(libamazfish PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${MLITE5_INCLUDE_DIRS}) +target_link_libraries(libamazfish PUBLIC Qt5::Core Qt5::DBus Qt5::Xml ${MLITE5_LIBRARIES}) set(SOURCES ./src/amazfish.cpp diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index d968980a..cedd3f9f 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -73,8 +73,17 @@ target_link_libraries(harbour-amazfish-ui Qt5::Core Qt5::Widgets Qt5::Quick Qt5::Positioning KDb o2 + ${SAILFISH_LDFLAGS} ) +if(FLAVOR STREQUAL "silica") + target_include_directories(harbour-amazfish-ui PRIVATE + $) +endif() + + #install(FILES "harbour-amazfish.desktop" # DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") From 25887c682f127626b68f57d30e264cbf43f14cb7 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sun, 29 Dec 2024 11:34:52 +0100 Subject: [PATCH 12/31] Install icons --- click/harbour-amazfish-ui.desktop | 2 +- ui/CMakeLists.txt | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/click/harbour-amazfish-ui.desktop b/click/harbour-amazfish-ui.desktop index 601c032b..774c0e87 100644 --- a/click/harbour-amazfish-ui.desktop +++ b/click/harbour-amazfish-ui.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Type=Application -Icon=harbour-amazfish-ui.png +Icon=share/icons/hicolor/172x172/apps/harbour-amazfish-ui.png Exec=./bin/run.sh Name=Amazfish X-Ubuntu-Touch=true diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index cedd3f9f..820789a1 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -83,15 +83,20 @@ if(FLAVOR STREQUAL "silica") >) endif() - #install(FILES "harbour-amazfish.desktop" # DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") -#install(FILES "icons/256x256/harbour-amazfish.png" -# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps") +install(FILES "icons/108x108/harbour-amazfish-ui.png" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/108x108/apps") + +install(FILES "icons/172x172/harbour-amazfish-ui.png" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/172x172/apps") + +install(FILES "icons/128x128/harbour-amazfish-ui.png" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps") -#install(FILES "icons/512x512/harbour-amazfish.png" -# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps") +install(FILES "icons/86x86/harbour-amazfish-ui.png" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/86x86/apps") # install(FILES "harbour-amazfish.appdata.xml" # DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") From de3ee394f9d4bd4f85ac6cb9607460e381797ceb Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Mon, 30 Dec 2024 17:57:52 +0100 Subject: [PATCH 13/31] install icon --- ui/CMakeLists.txt | 3 +++ .../icons/scalable/harbour-amazfish-ui.svg | 0 2 files changed, 3 insertions(+) rename harbour-amazfish-ui.svg => ui/icons/scalable/harbour-amazfish-ui.svg (100%) diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index 820789a1..f7903fe2 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -98,5 +98,8 @@ install(FILES "icons/128x128/harbour-amazfish-ui.png" install(FILES "icons/86x86/harbour-amazfish-ui.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/86x86/apps") +install(FILES "icons/scalable/harbour-amazfish-ui.svg" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps") + # install(FILES "harbour-amazfish.appdata.xml" # DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") diff --git a/harbour-amazfish-ui.svg b/ui/icons/scalable/harbour-amazfish-ui.svg similarity index 100% rename from harbour-amazfish-ui.svg rename to ui/icons/scalable/harbour-amazfish-ui.svg From d62a5ac27323c1084c0d6a32f415508e2bb52838 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Tue, 31 Dec 2024 10:58:00 +0100 Subject: [PATCH 14/31] Enable sailfish os modules --- daemon/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 8e648e20..082eb40c 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -163,7 +163,6 @@ find_package(ZLIB REQUIRED) find_package(ICU REQUIRED COMPONENTS uc i18n data) find_package(KDb REQUIRED) - if(FLAVOR STREQUAL "silica") set(WATCHFISH_FEATURES "notificationmonitor;music;calendar;voicecall") @@ -177,12 +176,20 @@ if(FLAVOR STREQUAL "silica") # notificationmonitor \ # calendar + + pkg_check_modules(PULSE REQUIRED libpulse) + target_include_directories(harbour-amazfishd PUBLIC ${PULSE_INCLUDE_DIRS}) + target_link_libraries(harbour-amazfishd PUBLIC ${PULSE_LIBRARIES} pulse-simple) + + pkg_check_modules(MLITE5 REQUIRED mlite5) + target_include_directories(harbour-amazfishd PUBLIC ${MLITE5_INCLUDE_DIRS}) + target_link_libraries(harbour-amazfishd PUBLIC ${MLITE5_LIBRARIES}) + + target_link_libraries(harbour-amazfishd PUBLIC keepalive) + elseif(FLAVOR STREQUAL "uuitk") set(WATCHFISH_FEATURES "notificationmonitor;music;calendar;voicecall") -# LIBS += -lpulse-simple -# PKGCONFIG += libpulse - pkg_check_modules(PULSE REQUIRED libpulse) target_include_directories(harbour-amazfishd PUBLIC ${PULSE_INCLUDE_DIRS}) target_link_libraries(harbour-amazfishd PUBLIC ${PULSE_LIBRARIES} pulse-simple) From 4e944c6ef91787b58b5f7b8dccc6a0f107fbb49b Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Tue, 31 Dec 2024 13:00:03 +0100 Subject: [PATCH 15/31] Add ninja, update cmake --- .github/workflows/sailfishos.yml | 2 +- CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sailfishos.yml b/.github/workflows/sailfishos.yml index e3001ad3..522a3dea 100644 --- a/.github/workflows/sailfishos.yml +++ b/.github/workflows/sailfishos.yml @@ -28,7 +28,7 @@ jobs: cp -r /share/* . ; sb2 -t SailfishOS-$OS_VERSION-${{ matrix.arch }} -R zypper --non-interactive ar --no-gpgcheck https://repo.sailfishos.org/obs/sailfishos:/chum/4.6_${{ matrix.arch }}/ sailfishos_chum ; 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; + 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 ninja; mb2 -t SailfishOS-$OS_VERSION-${{ matrix.arch }} build ; sudo cp -r RPMS/*.rpm /share/output" diff --git a/CMakeLists.txt b/CMakeLists.txt index a0d5f1a7..db9a6281 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,8 @@ if(NOT DEFINED FLAVOR) message(FATAL_ERROR "Please specify the platform using -DFLAVOR=platform as a CMake option. Supported platforms: kirigami, silica, qtcontrols, uuitk.") elseif(FLAVOR STREQUAL "silica") add_definitions(-DMER_EDITION_SAILFISH) + add_definitions(-DKF5CALENDARCORE) ### FIME I don't know why this doesn't work with libwatchfish + include(FindPkgConfig) pkg_search_module(SAILFISH sailfishapp REQUIRED) elseif(FLAVOR STREQUAL "kirigami") From d3744f07fca7df0b3b8a803f1627c3fb2e37d23d Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Tue, 31 Dec 2024 13:05:36 +0100 Subject: [PATCH 16/31] %install --- rpm/harbour-amazfish.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm/harbour-amazfish.spec b/rpm/harbour-amazfish.spec index 4fa2317f..21df744b 100644 --- a/rpm/harbour-amazfish.spec +++ b/rpm/harbour-amazfish.spec @@ -111,7 +111,7 @@ rm -rf %{buildroot} # >> install pre # << install pre -DESTDIR=%{buildroot} cmake --install build +DESTDIR=%{buildroot} cmake --install . # >> install post # << install post From 09a3ee048d1160dbc75504c607198d0a030220c3 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Tue, 31 Dec 2024 19:06:49 +0100 Subject: [PATCH 17/31] build of sailfish os rpm --- daemon/CMakeLists.txt | 16 ++++++++++++++++ rpm/harbour-amazfish.spec | 10 +++++++--- ui/CMakeLists.txt | 8 ++++---- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 082eb40c..0ef06adb 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -247,3 +247,19 @@ QT5_CREATE_TRANSLATION(QT_FILES "${CMAKE_SOURCE_DIR}" install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfish/translations") + +install(FILES "chirp.raw" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfish/") + +install(FILES "harbour-amazfishd.privileges" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/mapplauncherd/privileges.d/") + +if(FLAVOR STREQUAL "silica") + configure_file(harbour-amazfish-sailfish.service.in + ${CMAKE_CURRENT_BINARY_DIR}/harbour-amazfish.service) +else() + configure_file(harbour-amazfish.service.in + ${CMAKE_CURRENT_BINARY_DIR}/harbour-amazfish.service) +endif() +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/harbour-amazfish.service + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user) diff --git a/rpm/harbour-amazfish.spec b/rpm/harbour-amazfish.spec index 21df744b..b9e40dd3 100644 --- a/rpm/harbour-amazfish.spec +++ b/rpm/harbour-amazfish.spec @@ -120,17 +120,21 @@ desktop-file-install --delete-original \ --dir %{buildroot}%{_datadir}/applications \ %{buildroot}%{_datadir}/applications/*.desktop +rm -rf %{buildroot}/usr/include/o2 +rm -f %{buildroot}/usr/lib/libo2.a +rm -f %{buildroot}/usr/share/metainfo/harbour-amazfish-ui.appdata.xml + %files %defattr(-,root,root,-) %{_bindir}/%{name}-ui +%{_bindir}/%{name}d %attr(2755,root,privileged) %{_bindir}/%{name}d -%{_datadir}/%{name}-ui -%{_datadir}/%{name}d +%{_datadir}/%{name} %{_datadir}/applications/%{name}-ui.desktop %{_datadir}/icons/hicolor/*/apps/%{name}-ui.png %{_datadir}/icons/hicolor/scalable/apps/%{name}-ui.svg %{_userunitdir}/harbour-amazfish.service %{_datadir}/mapplauncherd/privileges.d/harbour-amazfishd.privileges -%{_datadir}/harbour-amazfishd/chirp.raw +%{_datadir}/harbour-amazfish/chirp.raw # >> files # << files diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index f7903fe2..835da47d 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -83,8 +83,8 @@ if(FLAVOR STREQUAL "silica") >) endif() -#install(FILES "harbour-amazfish.desktop" -# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") +install(FILES "harbour-amazfish-ui.desktop" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") install(FILES "icons/108x108/harbour-amazfish-ui.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/108x108/apps") @@ -101,5 +101,5 @@ install(FILES "icons/86x86/harbour-amazfish-ui.png" install(FILES "icons/scalable/harbour-amazfish-ui.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps") -# install(FILES "harbour-amazfish.appdata.xml" -# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") +install(FILES "harbour-amazfish-ui.appdata.xml" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") From b814bfbaa712b3fb5a5ebe8d55f3b47854f5f8dd Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Wed, 1 Jan 2025 09:49:09 +0100 Subject: [PATCH 18/31] Use qmls from qrc --- ui/src/harbour-amazfish-ui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/harbour-amazfish-ui.cpp b/ui/src/harbour-amazfish-ui.cpp index ef12e6ec..fc04c9ac 100644 --- a/ui/src/harbour-amazfish-ui.cpp +++ b/ui/src/harbour-amazfish-ui.cpp @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) #endif #ifdef MER_EDITION_SAILFISH - view->setSource(SailfishApp::pathTo("qml/harbour-amazfish.qml")); + view->setSource(QUrl("qrc:/qml/harbour-amazfish.qml")); view->show(); #elif UUITK_EDITION view->rootContext()->setContextProperty("APPLICATION_FILE_DIR", QFileInfo(QCoreApplication::applicationFilePath()).absolutePath()); From aae28a2a483d54d43e7922079f534b3afa167e05 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Wed, 1 Jan 2025 09:56:30 +0100 Subject: [PATCH 19/31] ninja is used to compile --- documentation/build-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/build-instructions.md b/documentation/build-instructions.md index 6946096e..4be08fb8 100644 --- a/documentation/build-instructions.md +++ b/documentation/build-instructions.md @@ -23,7 +23,7 @@ In the .pro file, you can set `FLAVOR = silica` (or `FLAVOR = $$FLAVOR` and in t To install missing packages, as pointed out by build errors, use: ``` -sb2 -R zypper in mpris-qt5-devel libkf5archive-devel kcoreaddons-devel kdb-devel libKDb3-3 mkcal-qt5-devel libicu-devel pulseaudio-devel +sb2 -R zypper in mpris-qt5-devel libkf5archive-devel kcoreaddons-devel kdb-devel libKDb3-3 mkcal-qt5-devel libicu-devel pulseaudio-devel ninja ``` etc as pointed out by build errors. From db81b322cfacdf5a5d21e0845627724ff0430452 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Wed, 1 Jan 2025 11:22:43 +0100 Subject: [PATCH 20/31] Disable systemd. feature summary --- CMakeLists.txt | 2 ++ ui/CMakeLists.txt | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db9a6281..9f63ccc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,3 +43,5 @@ add_subdirectory(qble) add_subdirectory(lib) add_subdirectory(daemon) add_subdirectory(ui) + +feature_summary(WHAT ALL) diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index 835da47d..3fc174f5 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -1,7 +1,12 @@ +option(DISABLE_SYSTEMD "Disable systemd support" OFF) + +if (DISABLE_SYSTEMD) + add_definitions(-DDISABLE_SYSTEMD) +endif() + set(o2_WITH_KEYCHAIN OFF CACHE BOOL "keychain store" FORCE) add_subdirectory(o2) - file(GLOB TS_FILES translations/*.ts) if(FLAVOR STREQUAL "uuitk") From 646e39cac55982f0c1add28476d2527d30c5f746 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 10:50:08 +0100 Subject: [PATCH 21/31] Test icons --- ui/amazfish.qrc | 1 + ui/qml/pages/FirstPage.qml | 4 +++ ui/qml/pages/TestIconsPage.qml | 52 ++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 ui/qml/pages/TestIconsPage.qml diff --git a/ui/amazfish.qrc b/ui/amazfish.qrc index 6ada08c3..ddb4c3e5 100644 --- a/ui/amazfish.qrc +++ b/ui/amazfish.qrc @@ -24,6 +24,7 @@ qml/pages/StravaSettingsPage.qml qml/pages/StravaUploadPage.qml qml/pages/StepsPage.qml + qml/pages/TestIconsPage.qml qml/pages/UnpairDeviceDialog.qml qml/pics/devices/amazfit-bip.png qml/pics/devices/amazfit-bips.png diff --git a/ui/qml/pages/FirstPage.qml b/ui/qml/pages/FirstPage.qml index dda257db..d9bcbd2e 100644 --- a/ui/qml/pages/FirstPage.qml +++ b/ui/qml/pages/FirstPage.qml @@ -14,6 +14,10 @@ PagePL { } pageMenu: PageMenuPL { +// PageMenuItemPL { +// text: qsTr("Test Icons") +// onClicked: app.pages.push(Qt.resolvedUrl("TestIconsPage.qml")) +// } PageMenuItemPL { text: qsTr("Pair with watch") onClicked: { diff --git a/ui/qml/pages/TestIconsPage.qml b/ui/qml/pages/TestIconsPage.qml new file mode 100644 index 00000000..ff340367 --- /dev/null +++ b/ui/qml/pages/TestIconsPage.qml @@ -0,0 +1,52 @@ +import QtQuick 2.0 +import uk.co.piggz.amazfish 1.0 +import "../components" +import "../components/platform" + +PageListPL { + id: page + title: "Test Icons" + + model: iconsModel + + delegate: ListItemPL { + + contentHeight: styler.themeItemSizeLarge + IconPL { + id: settingsIcon + anchors.verticalCenter: parent.verticalCenter + iconName: icon + height: styler.themeItemSizeLarge + width: height + } + LabelPL { + id: settingsName + anchors.verticalCenter: settingsIcon.verticalCenter + anchors.left: settingsIcon.right + anchors.leftMargin: 20 + text: name + } + } + + + ListModel { + id: iconsModel + + property bool completed: false + Component.onCompleted: { + + let properties = Object.keys(styler); // Get all property names + let regex = /^icon/; // Regex to match property names starting with "icon" + let regexEnd = /Changed$/; // Regex to match property names starting with "icon" + + for (let i = 0; i < properties.length; ++i) { + let propertyName = properties[i]; + if (regex.test(propertyName) && !regexEnd.test(propertyName)) { + console.log(propertyName + ": " + styler[propertyName]); + append({"icon": styler[propertyName], "name": propertyName}); + } + } + completed = true; + } + } +} From d7cd62168f14024c5d08007895c10e163079a64c Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 11:01:18 +0100 Subject: [PATCH 22/31] Remove unused icons --- ui/qml/components/platform.kirigami/StylerPL.qml | 11 ----------- ui/qml/components/platform.qtcontrols/StylerPL.qml | 11 ----------- ui/qml/components/platform.silica/StylerPL.qml | 11 ----------- ui/qml/components/platform.uuitk/StylerPL.qml | 11 ----------- 4 files changed, 44 deletions(-) diff --git a/ui/qml/components/platform.kirigami/StylerPL.qml b/ui/qml/components/platform.kirigami/StylerPL.qml index ce5b4f20..8ba401ab 100644 --- a/ui/qml/components/platform.kirigami/StylerPL.qml +++ b/ui/qml/components/platform.kirigami/StylerPL.qml @@ -64,25 +64,14 @@ QtObject { property string iconEdit: "document-edit-symbolic" property string iconEditClear: "edit-clear-symbolic" property string iconFavorite: "bookmark-new-symbolic" - property string iconManeuvers: "maneuvers-symbolic" - property string iconMaps: "map-layers-symbolic" property string iconMenu: "open-menu-symbolic" - property string iconNavigate: "route-symbolic" - property string iconNavigateTo: "route-to-symbolic" - property string iconNavigateFrom: "route-from-symbolic" - property string iconNearby: "nearby-search-symbolic" property string iconPause: "media-playback-pause-symbolic" property string iconPhone: "call-start-symbolic" property string iconPreferences: "preferences-system-symbolic" - property string iconProfileMixed: "profile-mixed-symbolic" - property string iconProfileOffline: "profile-offline-symbolic" - property string iconProfileOnline: "profile-online-symbolic" property string iconRefresh: "view-refresh-symbolic" property string iconSave: "document-save-symbolic" property string iconSearch: "edit-find-symbolic" property string iconShare: "emblem-shared-symbolic" - property string iconShortlisted: "shortlist-add-symbolic" - property string iconShortlistedSelected: "shortlist-selected-symbolic" property string iconStart: "media-playback-start-symbolic" property string iconStop: "media-playback-stop-symbolic" property string iconWebLink: "web-browser-symbolic" diff --git a/ui/qml/components/platform.qtcontrols/StylerPL.qml b/ui/qml/components/platform.qtcontrols/StylerPL.qml index e85990ce..a149d7f2 100644 --- a/ui/qml/components/platform.qtcontrols/StylerPL.qml +++ b/ui/qml/components/platform.qtcontrols/StylerPL.qml @@ -66,25 +66,14 @@ QtObject { property string iconFavorite: "bookmark-new-symbolic" property string iconFavoriteSelected: "user-bookmarks-symbolic" property string iconForward: "go-next-symbolic" - property string iconManeuvers: "maneuvers-symbolic" - property string iconMaps: "map-layers-symbolic" property string iconMenu: "open-menu-symbolic" - property string iconNavigate: "route-symbolic" - property string iconNavigateTo: "route-to-symbolic" - property string iconNavigateFrom: "route-from-symbolic" - property string iconNearby: "nearby-search-symbolic" property string iconPause: "media-playback-pause-symbolic" property string iconPhone: "call-start-symbolic" property string iconPreferences: "preferences-system-symbolic" - property string iconProfileMixed: "profile-mixed-symbolic" - property string iconProfileOffline: "profile-offline-symbolic" - property string iconProfileOnline: "profile-online-symbolic" property string iconRefresh: "view-refresh-symbolic" property string iconSave: "document-save-symbolic" property string iconSearch: "edit-find-symbolic" property string iconShare: "emblem-shared-symbolic" - property string iconShortlisted: "shortlist-add-symbolic" - property string iconShortlistedSelected: "shortlist-selected-symbolic" property string iconStart: "media-playback-start-symbolic" property string iconStop: "media-playback-stop-symbolic" property string iconWebLink: "web-browser-symbolic" diff --git a/ui/qml/components/platform.silica/StylerPL.qml b/ui/qml/components/platform.silica/StylerPL.qml index 03a66c19..8830e689 100644 --- a/ui/qml/components/platform.silica/StylerPL.qml +++ b/ui/qml/components/platform.silica/StylerPL.qml @@ -66,25 +66,14 @@ QtObject { property string iconEdit: "image://theme/icon-m-edit" property string iconEditClear: "image://theme/icon-m-clear" property string iconFavorite: "image://theme/icon-m-favorite" - property string iconManeuvers: "image://theme/icon-m-shuffle" - property string iconMaps: "image://theme/icon-m-levels" property string iconMenu: "image://theme/icon-m-menu" - property string iconNavigate: Theme.colorScheme ? Qt.resolvedUrl("../icons/sailfishos/route-to-black.svg") : Qt.resolvedUrl("../icons/sailfishos/route-to-white.svg") - property string iconNavigateTo: iconNavigate - property string iconNavigateFrom: Theme.colorScheme ? Qt.resolvedUrl("../icons/sailfishos/route-from-black.svg") : Qt.resolvedUrl("../icons/sailfishos/route-from-white.svg") - property string iconNearby: Theme.colorScheme ? Qt.resolvedUrl("../icons/sailfishos/nearby-search-black.svg") : Qt.resolvedUrl("../icons/sailfishos/nearby-search-white.svg") property string iconPause: "image://theme/icon-m-pause" property string iconPhone: "image://theme/icon-m-phone" property string iconPreferences: "image://theme/icon-m-developer-mode" - property string iconProfileMixed: Theme.colorScheme ? Qt.resolvedUrl("../icons/sailfishos/profile-mixed-black.svg") : Qt.resolvedUrl("../icons/sailfishos/profile-mixed-white.svg") - property string iconProfileOffline: Theme.colorScheme ? Qt.resolvedUrl("../icons/sailfishos/profile-offline-black.svg") : Qt.resolvedUrl("../icons/sailfishos/profile-offline-white.svg") - property string iconProfileOnline: Theme.colorScheme ? Qt.resolvedUrl("../icons/sailfishos/profile-online-black.svg") : Qt.resolvedUrl("../icons/sailfishos/profile-online-white.svg") property string iconRefresh: "image://theme/icon-m-refresh" property string iconSave: "image://theme/icon-m-acknowledge" property string iconSearch: "image://theme/icon-m-search" property string iconShare: "image://theme/icon-m-share" - property string iconShortlisted: "image://theme/icon-m-annotation" - property string iconShortlistedSelected: "image://theme/icon-m-annotation-selected" property string iconStart: "image://theme/icon-m-play" property string iconStop: "image://theme/icon-m-clear" property string iconWebLink: "image://theme/icon-m-link" diff --git a/ui/qml/components/platform.uuitk/StylerPL.qml b/ui/qml/components/platform.uuitk/StylerPL.qml index 82647b61..c29c0ce3 100644 --- a/ui/qml/components/platform.uuitk/StylerPL.qml +++ b/ui/qml/components/platform.uuitk/StylerPL.qml @@ -82,25 +82,14 @@ QtObject { property string iconFavorite: Qt.resolvedUrl("../icons/uuitk/bookmark-new-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") property string iconMenu: "image://theme/navigation-menu" //Qt.resolvedUrl("../../icons/open-menu-symbolic.svg") - property string iconNavigate: Qt.resolvedUrl("../icons/uuitk/route-to.svg") - property string iconNavigateTo: iconNavigate - property string iconNavigateFrom: Qt.resolvedUrl("../icons/uuitk/route-from.svg") - property string iconNearby: Qt.resolvedUrl("../icons/uuitk/nearby-search.svg") property string iconPause: "image://theme/media-playback-pause" //Qt.resolvedUrl("../../icons/media-playback-pause-symbolic.svg") property string iconPhone: "image://theme/call-start" //Qt.resolvedUrl("../../icons/call-start-symbolic.svg") property string iconPreferences: "image://theme/settings" //Qt.resolvedUrl("../../icons/preferences-system-symbolic.svg") - property string iconProfileMixed: Qt.resolvedUrl("../icons/uuitk/profile-mixed.svg") - property string iconProfileOffline: Qt.resolvedUrl("../icons/uuitk/profile-offline.svg") - property string iconProfileOnline: Qt.resolvedUrl("../icons/uuitk/profile-online.svg") property string iconRefresh: "image://theme/view-refresh" //Qt.resolvedUrl("../../icons/view-refresh-symbolic.svg") property string iconSave: "image://theme/save" //Qt.resolvedUrl("../../icons/document-save-symbolic.svg") property string iconSearch: "image://theme/find" //Qt.resolvedUrl("../../icons/edit-find-symbolic.svg") property string iconShare: "image://theme/share" //Qt.resolvedUrl("../../icons/emblem-shared-symbolic.svg") - property string iconShortlisted: "image://theme/select-none" //Qt.resolvedUrl("../../icons/shortlist-add-symbolic.svg") - 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" From 30ef1aef41b014e3392edec3c45404063c36244c Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 11:36:27 +0100 Subject: [PATCH 23/31] add all files into qrc --- ui/icons.qrc | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/ui/icons.qrc b/ui/icons.qrc index b52b9a63..53b988ca 100644 --- a/ui/icons.qrc +++ b/ui/icons.qrc @@ -1,34 +1,36 @@ - qml/custom-icons/icon-m-battery.png - qml/custom-icons/icon-m-biking.png - qml/custom-icons/icon-m-bluetooth-device.png - qml/custom-icons/icon-m-heartrate.png - qml/custom-icons/icon-m-running.png - qml/custom-icons/icon-m-steps.png - qml/custom-icons/icon-m-treadmill.png - qml/custom-icons/icon-m-unknown.png - qml/custom-icons/icon-m-walking.png - qml/custom-icons/icon-m-watch.png - qml/custom-icons/icon-m-contact.png + qml/custom-icons/icon-m-location.png qml/custom-icons/icon-m-diagnostic.png + qml/custom-icons/icon-m-trail running.png + qml/custom-icons/icon-m-battery.png qml/custom-icons/icon-m-levels.png - qml/custom-icons/icon-m-alarm.png + qml/custom-icons/icon-m-watch.png + qml/custom-icons/icon-m-steps2.png + qml/custom-icons/icon-m-open swimming.png qml/custom-icons/icon-m-weather-d212-light.png - qml/custom-icons/icon-m-favorite-selected.png qml/custom-icons/icon-m-forward.png - qml/custom-icons/icon-m-back.png + qml/custom-icons/icon-m-steps.png qml/custom-icons/icon-m-down.png - qml/custom-icons/icon-m-up.png - qml/custom-icons/icon-m-up-down.png - qml/custom-icons/icon-m-location.png - qml/custom-icons/icon-m-clock.png - qml/custom-icons/icon-strava.png + qml/custom-icons/icon-m-walking.png qml/custom-icons/icon-m-cycling.png - qml/custom-icons/icon-m-indoor cycling.png + qml/custom-icons/icon-m-biking.png qml/custom-icons/icon-m-swimming.png - qml/custom-icons/icon-m-open swimming.png + qml/custom-icons/icon-m-heartrate2.png + qml/custom-icons/icon-m-back.png + qml/custom-icons/icon-m-bluetooth-device.png + qml/custom-icons/icon-m-indoor cycling.png + qml/custom-icons/icon-m-contact.png + qml/custom-icons/icon-strava.png + qml/custom-icons/icon-m-running.png + qml/custom-icons/icon-m-up.png + qml/custom-icons/icon-m-clock.png + qml/custom-icons/icon-m-up-down.png qml/custom-icons/icon-m-skiing.png - qml/custom-icons/icon-m-trail running.png + qml/custom-icons/icon-m-favorite-selected.png + qml/custom-icons/icon-m-unknown.png + qml/custom-icons/icon-m-heartrate.png + qml/custom-icons/icon-m-treadmill.png + qml/custom-icons/icon-m-alarm.png From 99d6d65ab1f2258d0d16ba5a9774af79c4b05bc2 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 11:39:52 +0100 Subject: [PATCH 24/31] fix uuitk styler icon paths --- ui/qml/components/platform.uuitk/StylerPL.qml | 11 +++++------ ui/qml/pages/TestIconsPage.qml | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/qml/components/platform.uuitk/StylerPL.qml b/ui/qml/components/platform.uuitk/StylerPL.qml index c29c0ce3..d56d2932 100644 --- a/ui/qml/components/platform.uuitk/StylerPL.qml +++ b/ui/qml/components/platform.uuitk/StylerPL.qml @@ -56,12 +56,11 @@ QtObject { 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 iconSteps: "qrc:///qml/custom-icons/icon-m-steps2.png" + property string iconHeartrate: "qrc:///qml/custom-icons/icon-m-heartrate2.png" property string iconDeviceScan: "image://theme/toolkit_input-search" @@ -78,8 +77,8 @@ QtObject { 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 iconEmail: "image://theme/mail-read-symbolic" + property string iconFavorite: "image://theme/bookmark-new-symbolic" // Qt.resolvedUrl("../icons/uuitk/bookmark-new-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 iconMenu: "image://theme/navigation-menu" //Qt.resolvedUrl("../../icons/open-menu-symbolic.svg") @@ -104,7 +103,7 @@ QtObject { property string iconDiagnostic: "image://theme/info" // "Debug Info" property string iconFavoriteSelected: "image://theme/bookmark" // "Donate" - property string customIconPrefix: "../../pics/custom-icons/" + property string customIconPrefix: "qrc:///qml/custom-icons/" property string customIconSuffix: ".png" property string iconLocation: "image://theme/location" diff --git a/ui/qml/pages/TestIconsPage.qml b/ui/qml/pages/TestIconsPage.qml index ff340367..54826ec1 100644 --- a/ui/qml/pages/TestIconsPage.qml +++ b/ui/qml/pages/TestIconsPage.qml @@ -42,7 +42,7 @@ PageListPL { for (let i = 0; i < properties.length; ++i) { let propertyName = properties[i]; if (regex.test(propertyName) && !regexEnd.test(propertyName)) { - console.log(propertyName + ": " + styler[propertyName]); +// console.log(propertyName + ": " + styler[propertyName]); append({"icon": styler[propertyName], "name": propertyName}); } } From dc4941f93220a398fe7e650aad5cd657ea9fb9b3 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 11:46:56 +0100 Subject: [PATCH 25/31] Update icon paths --- ui/qml/components/platform.kirigami/StylerPL.qml | 4 ++-- ui/qml/components/platform.silica/StylerPL.qml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/qml/components/platform.kirigami/StylerPL.qml b/ui/qml/components/platform.kirigami/StylerPL.qml index 8ba401ab..8887674f 100644 --- a/ui/qml/components/platform.kirigami/StylerPL.qml +++ b/ui/qml/components/platform.kirigami/StylerPL.qml @@ -96,8 +96,8 @@ QtObject { property string iconLocation: "icon-m-location" property string iconStrava: "icon-strava" - property string customIconPrefix: "" - property string customIconSuffix: "" + property string customIconPrefix: "qrc:///qml/custom-icons/" + property string customIconSuffix: ".png" // item sizes property real themeItemSizeLarge: themeItemSizeSmall * 2 diff --git a/ui/qml/components/platform.silica/StylerPL.qml b/ui/qml/components/platform.silica/StylerPL.qml index 8830e689..6be14791 100644 --- a/ui/qml/components/platform.silica/StylerPL.qml +++ b/ui/qml/components/platform.silica/StylerPL.qml @@ -89,15 +89,15 @@ QtObject { property string iconFavoriteSelected: "image://theme/icon-m-favorite-selected" property string iconBattery: "image://theme/icon-m-battery" property string iconBluetooth: "image://theme/icon-m-bluetooth-device" - property string iconSteps: "../../pics/custom-icons/icon-m-steps.png" - property string iconHeartrate: "../../pics/custom-icons/icon-m-heartrate.png" + property string iconSteps: "qrc:///qml/custom-icons/icon-m-steps.png" + property string iconHeartrate: "qrc:///qml/custom-icons/icon-m-heartrate.png" property string iconUp: "image://theme/icon-m-up" property string iconDown: "image://theme/icon-m-down" - property string iconUpDown: "../../pics/custom-icons/icon-m-up-down.png" + property string iconUpDown: "qrc:///qml/custom-icons/icon-m-up-down.png" property string iconClock: "image://theme/icon-m-clock" property string iconLocation: "image://theme/icon-m-location" - property string iconStrava: "../../pics/custom-icons/icon-strava.png" - property string customIconPrefix: "../../pics/custom-icons/" + property string iconStrava: "qrc:///qml/custom-icons/icon-strava.png" + property string customIconPrefix: "qrc:///qml/custom-icons/" property string customIconSuffix: ".png" // item sizes From 0afbddaec6f14415e029005ccdd54286c9133401 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 12:43:54 +0100 Subject: [PATCH 26/31] QtCreatorDeployment.txt for ui --- ui/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index 3fc174f5..86310ba2 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -108,3 +108,6 @@ install(FILES "icons/scalable/harbour-amazfish-ui.svg" install(FILES "harbour-amazfish-ui.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") + +file(WRITE "${CMAKE_BINARY_DIR}/QtCreatorDeployment.txt" + "${CMAKE_INSTALL_PREFIX}\n${CMAKE_BINARY_DIR}/harbour-amazfish-ui:bin\n") From d931b34b4bf51f9d455862848e3b076ca9d35918 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 13:00:56 +0100 Subject: [PATCH 27/31] Remove unused and broken icon --- ui/qml/components/platform.kirigami/StylerPL.qml | 1 - ui/qml/components/platform.qtcontrols/StylerPL.qml | 1 - ui/qml/components/platform.silica/StylerPL.qml | 1 - ui/qml/components/platform.uuitk/StylerPL.qml | 1 - ui/qml/pages/TestIconsPage.qml | 10 +++++----- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ui/qml/components/platform.kirigami/StylerPL.qml b/ui/qml/components/platform.kirigami/StylerPL.qml index 8887674f..f3977a98 100644 --- a/ui/qml/components/platform.kirigami/StylerPL.qml +++ b/ui/qml/components/platform.kirigami/StylerPL.qml @@ -60,7 +60,6 @@ QtObject { property string iconClear: "edit-clear-all-symbolic" property string iconClose: "window-close-symbolic" property string iconDelete: "edit-delete-symbolic" - property string iconDot: "find-location-symbolic" property string iconEdit: "document-edit-symbolic" property string iconEditClear: "edit-clear-symbolic" property string iconFavorite: "bookmark-new-symbolic" diff --git a/ui/qml/components/platform.qtcontrols/StylerPL.qml b/ui/qml/components/platform.qtcontrols/StylerPL.qml index a149d7f2..77a4d5eb 100644 --- a/ui/qml/components/platform.qtcontrols/StylerPL.qml +++ b/ui/qml/components/platform.qtcontrols/StylerPL.qml @@ -59,7 +59,6 @@ QtObject { property string iconClear: "edit-clear-all-symbolic" property string iconClose: "window-close-symbolic" property string iconDelete: "edit-delete-symbolic" - property string iconDot: "find-location-symbolic" property string iconDown: "go-down-symbolic" property string iconEdit: "document-edit-symbolic" property string iconEditClear: "edit-clear-symbolic" diff --git a/ui/qml/components/platform.silica/StylerPL.qml b/ui/qml/components/platform.silica/StylerPL.qml index 6be14791..0cabdb05 100644 --- a/ui/qml/components/platform.silica/StylerPL.qml +++ b/ui/qml/components/platform.silica/StylerPL.qml @@ -62,7 +62,6 @@ QtObject { property string iconClear: "image://theme/icon-m-clear" property string iconClose: "image://theme/icon-m-dismiss" property string iconDelete: "image://theme/icon-m-delete" - property string iconDot: Theme.colorScheme ? Qt.resolvedUrl("../icons/sailfishos/center-black.svg") : Qt.resolvedUrl("../icons/sailfishos/center-white.svg") property string iconEdit: "image://theme/icon-m-edit" property string iconEditClear: "image://theme/icon-m-clear" property string iconFavorite: "image://theme/icon-m-favorite" diff --git a/ui/qml/components/platform.uuitk/StylerPL.qml b/ui/qml/components/platform.uuitk/StylerPL.qml index d56d2932..ba188c60 100644 --- a/ui/qml/components/platform.uuitk/StylerPL.qml +++ b/ui/qml/components/platform.uuitk/StylerPL.qml @@ -73,7 +73,6 @@ QtObject { 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") diff --git a/ui/qml/pages/TestIconsPage.qml b/ui/qml/pages/TestIconsPage.qml index 54826ec1..c9851a0e 100644 --- a/ui/qml/pages/TestIconsPage.qml +++ b/ui/qml/pages/TestIconsPage.qml @@ -35,12 +35,12 @@ PageListPL { property bool completed: false Component.onCompleted: { - let properties = Object.keys(styler); // Get all property names - let regex = /^icon/; // Regex to match property names starting with "icon" - let regexEnd = /Changed$/; // Regex to match property names starting with "icon" + var properties = Object.keys(styler); // Get all property names + var regex = /^icon/; // Regex to match property names starting with "icon" + var regexEnd = /Changed$/; // Regex to match property names starting with "icon" - for (let i = 0; i < properties.length; ++i) { - let propertyName = properties[i]; + for (var i = 0; i < properties.length; ++i) { + var propertyName = properties[i]; if (regex.test(propertyName) && !regexEnd.test(propertyName)) { // console.log(propertyName + ": " + styler[propertyName]); append({"icon": styler[propertyName], "name": propertyName}); From 3c5b1b1008e724137d45643e69d1dea647fc44f2 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 13:29:44 +0100 Subject: [PATCH 28/31] SailfishOS translation dir --- daemon/CMakeLists.txt | 2 ++ ui/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 0ef06adb..9d3eaf1a 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -234,6 +234,8 @@ file(GLOB TS_FILES translations/*.ts) # TODO check if translation path is correct on all platforms if(FLAVOR STREQUAL "uuitk") add_definitions(-DTRANSLATION_FOLDER="../share/harbour-amazfish/translations") +elseif(FLAVOR STREQUAL "silica") + add_definitions(-DTRANSLATION_FOLDER="/usr/share/harbour-amazfish/translations") else() add_definitions(-DTRANSLATION_FOLDER=".") endif() diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index 86310ba2..f9a0e4a3 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -11,6 +11,8 @@ file(GLOB TS_FILES translations/*.ts) if(FLAVOR STREQUAL "uuitk") add_definitions(-DTRANSLATION_FOLDER="./share/harbour-amazfish/translations") +elseif(FLAVOR STREQUAL "silica") + add_definitions(-DTRANSLATION_FOLDER="/usr/share/harbour-amazfish/translations") else() add_definitions(-DTRANSLATION_FOLDER=".") endif() From 6a176e3e041eff10676ce5cf6fc751e4b8cc2cbf Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 14:37:00 +0100 Subject: [PATCH 29/31] SailfishOS fix paths --- daemon/CMakeLists.txt | 8 ++++---- daemon/src/deviceinterface.cpp | 2 +- rpm/harbour-amazfish.spec | 5 +++-- ui/CMakeLists.txt | 6 +++--- ui/qml/cover/CoverPage.qml | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 9d3eaf1a..3dc2e29e 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -233,9 +233,9 @@ file(GLOB TS_FILES translations/*.ts) # TODO check if translation path is correct on all platforms if(FLAVOR STREQUAL "uuitk") - add_definitions(-DTRANSLATION_FOLDER="../share/harbour-amazfish/translations") + add_definitions(-DTRANSLATION_FOLDER="../share/harbour-amazfishd/translations") elseif(FLAVOR STREQUAL "silica") - add_definitions(-DTRANSLATION_FOLDER="/usr/share/harbour-amazfish/translations") + add_definitions(-DTRANSLATION_FOLDER="/usr/share/harbour-amazfishd/translations") else() add_definitions(-DTRANSLATION_FOLDER=".") endif() @@ -248,10 +248,10 @@ QT5_CREATE_TRANSLATION(QT_FILES "${CMAKE_SOURCE_DIR}" OPTIONS "-no-obsolete") install(FILES ${QM_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfish/translations") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfishd/translations") install(FILES "chirp.raw" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfish/") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfishd/") install(FILES "harbour-amazfishd.privileges" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/mapplauncherd/privileges.d/") diff --git a/daemon/src/deviceinterface.cpp b/daemon/src/deviceinterface.cpp index bad7b5d3..1d19b4a0 100644 --- a/daemon/src/deviceinterface.cpp +++ b/daemon/src/deviceinterface.cpp @@ -698,7 +698,7 @@ void DeviceInterface::findDevice() if(!file.open(QIODevice::ReadOnly)) { - qWarning() << Q_FUNC_INFO << "Unable to open chirp sound"; + qWarning() << Q_FUNC_INFO << "Unable to open chirp sound" << file.fileName(); return; } diff --git a/rpm/harbour-amazfish.spec b/rpm/harbour-amazfish.spec index b9e40dd3..2daf307c 100644 --- a/rpm/harbour-amazfish.spec +++ b/rpm/harbour-amazfish.spec @@ -129,12 +129,13 @@ rm -f %{buildroot}/usr/share/metainfo/harbour-amazfish-ui.appdata.xml %{_bindir}/%{name}-ui %{_bindir}/%{name}d %attr(2755,root,privileged) %{_bindir}/%{name}d -%{_datadir}/%{name} +%{_datadir}/%{name}d +%{_datadir}/%{name}-ui %{_datadir}/applications/%{name}-ui.desktop %{_datadir}/icons/hicolor/*/apps/%{name}-ui.png %{_datadir}/icons/hicolor/scalable/apps/%{name}-ui.svg %{_userunitdir}/harbour-amazfish.service %{_datadir}/mapplauncherd/privileges.d/harbour-amazfishd.privileges -%{_datadir}/harbour-amazfish/chirp.raw +%{_datadir}/harbour-amazfishd/chirp.raw # >> files # << files diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index f9a0e4a3..c16f1932 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -10,9 +10,9 @@ add_subdirectory(o2) file(GLOB TS_FILES translations/*.ts) if(FLAVOR STREQUAL "uuitk") - add_definitions(-DTRANSLATION_FOLDER="./share/harbour-amazfish/translations") + add_definitions(-DTRANSLATION_FOLDER="./share/harbour-amazfish-ui/translations") elseif(FLAVOR STREQUAL "silica") - add_definitions(-DTRANSLATION_FOLDER="/usr/share/harbour-amazfish/translations") + add_definitions(-DTRANSLATION_FOLDER="/usr/share/harbour-amazfish-ui/translations") else() add_definitions(-DTRANSLATION_FOLDER=".") endif() @@ -62,7 +62,7 @@ QT5_CREATE_TRANSLATION(QT_FILES "${CMAKE_SOURCE_DIR}" OPTIONS "-no-obsolete") install(FILES ${QM_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfish/translations") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/harbour-amazfish-ui/translations") install(TARGETS harbour-amazfish-ui RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/ui/qml/cover/CoverPage.qml b/ui/qml/cover/CoverPage.qml index b40e9136..cafe96c6 100644 --- a/ui/qml/cover/CoverPage.qml +++ b/ui/qml/cover/CoverPage.qml @@ -70,7 +70,7 @@ CoverBackground { Image { id: imgSteps - source: "../pics/custom-icons/icon-m-steps.png" + source: "../custom-icons/icon-m-steps.png" height: Theme.iconSizeMedium width: height } @@ -94,7 +94,7 @@ CoverBackground { Image { id: imgHeartrate - source: "../pics/custom-icons/icon-m-heartrate.png" + source: "../custom-icons/icon-m-heartrate.png" height: Theme.iconSizeMedium width: height } From e1f9ce44c3eb3c196a530efd200afe74f3593078 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sat, 4 Jan 2025 15:06:32 +0100 Subject: [PATCH 30/31] load chirp other way around --- daemon/src/deviceinterface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/src/deviceinterface.cpp b/daemon/src/deviceinterface.cpp index 1d19b4a0..2b8116e5 100644 --- a/daemon/src/deviceinterface.cpp +++ b/daemon/src/deviceinterface.cpp @@ -690,10 +690,10 @@ void DeviceInterface::findDevice() int error; -#ifdef MER_EDITION_SAILFISH - QFile file("/usr/share/harbour-amazfishd/chirp.raw"); -#else // elif defined(UUITK_EDITION) +#ifdef UUITK_EDITION QFile file("/opt/click.ubuntu.com/uk.co.piggz.amazfish/current/share/harbour-amazfishd/chirp.raw"); +#else // elif defined(MER_EDITION_SAILFISH) + QFile file("/usr/share/harbour-amazfishd/chirp.raw"); #endif if(!file.open(QIODevice::ReadOnly)) From 20278d4f4b2c9d849353c9511f808af6802c230d Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sun, 5 Jan 2025 15:32:42 +0100 Subject: [PATCH 31/31] Update documentation for cmake --- documentation/build-instructions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/build-instructions.md b/documentation/build-instructions.md index 4be08fb8..a65298e4 100644 --- a/documentation/build-instructions.md +++ b/documentation/build-instructions.md @@ -38,7 +38,7 @@ In Ubuntu 20.04, with default Ubuntu repository, QT is in version 5.12.8. Tested Most dependencies can be installed from the system's package repositories: ``` sudo apt update -sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libkdb3-dev libkf5contacts-dev libkf5archive-dev libkf5coreaddons-dev qtlocation5-dev qtconnectivity5-dev qtpositioning5-dev qml-module-qtbluetooth qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qt-labs-settings qml-module-org-kde-kirigami2 qml-module-org-kde-bluezqt +sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libkdb3-dev libkf5contacts-dev libkf5archive-dev libkf5coreaddons-dev qtlocation5-dev qtconnectivity5-dev qtpositioning5-dev qml-module-qtbluetooth qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qt-labs-settings qml-module-org-kde-kirigami2 qml-module-org-kde-bluezqt cmake ninja-build ``` Two dependencies can be found on git repos @@ -90,8 +90,8 @@ git submodule update ``` mkdir build cd build -qmake FLAVOR=kirigami .. -make +cmake -DFLAVOR=silica .. +cmake --build .. ``` Here, you may get an error like this: