diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-09-26 04:03:14 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-09-26 04:03:14 +0000 |
commit | e73201f71f5cd82bc31ea4c921bf8b093136de55 (patch) | |
tree | f14cb48139945e6ae77f167b98f69520930399e9 | |
parent | ed998103a6375a780dab4ab273f697c8fcac44d2 (diff) | |
parent | 2327b6d0d867dd5f9e9f014d1ec7cd6a29e427dc (diff) | |
download | ayatana-indicator-sound-e73201f71f5cd82bc31ea4c921bf8b093136de55.tar.gz ayatana-indicator-sound-e73201f71f5cd82bc31ea4c921bf8b093136de55.tar.bz2 ayatana-indicator-sound-e73201f71f5cd82bc31ea4c921bf8b093136de55.zip |
Use url-dispatcher instead of invoking system-settings directly. Fixes: https://bugs.launchpad.net/bugs/1230819.
Approved by Ted Gould, PS Jenkins bot.
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/service.vala | 6 | ||||
-rw-r--r-- | vapi/url-dispatcher.vapi | 9 |
5 files changed, 15 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 98dccef..6ab96c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,11 +25,13 @@ set(SOURCE_BINARY_DIR "${CMAKE_BINARY_DIR}/src") set(PULSE_AUDIO_REQUIRED_VERSION 0.9.19) set(GIO_2_0_REQUIRED_VERSION 2.25.13) +set(URL_DISPATCHER_1_REQUIRED_VERSION 1) pkg_check_modules( PULSEAUDIO REQUIRED libpulse-mainloop-glib>=${PULSE_AUDIO_REQUIRED_VERSION} - gio-unix-2.0 + gio-unix-2.0>=${GIO_2_0_REQUIRED_VERSION} + url-dispatcher-1>=${URL_DISPATCHER_1_REQUIRED_VERSION} ) include_directories(${PULSEAUDIO_INCLUDE_DIRS}) diff --git a/debian/control b/debian/control index c639fcb..0d1da18 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Build-Depends: debhelper (>= 9.0), autotools-dev, valac (>= 0.18), libglib2.0-dev (>= 2.22.3), + liburl-dispatcher1-dev, libpulse-dev (>= 0.9.18), libpulse-mainloop-glib0 (>= 0.9.18), libgee-dev, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a28147d..a61fb72 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,6 +20,7 @@ vala_init(indicator-sound-service --vapidir=${CMAKE_SOURCE_DIR}/vapi/ --vapidir=. --target-glib=2.36 + --pkg=url-dispatcher --pkg=bus-watcher ) diff --git a/src/service.vala b/src/service.vala index f43a1a1..c7d4809 100644 --- a/src/service.vala +++ b/src/service.vala @@ -108,11 +108,7 @@ public class IndicatorSound.Service { } void activate_phone_settings (SimpleAction action, Variant? param) { - try { - Process.spawn_command_line_async ("system-settings sound"); - } catch (Error e) { - warning ("unable to launch sound settings: %s", e.message); - } + UrlDispatch.send ("settings://system/sound"); } /* Returns a serialized version of @icon_name suited for the panel */ diff --git a/vapi/url-dispatcher.vapi b/vapi/url-dispatcher.vapi new file mode 100644 index 0000000..88f7740 --- /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); +} |