diff options
author | Ted Gould <ted@gould.cx> | 2014-03-13 16:14:58 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-03-13 16:14:58 -0500 |
commit | 67d2b532117cc579d9589d228053042de68100b6 (patch) | |
tree | d32d47fb79dbe3ca5e17c40388556e352d31c6aa /src/service.vala | |
parent | f37625ab59b1d41c7c9986f05ee402790e3be039 (diff) | |
parent | 9d8c46ee62ab13bf21e2b03d0b42193b20e9dafd (diff) | |
download | ayatana-indicator-sound-67d2b532117cc579d9589d228053042de68100b6.tar.gz ayatana-indicator-sound-67d2b532117cc579d9589d228053042de68100b6.tar.bz2 ayatana-indicator-sound-67d2b532117cc579d9589d228053042de68100b6.zip |
Merge trunk
Diffstat (limited to 'src/service.vala')
-rw-r--r-- | src/service.vala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/service.vala b/src/service.vala index ca00caa..793a91a 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 = playerlist; @@ -35,7 +38,7 @@ public class IndicatorSound.Service: Object { this.actions.add_action (this.create_mic_volume_action ()); this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal); - this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.DONT_SHOW_PLAYERS)); + this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_PLAYERS)); this.menus.insert ("phone_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_INACTIVE_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)); @@ -79,6 +82,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; @@ -210,7 +215,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()); } |