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/sound-menu.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/sound-menu.vala')
-rw-r--r-- | src/sound-menu.vala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala index ebb7632..e37c4e9 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -23,7 +23,7 @@ public class SoundMenu: Object NONE = 0, SHOW_MUTE = 1, HIDE_INACTIVE_PLAYERS = 2, - DONT_SHOW_PLAYERS = 4 + HIDE_PLAYERS = 4 } public SoundMenu (string? settings_action, DisplayFlags flags) { @@ -32,8 +32,6 @@ public class SoundMenu: Object * it has a dynamic amount of player sections, one for each registered player. */ - this.no_players = ((flags & DisplayFlags.DONT_SHOW_PLAYERS) != 0); - this.volume_section = new Menu (); if ((flags & DisplayFlags.SHOW_MUTE) != 0) volume_section.append (_("Mute"), "indicator.mute"); @@ -58,6 +56,7 @@ public class SoundMenu: Object this.root = new Menu (); root.append_item (root_item); + this.hide_players = (flags & DisplayFlags.HIDE_PLAYERS) != 0; this.hide_inactive = (flags & DisplayFlags.HIDE_INACTIVE_PLAYERS) != 0; this.notify_handlers = new HashTable<MediaPlayer, ulong> (direct_hash, direct_equal); } @@ -90,8 +89,6 @@ public class SoundMenu: Object } public void add_player (MediaPlayer player) { - if (this.no_players) - return; if (this.notify_handlers.contains (player)) return; @@ -134,7 +131,7 @@ public class SoundMenu: Object bool mic_volume_shown; bool settings_shown = false; bool hide_inactive; - bool no_players; + bool hide_players = false; HashTable<MediaPlayer, ulong> notify_handlers; /* returns the position in this.menu of the section that's associated with @player */ @@ -157,6 +154,9 @@ public class SoundMenu: Object } void insert_player_section (MediaPlayer player) { + if (this.hide_players) + return; + var section = new Menu (); Icon icon; @@ -188,6 +188,9 @@ public class SoundMenu: Object } void remove_player_section (MediaPlayer player) { + if (this.hide_players) + return; + int index = this.find_player_section (player); if (index >= 0) this.menu.remove (index); |