Skip to content

Commit

Permalink
Implement functions for QML modules
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Mar 12, 2024
1 parent 8785929 commit e11588e
Show file tree
Hide file tree
Showing 25 changed files with 576 additions and 784 deletions.
15 changes: 15 additions & 0 deletions lib/cmake-scripts/cntp-qml.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include_guard()

macro(cntp_add_qml_module moduleName parentTarget)
qt_add_library(${parentTarget}-qmlmodule-${moduleName} STATIC)
target_link_libraries(${parentTarget}-qmlmodule-${moduleName}
PRIVATE libcontemporary Qt::Quick Qt::QuickControls2
)
qt_add_qml_module(${parentTarget}-qmlmodule-${moduleName} ${ARGN})

target_link_libraries(${parentTarget} PRIVATE ${parentTarget}-qmlmodule-${moduleName}plugin)

set_property(TARGET ${parentTarget} APPEND
PROPERTY CNTP_MODULE_TARGETS ${parentTarget}-qmlmodule-${moduleName}
)
endmacro()
24 changes: 23 additions & 1 deletion lib/cmake-scripts/cntp-translate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,30 @@ function(cntp_translate target)
list(APPEND TRANSLATION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/translations/en_US.ts)

get_target_property(SOURCE_FILES ${target} TRANSLATION_SOURCES)
if("${SOURCE_FILES}" STREQUAL "")
if("${SOURCE_FILES}" STREQUAL "SOURCE_FILES-NOTFOUND")
get_target_property(SOURCE_FILES ${target} SOURCES)
if(SOURCE_FILES STREQUAL "SOURCE_FILES-NOTFOUND")
set(SOURCE_FILES "")
endif()

get_target_property(QML_FILES ${target} QT_QML_MODULE_QML_FILES)
if(NOT QML_FILES STREQUAL "QML_FILES-NOTFOUND")
foreach(QML_FILE ${QML_FILES})
list(APPEND SOURCE_FILES ${QML_FILE})
endforeach()
endif()
endif()

get_target_property(TARGET_MODULES ${target} CNTP_MODULE_TARGETS)
if(NOT TARGET_MODULES STREQUAL "TARGET_MODULES-NOTFOUND")
foreach(MODULE ${TARGET_MODULES})
get_target_property(MODULE_QML_FILES ${MODULE} QT_QML_MODULE_QML_FILES)
if(NOT TARGET_MODULES STREQUAL "MODULE_QML_FILES-NOTFOUND")
foreach(QML_FILE ${MODULE_QML_FILES})
list(APPEND SOURCE_FILES ${QML_FILE})
endforeach()
endif()
endforeach()
endif()

