diff options
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r-- | src/sound-menu.vala | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala index e37c4e9..f5e2627 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -23,7 +23,8 @@ public class SoundMenu: Object NONE = 0, SHOW_MUTE = 1, HIDE_INACTIVE_PLAYERS = 2, - HIDE_PLAYERS = 4 + HIDE_PLAYERS = 4, + GREETER_PLAYERS = 8 } public SoundMenu (string? settings_action, DisplayFlags flags) { @@ -59,6 +60,8 @@ public class SoundMenu: Object 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); + + this.greeter_players = (flags & DisplayFlags.GREETER_PLAYERS) != 0; } public void export (DBusConnection connection, string object_path) { @@ -133,6 +136,7 @@ public class SoundMenu: Object bool hide_inactive; bool hide_players = false; HashTable<MediaPlayer, ulong> notify_handlers; + bool greeter_players = false; /* returns the position in this.menu of the section that's associated with @player */ int find_player_section (MediaPlayer player) { @@ -166,7 +170,11 @@ public class SoundMenu: Object if (icon == null) icon = new ThemedIcon.with_default_fallbacks ("application-default-icon"); - var player_item = new MenuItem (player.name, "indicator." + player.id); + var base_action = "indicator." + player.id; + if (this.greeter_players) + base_action += ".greeter"; + + var player_item = new MenuItem (player.name, base_action); player_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.media-player"); if (icon != null) player_item.set_attribute_value ("icon", icon.serialize ()); |