Skip to content

Commit 8e95b97

Browse files
author
Johannes Renkl
committed
The one and only
1 parent 10b165d commit 8e95b97

File tree

12 files changed

+332
-6
lines changed

12 files changed

+332
-6
lines changed

CMakeLists.txt

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
project(MFPVE C CXX)
2+
cmake_minimum_required(VERSION 3.0.0)
3+
4+
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
5+
6+
find_package(Qt5Core)
7+
find_package(Qt5Qml)
8+
find_package(Qt5Quick)
9+
10+
# Automatically create moc files
11+
set(CMAKE_AUTOMOC ON)
12+
13+
# Components PATH
14+
execute_process(
15+
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
16+
OUTPUT_VARIABLE ARCH_TRIPLET
17+
OUTPUT_STRIP_TRAILING_WHITESPACE
18+
)
19+
20+
set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")
21+
22+
set(PROJECT_NAME "MFPVE")
23+
set(FULL_PROJECT_NAME "mfpve.hummlbach")
24+
set(CMAKE_INSTALL_PREFIX /)
25+
set(DATA_DIR /)
26+
set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop)
27+
28+
# This command figures out the target architecture for use in the manifest file
29+
execute_process(
30+
COMMAND dpkg-architecture -qDEB_HOST_ARCH
31+
OUTPUT_VARIABLE CLICK_ARCH
32+
OUTPUT_STRIP_TRAILING_WHITESPACE
33+
)
34+
35+
configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
36+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
37+
install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR})
38+
install(DIRECTORY qml DESTINATION ${DATA_DIR})
39+
install(DIRECTORY assets DESTINATION ${DATA_DIR})
40+
41+
# Translations
42+
file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js)
43+
list(APPEND I18N_SRC_FILES ${DESKTOP_FILE_NAME}.in.h)
44+
45+
find_program(INTLTOOL_MERGE intltool-merge)
46+
if(NOT INTLTOOL_MERGE)
47+
message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package")
48+
endif()
49+
find_program(INTLTOOL_EXTRACT intltool-extract)
50+
if(NOT INTLTOOL_EXTRACT)
51+
message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
52+
endif()
53+
54+
add_custom_target(${DESKTOP_FILE_NAME} ALL
55+
COMMENT "Merging translations into ${DESKTOP_FILE_NAME}..."
56+
COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${CMAKE_SOURCE_DIR}/${DESKTOP_FILE_NAME}.in ${DESKTOP_FILE_NAME}
57+
COMMAND sed -i 's/${PROJECT_NAME}-//g' ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}
58+
)
59+
60+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR})
61+
62+
add_subdirectory(po)
63+
64+
# Make source files visible in qtcreator
65+
file(GLOB_RECURSE PROJECT_SRC_FILES
66+
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
67+
qml/*.qml
68+
qml/*.js
69+
*.json
70+
*.json.in
71+
*.apparmor
72+
*.desktop.in
73+
)
74+
75+
add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES})

LICENSE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GNU GENERAL PUBLIC LICENSE
1+
GNU GENERAL PUBLIC LICENSE
22
Version 3, 29 June 2007
33

44
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
631631
state the exclusion of warranty; and each file should have at least
632632
the "copyright" line and a pointer to where the full notice is found.
633633

634-
<one line to give the program's name and a brief idea of what it does.>
635-
Copyright (C) <year> <name of author>
634+
{one line to give the program's name and a brief idea of what it does.}
635+
Copyright (C) {year} {name of author}
636636

637637
This program is free software: you can redistribute it and/or modify
638638
it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
652652
If the program does terminal interaction, make it output a short
653653
notice like this when it starts in an interactive mode:
654654

655-
<program> Copyright (C) <year> <name of author>
655+
{project} Copyright (C) {year} {fullname}
656656
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657657
This is free software, and you are welcome to redistribute it
658658
under certain conditions; type `show c' for details.

MFPVE.apparmor

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"policy_groups": [],
3+
"policy_version": 1.3
4+
}

MFPVE.desktop.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Desktop Entry]
2+
_Name=MinFlickPathViewExample
3+
Exec=qmlscene qml/Main.qml
4+
Icon=assets/logo.svg
5+
Terminal=false
6+
Type=Application
7+
X-Ubuntu-Touch=true

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# MinFlickableInPathViewExample
2-
Minimal QML example of using Flickable inside a PathView
1+
# MinFlickPathViewExample
2+
3+
Minimal example for a Flickable in a PathView

assets/logo.svg

Lines changed: 24 additions & 0 deletions
Loading

clickable.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"template": "pure-qml-cmake",
3+
"kill": "qmlscene"
4+
}

manifest.json.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "mfpve.hummlbach",
3+
"description": "Minimal example for a Flickable in a PathView",
4+
"architecture": "@CLICK_ARCH@",
5+
"title": "MinFlickPathViewExample",
6+
"hooks": {
7+
"MFPVE": {
8+
"apparmor": "MFPVE.apparmor",
9+
"desktop": "MFPVE.desktop"
10+
}
11+
},
12+
"version": "1.0.0",
13+
"maintainer": "Johannes Renkl <[email protected]>",
14+
"framework" : "ubuntu-sdk-15.04.5"
15+
}

po/CMakeLists.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
include(FindGettext)
2+
find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
3+
4+
set(DOMAIN ${FULL_PROJECT_NAME})
5+
set(POT_FILE ${DOMAIN}.pot)
6+
file(GLOB PO_FILES *.po)
7+
8+
# Creates the .pot file containing the translations template
9+
add_custom_target(${POT_FILE} ALL
10+
COMMENT "Generating translation template"
11+
COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
12+
--srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE_NAME}.in
13+
14+
COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
15+
-D ${CMAKE_CURRENT_SOURCE_DIR}
16+
-D ${CMAKE_CURRENT_BINARY_DIR}
17+
--from-code=UTF-8
18+
--c++ --qt --language=javascript --add-comments=TRANSLATORS
19+
--keyword=tr --keyword=tr:1,2 --keyword=N_ --keyword=_
20+
--package-name='${DOMAIN}'
21+
${I18N_SRC_FILES}
22+
COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
23+
24+
# Builds the binary translations catalog for each language
25+
# it finds source translations (*.po) for
26+
foreach(PO_FILE ${PO_FILES})
27+
get_filename_component(LANG ${PO_FILE} NAME_WE)
28+
gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
29+
set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/share/locale/${LANG}/LC_MESSAGES)
30+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
31+
DESTINATION ${INSTALL_DIR}
32+
RENAME ${DOMAIN}.mo)
33+
endforeach(PO_FILE)

po/MFPVE.hummlbach.pot

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: MFPVE\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2017-01-17 02:22+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <[email protected]>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=CHARSET\n"
18+
"Content-Transfer-Encoding: 8bit\n"
19+
20+
msgid "Hello World!"
21+
msgstr ""
22+
23+
msgid "MinFlickPathViewExample"
24+
msgstr ""

0 commit comments

Comments
 (0)