set(QT_DEFAULT_MAJOR_VERSION ${QT_VERSION_MAJOR})
Expand Down
12 changes: 0 additions & 12 deletions lib/translations/ar_SA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,11 @@
<name>tAboutDialog</name>
<message>
<location filename="../taboutdialog.ui" line="251"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_taboutdialog.h" line="227"/>
<source>SOFTWARE</source>
<translation>البرامج</translation>
</message>
<message>
<location filename="../taboutdialog.ui" line="297"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_taboutdialog.h" line="228"/>
<source>COPYRIGHT</source>
<translation>حقوق النشر</translation>
</message>
Expand Down Expand Up @@ -560,13 +558,11 @@
<name>tInputDialog</name>
<message>
<location filename="../tinputdialog.ui" line="48"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tinputdialog.h" line="87"/>
<source>Cancel</source>
<translation>إلغاء</translation>
</message>
<message>
<location filename="../tinputdialog.ui" line="55"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tinputdialog.h" line="88"/>
<source>OK</source>
<translation>نعم</translation>
</message>
Expand Down Expand Up @@ -763,49 +759,41 @@
<name>tPrintPopover</name>
<message>
<location filename="../tprintpopover.ui" line="172"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="201"/>
<source>Copies</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="117"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="195"/>
<source>PRINT OPTIONS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="137"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="197"/>
<source>Print</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="130"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="196"/>
<source>Printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="148"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="198"/>
<source>Page Size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="155"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="199"/>
<source>Print in Grayscale</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="165"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="200"/>
<source>Double Sided</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="189"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="202"/>
<source>PDF</source>
<translation type="unfinished"></translation>
</message>
Expand Down
12 changes: 0 additions & 12 deletions lib/translations/bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,11 @@
<name>tAboutDialog</name>
<message>
<location filename="../taboutdialog.ui" line="251"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_taboutdialog.h" line="227"/>
<source>SOFTWARE</source>
<translation></translation>
</message>
<message>
<location filename="../taboutdialog.ui" line="297"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_taboutdialog.h" line="228"/>
<source>COPYRIGHT</source>
<translation></translation>
</message>
Expand Down Expand Up @@ -549,13 +547,11 @@
<name>tInputDialog</name>
<message>
<location filename="../tinputdialog.ui" line="48"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tinputdialog.h" line="87"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../tinputdialog.ui" line="55"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tinputdialog.h" line="88"/>
<source>OK</source>
<translation></translation>
</message>
Expand Down Expand Up @@ -752,49 +748,41 @@
<name>tPrintPopover</name>
<message>
<location filename="../tprintpopover.ui" line="117"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="195"/>
<source>PRINT OPTIONS</source>
<translation></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="130"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="196"/>
<source>Printer</source>
<translation></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="137"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="197"/>
<source>Print</source>
<translation></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="148"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="198"/>
<source>Page Size</source>
<translation></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="155"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="199"/>
<source>Print in Grayscale</source>
<translation></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="165"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="200"/>
<source>Double Sided</source>
<translation></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="172"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="201"/>
<source>Copies</source>
<translation></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="189"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="202"/>
<source>PDF</source>
<translation></translation>
</message>
Expand Down
12 changes: 0 additions & 12 deletions lib/translations/cs_CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,11 @@
<name>tAboutDialog</name>
<message>
<location filename="../taboutdialog.ui" line="251"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_taboutdialog.h" line="227"/>
<source>SOFTWARE</source>
<translation>SOFTWARE</translation>
</message>
<message>
<location filename="../taboutdialog.ui" line="297"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_taboutdialog.h" line="228"/>
<source>COPYRIGHT</source>
<translation>COPYRIGHT</translation>
</message>
Expand Down Expand Up @@ -565,13 +563,11 @@
<name>tInputDialog</name>
<message>
<location filename="../tinputdialog.ui" line="48"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tinputdialog.h" line="87"/>
<source>Cancel</source>
<translation>Zrušit</translation>
</message>
<message>
<location filename="../tinputdialog.ui" line="55"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tinputdialog.h" line="88"/>
<source>OK</source>
<translation>OK</translation>
</message>
Expand Down Expand Up @@ -788,49 +784,41 @@
<name>tPrintPopover</name>
<message>
<location filename="../tprintpopover.ui" line="172"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="201"/>
<source>Copies</source>
<translation>Kopie</translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="117"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="195"/>
<source>PRINT OPTIONS</source>
<translation>MOŽNOSTI TISKU</translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="137"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="197"/>
<source>Print</source>
<translation>Tisk</translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="130"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="196"/>
<source>Printer</source>
<translation>Tiskárna</translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="148"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="198"/>
<source>Page Size</source>
<translation>Velikost strany</translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="155"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="199"/>
<source>Print in Grayscale</source>
<translation>Vytisknout černobíle</translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="165"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="200"/>
<source>Double Sided</source>
<translation>Oboustranně</translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="189"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="202"/>
<source>PDF</source>
<translation>PDF</translation>
</message>
Expand Down
12 changes: 0 additions & 12 deletions lib/translations/cy_GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,11 @@
<name>tAboutDialog</name>
<message>
<location filename="../taboutdialog.ui" line="251"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_taboutdialog.h" line="227"/>
<source>SOFTWARE</source>
<translation>MEDDALWEDD</translation>
</message>
<message>
<location filename="../taboutdialog.ui" line="297"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_taboutdialog.h" line="228"/>
<source>COPYRIGHT</source>
<translation>HAWLFRAINT</translation>
</message>
Expand Down Expand Up @@ -553,13 +551,11 @@
<name>tInputDialog</name>
<message>
<location filename="../tinputdialog.ui" line="48"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tinputdialog.h" line="87"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tinputdialog.ui" line="55"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tinputdialog.h" line="88"/>
<source>OK</source>
<translation type="unfinished">IAWN</translation>
</message>
Expand Down Expand Up @@ -756,49 +752,41 @@
<name>tPrintPopover</name>
<message>
<location filename="../tprintpopover.ui" line="172"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="201"/>
<source>Copies</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="117"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="195"/>
<source>PRINT OPTIONS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="137"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="197"/>
<source>Print</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="130"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="196"/>
<source>Printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="148"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="198"/>
<source>Page Size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="155"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="199"/>
<source>Print in Grayscale</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="165"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="200"/>
<source>Double Sided</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../tprintpopover.ui" line="189"/>
<location filename="../../../build-libcontemporary-Chroot_6-Debug/lib/libcontemporary_autogen/include/ui_tprintpopover.h" line="202"/>
<source>PDF</source>
<translation type="unfinished"></translation>
</message>
Expand Down
Loading

0 comments on commit e11588e

Please sign in to comment.