diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-10-22 23:07:30 +0000 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-10-22 23:07:30 +0000 |
commit | 13525d7b0451f0a9ca7b73e83e2f374fbfb7c1bc (patch) | |
tree | 91d4d03a4980df9a072a371578c7c1993742e838 /src/service.vala | |
parent | 007ee3b3b425a31e31260c62baf789407bc8b54a (diff) | |
download | ayatana-indicator-sound-13525d7b0451f0a9ca7b73e83e2f374fbfb7c1bc.tar.gz ayatana-indicator-sound-13525d7b0451f0a9ca7b73e83e2f374fbfb7c1bc.tar.bz2 ayatana-indicator-sound-13525d7b0451f0a9ca7b73e83e2f374fbfb7c1bc.zip |
Fork from Ubuntu's indicator-sound.
Diffstat (limited to 'src/service.vala')
-rw-r--r-- | src/service.vala | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/service.vala b/src/service.vala index 74c3fc5..4e7d5e9 100644 --- a/src/service.vala +++ b/src/service.vala @@ -42,7 +42,7 @@ public class IndicatorSound.Service: Object { this.update_notification(); }); - this.settings = new Settings ("com.canonical.indicator.sound"); + this.settings = new Settings ("org.ayatana.indicator.sound"); this.settings.bind ("visible", this, "visible", SettingsBindFlags.GET); this.notify["visible"].connect ( () => this.update_root_icon () ); @@ -145,12 +145,12 @@ public class IndicatorSound.Service: Object { /* Everything is built, let's put it on the bus */ try { - export_actions = bus.export_action_group ("/com/canonical/indicator/sound", this.actions); + export_actions = bus.export_action_group ("/org/ayatana/indicator/sound", this.actions); } catch (Error e) { critical ("%s", e.message); } - this.menus.@foreach ( (profile, menu) => menu.export (bus, @"/com/canonical/indicator/sound/$profile")); + this.menus.@foreach ( (profile, menu) => menu.export (bus, @"/org/ayatana/indicator/sound/$profile")); } ~Service() { @@ -191,7 +191,9 @@ 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 { "phone-settings", activate_phone_settings, null, null, null }, +#endif { "indicator-shown", null, null, "@b false", null }, }; @@ -251,13 +253,15 @@ public class IndicatorSound.Service: Object { unowned string env = Environment.get_variable ("DESKTOP_SESSION"); string cmd; +#if URLDISPATCHER_FOUND if (Environment.get_variable ("MIR_SOCKET") != null) { UrlDispatch.send ("settings:///system/sound"); return; } +#endif - if (env == "xubuntu" || env == "ubuntustudio") + if (env == "xubuntu" || env == "xfce" || env == "ubuntustudio") cmd = "pavucontrol"; else if (env == "mate") cmd = "mate-volume-control"; @@ -273,9 +277,11 @@ public class IndicatorSound.Service: Object { } } +#if URLDISPATCHER_FOUND void activate_phone_settings (SimpleAction action, Variant? param) { UrlDispatch.send ("settings:///system/sound"); } +#endif /* Returns a serialized version of @icon_name suited for the panel */ static Variant serialize_themed_icon (string icon_name) |