aboutsummaryrefslogtreecommitdiff
path: root/src/sound-menu.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-09-23 10:31:16 -0500
committerTed Gould <ted@gould.cx>2014-09-23 10:31:16 -0500
commite87459657220f1cdc46e38c0b39f498ce6beac40 (patch)
treea1dd81f6a963f5728d9f2b750c20073e34d77fed /src/sound-menu.vala
parent2776b58639225be50bdc3c7961f60b1fd571df29 (diff)
downloadayatana-indicator-sound-e87459657220f1cdc46e38c0b39f498ce6beac40.tar.gz
ayatana-indicator-sound-e87459657220f1cdc46e38c0b39f498ce6beac40.tar.bz2
ayatana-indicator-sound-e87459657220f1cdc46e38c0b39f498ce6beac40.zip
Adding support for selecting the base action to be a different player action
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r--src/sound-menu.vala12
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 ());