diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-09-25 15:06:30 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-09-25 15:06:30 -0500 |
commit | 760dc3b93f9fd5709501f1026dba2533ec877680 (patch) | |
tree | 29b61c137ca916c59b119469cfd24525e618ac47 | |
parent | acbd029f060ed529c9197990502ac035f8d8810d (diff) | |
download | ayatana-indicator-bluetooth-760dc3b93f9fd5709501f1026dba2533ec877680.tar.gz ayatana-indicator-bluetooth-760dc3b93f9fd5709501f1026dba2533ec877680.tar.bz2 ayatana-indicator-bluetooth-760dc3b93f9fd5709501f1026dba2533ec877680.zip |
use url-dispatcher instead of invoking system-settings directly.
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/phone.vala | 2 | ||||
-rw-r--r-- | vapi/url-dispatcher.vapi | 9 |
5 files changed, 16 insertions, 2 deletions
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); +} |