From 760dc3b93f9fd5709501f1026dba2533ec877680 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 25 Sep 2013 15:06:30 -0500 Subject: use url-dispatcher instead of invoking system-settings directly. --- configure.ac | 5 ++++- debian/control | 1 + src/Makefile.am | 1 + src/phone.vala | 2 +- vapi/url-dispatcher.vapi | 9 +++++++++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 vapi/url-dispatcher.vapi diff --git a/configure.ac b/configure.ac index 6eba857..00f2d09 100644 --- a/configure.ac +++ b/configure.ac @@ -16,9 +16,12 @@ dnl ########################################################################### GLIB_REQUIRED_VERSION=2.36 GIO_REQUIRED_VERSION=2.36 +URL_DISPATCHER_1_REQUIRED_VERSION=1 PKG_CHECK_MODULES(SERVICE_DEPS, [glib-2.0 >= $GLIB_REQUIRED_VERSION - gio-unix-2.0 >= $GIO_REQUIRED_VERSION]) + gio-unix-2.0 >= $GIO_REQUIRED_VERSION + url-dispatcher-1 >= $URL_DISPATCHER_1_REQUIRED_VERSION]) + dnl ############################## dnl # Custom Junk diff --git a/debian/control b/debian/control index baffbf4..2bbb19f 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Build-Depends: debhelper (>= 9.0), dh-translations, gnome-common, libglib2.0-dev, + liburl-dispatcher1-dev, valac (>=0.18), Standards-Version: 3.9.4 Homepage: https://launchpad.net/indicator-bluetooth diff --git a/src/Makefile.am b/src/Makefile.am index 2fc41bb..8311e20 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,6 +18,7 @@ indicator_bluetooth_service_VALAFLAGS = \ --vapidir=./ \ --pkg config \ --pkg rfkill \ + --pkg url-dispatcher \ --pkg posix \ --pkg glib-2.0 \ --pkg gio-2.0 diff --git a/src/phone.vala b/src/phone.vala index e90cd66..f36d175 100644 --- a/src/phone.vala +++ b/src/phone.vala @@ -61,7 +61,7 @@ class Phone: Profile void show_settings (string panel) { - spawn_command_line_async ("system-settings " + panel); + UrlDispatch.send ("settings://system/bluetooth"); } Action create_settings_action () diff --git a/vapi/url-dispatcher.vapi b/vapi/url-dispatcher.vapi new file mode 100644 index 0000000..ed751ec --- /dev/null +++ b/vapi/url-dispatcher.vapi @@ -0,0 +1,9 @@ +[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "liburl-dispatcher-1/url-dispatcher.h")] + +namespace UrlDispatch +{ + public delegate void DispatchCallback (); + + [CCode (cname = "url_dispatch_send")] + public static void send (string url, DispatchCallback? func = null); +} -- cgit v1.2.3