From e87459657220f1cdc46e38c0b39f498ce6beac40 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Sep 2014 10:31:16 -0500 Subject: Adding support for selecting the base action to be a different player action --- src/sound-menu.vala | 12 ++++++++++-- 1 file 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 (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 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 ()); -- cgit v1.2.3