Add a new tool, 'gnome-shell-extension-prefs', which can configure extensions

A new tool, 'gnome-shell-extension-prefs' can load a new entry point from
extensions, 'prefs.js', which has an entry point to return a GTK+ widget.
This allows extensions to have their own preferences dialog, without each
extension needing to ship its own Python script and .desktop file.

https://bugzilla.gnome.org/show_bug.cgi?id=668429
This commit is contained in:
Jasper St. Pierre
2012-01-18 21:21:56 -05:00
parent 80ff6ff797
commit b8a54faf94
8 changed files with 326 additions and 4 deletions

View File

@ -27,8 +27,8 @@ CLEANFILES += $(service_DATA)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
bin_SCRIPTS += gnome-shell-extension-tool
EXTRA_DIST += gnome-shell-extension-tool.in
bin_SCRIPTS += gnome-shell-extension-tool gnome-shell-extension-prefs
EXTRA_DIST += gnome-shell-extension-tool.in gnome-shell-extension-prefs.in
bin_PROGRAMS = gnome-shell-real
if USE_JHBUILD_WRAPPER_SCRIPT
@ -52,11 +52,13 @@ generated_script_substitutions = \
-e "s|@datadir[@]|$(datadir)|g" \
-e "s|@libexecdir[@]|$(libexecdir)|g" \
-e "s|@libdir[@]|$(libdir)|g" \
-e "s|@pkglibdir[@]|$(pkglibdir)|g" \
-e "s|@JHBUILD_TYPELIBDIR[@]|$(JHBUILD_TYPELIBDIR)|g" \
-e "s|@pkgdatadir[@]|$(pkgdatadir)|g" \
-e "s|@PYTHON[@]|$(PYTHON)|g" \
-e "s|@VERSION[@]|$(VERSION)|g" \
-e "s|@sysconfdir[@]|$(sysconfdir)|g"
-e "s|@sysconfdir[@]|$(sysconfdir)|g" \
-e "s|@GJS_CONSOLE[@]|$(GJS_CONSOLE)|g"
gnome-shell-jhbuild: gnome-shell-jhbuild.in gnome-shell-real Makefile
$(AM_V_GEN) sed $(generated_script_substitutions) $< > $@.tmp && mv $@.tmp $@ && chmod a+x $@
@ -66,6 +68,9 @@ gnome-shell-jhbuild: gnome-shell-jhbuild.in gnome-shell-real Makefile
gnome-shell-extension-tool: gnome-shell-extension-tool.in Makefile
$(AM_V_GEN) sed $(generated_script_substitutions) $< > $@.tmp && mv $@.tmp $@ && chmod a+x $@
gnome-shell-extension-prefs: gnome-shell-extension-prefs.in Makefile
$(AM_V_GEN) sed $(generated_script_substitutions) $< > $@.tmp && mv $@.tmp $@ && chmod a+x $@
CLEANFILES += gnome-shell $(bin_SCRIPTS)
include Makefile-st.am

View File

@ -0,0 +1,15 @@
#!/bin/bash
if [ -n "$GI_TYPELIB_PATH" ]; then
export GI_TYPELIB_PATH=@pkglibdir@
else
export GI_TYPELIB_PATH=@pkglibdir@:$GI_TYPELIB_PATH
fi
if [ -n "$LD_LIBRARY_PATH" ] ; then
export LD_LIBRARY_PATH=@pkglibdir@
else
export LD_LIBRARY_PATH=@pkglibdir@:$LD_LIBRARY_PATH
fi
@GJS_CONSOLE@ -I @pkgdatadir@/js -c "const Main = imports.extensionPrefs.main; Main.main(ARGV);" "$@"