From 2b344df118fe82ff89bd878b86e1827d7ff85528 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Mon, 3 Mar 2014 10:32:53 +0100 Subject: Honor com.canonical.indicator.sound visible --- src/service.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/service.vala') diff --git a/src/service.vala b/src/service.vala index 22e5f1c..2b21275 100644 --- a/src/service.vala +++ b/src/service.vala @@ -22,6 +22,9 @@ public class IndicatorSound.Service: Object { this.settings = new Settings ("com.canonical.indicator.sound"); this.sharedsettings = new Settings ("com.ubuntu.sound"); + this.settings.bind ("visible", this, "visible", SettingsBindFlags.GET); + this.notify["visible"].connect ( () => this.update_root_icon () ); + this.volume_control = new VolumeControl (); this.players = new MediaPlayerList (); @@ -74,6 +77,8 @@ public class IndicatorSound.Service: Object { return 0; } + public bool visible { get; set; } + public bool allow_amplified_volume { get { return this.max_volume > 1.0; @@ -204,7 +209,7 @@ public class IndicatorSound.Service: Object { builder.add ("{sv}", "title", new Variant.string (_("Sound"))); builder.add ("{sv}", "accessible-desc", new Variant.string (accessible_name)); builder.add ("{sv}", "icon", serialize_themed_icon (icon)); - builder.add ("{sv}", "visible", new Variant.boolean (true)); + builder.add ("{sv}", "visible", new Variant.boolean (this.visible)); root_action.set_state (builder.end()); } -- cgit v1.2.3 From ee91c5f1f89d771e9187f21bbf490e45f0c93f1e Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Wed, 12 Mar 2014 14:26:10 +0100 Subject: Don't show player sections on the greeter and lock screen --- src/service.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/service.vala') diff --git a/src/service.vala b/src/service.vala index 2b21275..970867f 100644 --- a/src/service.vala +++ b/src/service.vala @@ -38,7 +38,7 @@ public class IndicatorSound.Service: Object { this.actions.add_action (this.create_mic_volume_action ()); this.menus = new HashTable (str_hash, str_equal); - this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE)); + this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_PLAYERS)); this.menus.insert ("desktop", new SoundMenu ("indicator.desktop-settings", SoundMenu.DisplayFlags.SHOW_MUTE)); this.menus.insert ("phone", new SoundMenu ("indicator.phone-settings", SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS)); -- cgit v1.2.3