summaryrefslogtreecommitdiff
path: root/shell/Makefile.am
diff options
context:
space:
mode:
authorEmanuele Aina <emanuele.aina@collabora.com>2013-03-01 11:45:04 +0100
committerEmanuele Aina <emanuele.aina@collabora.com>2013-04-03 18:09:15 +0200
commitab0576f1f00172c4edc71595b0c2c9dd9ce94068 (patch)
treee736974fe6bd643d93ccd3163d05ae1961420b62 /shell/Makefile.am
parent31a8a99440cce715b2e32ca71a6cbf650eab012a (diff)
downloadgnome-control-center-ab0576f1f00172c4edc71595b0c2c9dd9ce94068.tar.gz
shell: Expose panel launching with DBus-activation
Turn Control Center in a DBus-activable service and export a 'launch-panel' GAction which accepts a tuple containing the id of the desired panel and its parameters as a GVariant array. The snippet below show how the custom shortcuts section of the keyboard panel can be invoked by a external programs through DBus: GVariantBuilder *flags = g_variant_builder_new (G_VARIANT_TYPE_VARDICT); GVariantBuilder *params = g_variant_builder_new (G_VARIANT_TYPE ("av")); g_variant_builder_add (params, "v", g_variant_builder_end (flags)); g_variant_builder_add (params, "v", g_variant_new_string ("shortcuts")); g_variant_builder_add (params, "v", g_variant_new_string ("custom")); GVariant *v = g_variant_new ("(s@av)", "keyboard", g_variant_builder_end (params)); GApplication *gnomecc = g_application_new (id, G_APPLICATION_IS_LAUNCHER); if (!g_application_register (gnomecc, NULL, &error)) g_error ("Failed to register launcher for %s: %s", id, error->message); g_action_group_activate_action (G_ACTION_GROUP (gnomecc), "launch-panel", v); https://bugzilla.gnome.org/show_bug.cgi?id=696054
Diffstat (limited to 'shell/Makefile.am')
-rw-r--r--shell/Makefile.am10
1 files changed, 9 insertions, 1 deletions
diff --git a/shell/Makefile.am b/shell/Makefile.am
index f9f9070de..68b70e91a 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -86,6 +86,13 @@ endif
AM_CPPFLAGS = -DGNOMELOCALEDIR="\"$(datadir)/locale\""
+# Dbus service file
+servicefiledir = $(datadir)/dbus-1/services
+servicefile_in_files = org.gnome.ControlCenter.service.in
+servicefile_DATA = $(servicefile_in_files:.service.in=.service)
+$(servicefile_DATA): $(servicefile_in_files) Makefile
+ $(AM_V_GEN) sed -e 's|[@]bindir[@]|$(bindir)|' $< > $@
+
sysdir = $(datadir)/applications
sys_in_files = gnome-control-center.desktop.in
sys_DATA = $(sys_in_files:.desktop.in=.desktop)
@@ -99,10 +106,11 @@ completions/gnome-control-center: completions/gnome-control-center.in list-panel
EXTRA_DIST = \
gnome-control-center.desktop.in.in \
+ $(servicefile_in_files) \
$(completion_in_files) \
list-panel.sh
-CLEANFILES = $(BUILT_SOURCES) $(completion_DATA)
+CLEANFILES = $(BUILT_SOURCES) $(completion_DATA) $(servicefile_DATA)
DISTCLEANFILES = gnome-control-center.desktop gnome-control-center.desktop.in
noinst_PROGRAMS = test-hostname