From f9bee05d490b98d6a41ec16059c4d4ba0a232232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 9 Nov 2019 00:20:08 +0100 Subject: [PATCH] extensions-tool: Add template metadata When we allow users to choose between different templates, we should provide some context for each template to facilitate that choice. Add that metadata in the form of a .desktop file, which allows us to specify name and description, and is well supported by our translation infrastructure. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812 --- po/POTFILES.in | 1 + subprojects/extensions-tool/meson.build | 2 ++ .../src/gnome-extensions-tool.gresource.xml | 1 + subprojects/extensions-tool/src/meson.build | 5 ++++- .../src/templates/00-plain.desktop.in | 5 +++++ .../extensions-tool/src/templates/meson.build | 12 ++++++++++++ 6 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 subprojects/extensions-tool/src/templates/00-plain.desktop.in create mode 100644 subprojects/extensions-tool/src/templates/meson.build diff --git a/po/POTFILES.in b/po/POTFILES.in index 499d3a700..765dbb72d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -94,5 +94,6 @@ subprojects/extensions-tool/src/command-prefs.c subprojects/extensions-tool/src/command-reset.c subprojects/extensions-tool/src/command-uninstall.c subprojects/extensions-tool/src/main.c +subprojects/extensions-tool/src/templates/00-plain.desktop.in # Please do not remove this file from POTFILES.in. Run "git submodule init && git submodule update" to get it. subprojects/gvc/gvc-mixer-control.c diff --git a/subprojects/extensions-tool/meson.build b/subprojects/extensions-tool/meson.build index 0e95edd98..0832bf085 100644 --- a/subprojects/extensions-tool/meson.build +++ b/subprojects/extensions-tool/meson.build @@ -35,6 +35,8 @@ cc = meson.get_compiler('c') bash_completion = dependency('bash-completion', required: get_option('bash_completion')) +po_dir = meson.source_root() + '/po' + subdir('src') if bash_completion.found() diff --git a/subprojects/extensions-tool/src/gnome-extensions-tool.gresource.xml b/subprojects/extensions-tool/src/gnome-extensions-tool.gresource.xml index dce8d5c66..684358c13 100644 --- a/subprojects/extensions-tool/src/gnome-extensions-tool.gresource.xml +++ b/subprojects/extensions-tool/src/gnome-extensions-tool.gresource.xml @@ -1,6 +1,7 @@ + templates/00-plain.desktop templates/plain/extension.js templates/plain/stylesheet.css diff --git a/subprojects/extensions-tool/src/meson.build b/subprojects/extensions-tool/src/meson.build index 77d62b5e9..a855fef97 100644 --- a/subprojects/extensions-tool/src/meson.build +++ b/subprojects/extensions-tool/src/meson.build @@ -22,9 +22,12 @@ sources = [ 'main.c' ] +subdir('templates') + resources = gnome.compile_resources('resources', 'gnome-extensions-tool.gresource.xml', - source_dir: '.' + source_dir: ['.', meson.current_build_dir()], + dependencies: template_deps, ) executable('gnome-extensions', diff --git a/subprojects/extensions-tool/src/templates/00-plain.desktop.in b/subprojects/extensions-tool/src/templates/00-plain.desktop.in new file mode 100644 index 000000000..36ddf807c --- /dev/null +++ b/subprojects/extensions-tool/src/templates/00-plain.desktop.in @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Application +Name=Plain +Comment=An empty extension +Path=plain diff --git a/subprojects/extensions-tool/src/templates/meson.build b/subprojects/extensions-tool/src/templates/meson.build new file mode 100644 index 000000000..4f86ad4e2 --- /dev/null +++ b/subprojects/extensions-tool/src/templates/meson.build @@ -0,0 +1,12 @@ +template_metas = [ + '00-plain.desktop', +] +template_deps = [] +foreach template : template_metas + template_deps += i18n.merge_file(template, + input: template + '.in', + output: template, + po_dir: po_dir, + type: 'desktop', + ) +endforeach