diff options
-rw-r--r-- | src/CMakeLists.txt | 87 | ||||
-rw-r--r-- | src/service.vala | 6 |
2 files changed, 54 insertions, 39 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0fbc8a2..84f93e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,6 +7,10 @@ set(HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.h") set(SYMBOLS_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.def") set(VAPI_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.vapi") +if(URLDISPATCHER_FOUND) + add_definitions( -DHAS_URLDISPATCHER ) +endif() + if(EXISTS "/usr/share/glib-2.0/schemas/com.ubuntu.sound.gschema.xml") add_definitions( -DHAS_UBUNTU_SOUND_SCHEMA ) endif() @@ -57,23 +61,46 @@ vala_add(ayatana-indicator-sound-service DEPENDS notification ) -vala_add(ayatana-indicator-sound-service - service.vala - DEPENDS - sound-menu - volume-control - volume-control-pulse - notification - info-notification - volume-warning - options - options-gsettings - media-player - media-player-list - mpris2-interfaces - accounts-service-user - accounts-service-access -) +if(URLDISPATCHER_FOUND) + vala_add(ayatana-indicator-sound-service + service.vala + DEPENDS + sound-menu + volume-control + volume-control-pulse + notification + info-notification + volume-warning + options + options-gsettings + media-player + media-player-list + mpris2-interfaces + accounts-service-user + accounts-service-access + OPTIONS + --pkg=url-dispatcher + ) +else() + vala_add(ayatana-indicator-sound-service + service.vala + DEPENDS + sound-menu + volume-control + volume-control-pulse + notification + info-notification + volume-warning + options + options-gsettings + media-player + media-player-list + mpris2-interfaces + accounts-service-user + accounts-service-access + ) +endif() + vala_add(ayatana-indicator-sound-service options.vala DEPENDS @@ -136,25 +163,13 @@ vala_add(ayatana-indicator-sound-service media-player mpris2-interfaces ) -if(URLDISPATCHER_FOUND) - vala_add(ayatana-indicator-sound-service - media-player-user.vala - DEPENDS - media-player - accounts-service-sound-settings - greeter-broadcast - OPTIONS - --pkg=url-dispatcher - ) -else() - vala_add(ayatana-indicator-sound-service - media-player-user.vala - DEPENDS - media-player - accounts-service-sound-settings - greeter-broadcast - ) -endif() +vala_add(ayatana-indicator-sound-service + media-player-user.vala + DEPENDS + media-player + accounts-service-sound-settings + greeter-broadcast +) vala_add(ayatana-indicator-sound-service media-player-list.vala DEPENDS diff --git a/src/service.vala b/src/service.vala index 4e7d5e9..76f2574 100644 --- a/src/service.vala +++ b/src/service.vala @@ -191,7 +191,7 @@ public class IndicatorSound.Service: Object { { "root", null, null, "@a{sv} {}", null }, { "scroll", activate_scroll_action, "i", null, null }, { "desktop-settings", activate_desktop_settings, null, null, null }, -#if URLDISPATCHER_FOUND +#if HAS_URLDISPATCHER { "phone-settings", activate_phone_settings, null, null, null }, #endif { "indicator-shown", null, null, "@b false", null }, @@ -253,7 +253,7 @@ public class IndicatorSound.Service: Object { unowned string env = Environment.get_variable ("DESKTOP_SESSION"); string cmd; -#if URLDISPATCHER_FOUND +#if HAS_URLDISPATCHER if (Environment.get_variable ("MIR_SOCKET") != null) { UrlDispatch.send ("settings:///system/sound"); @@ -277,7 +277,7 @@ public class IndicatorSound.Service: Object { } } -#if URLDISPATCHER_FOUND +#if HAS_URLDISPATCHER void activate_phone_settings (SimpleAction action, Variant? param) { UrlDispatch.send ("settings:///system/sound"); } |