aboutsummaryrefslogtreecommitdiff
path: root/src/sound-menu.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-13 16:11:50 -0500
committerTed Gould <ted@gould.cx>2014-03-13 16:11:50 -0500
commitaa729767217df6e3058b439552ba166cef6c6053 (patch)
tree533f687d74056e3d86917458c94d5a1690d6b442 /src/sound-menu.vala
parent5857ca8b2f70630a298ac19aaf8a60668badbb53 (diff)
parentb51fa335562a99e80ec30daf89d0715e084d50d0 (diff)
downloadayatana-indicator-sound-aa729767217df6e3058b439552ba166cef6c6053.tar.gz
ayatana-indicator-sound-aa729767217df6e3058b439552ba166cef6c6053.tar.bz2
ayatana-indicator-sound-aa729767217df6e3058b439552ba166cef6c6053.zip
Catching up with trunk
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r--src/sound-menu.vala11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala
index 480e1cf..3fdfc36 100644
--- a/src/sound-menu.vala
+++ b/src/sound-menu.vala
@@ -22,7 +22,8 @@ class SoundMenu: Object
public enum DisplayFlags {
NONE = 0,
SHOW_MUTE = 1,
- HIDE_INACTIVE_PLAYERS = 2
+ HIDE_INACTIVE_PLAYERS = 2,
+ HIDE_PLAYERS = 4
}
public SoundMenu (string? settings_action, DisplayFlags flags) {
@@ -55,6 +56,7 @@ 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);
}
@@ -119,6 +121,7 @@ class SoundMenu: Object
bool mic_volume_shown;
bool settings_shown = false;
bool hide_inactive;
+ bool hide_players = false;
HashTable<MediaPlayer, ulong> notify_handlers;
/* returns the position in this.menu of the section that's associated with @player */
@@ -137,6 +140,9 @@ class SoundMenu: Object
}
void insert_player_section (MediaPlayer player) {
+ if (this.hide_players)
+ return;
+
var section = new Menu ();
Icon icon;
@@ -166,6 +172,9 @@ 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);