diff options
author | Ted Gould <ted@gould.cx> | 2014-10-16 11:11:21 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-10-16 11:11:21 -0500 |
commit | 1c9b9820bff54e5b99e8a0833eab1093bc070ae7 (patch) | |
tree | 303f446dcf3303e17361a84dbeef7a1a30ebe219 /src/sound-menu.vala | |
parent | 16a72ae6f4c18c621e16e259bc9122cdaf39eb6b (diff) | |
parent | 4a8ee52ea141103bcb632069755af77ad510de9e (diff) | |
download | ayatana-indicator-sound-1c9b9820bff54e5b99e8a0833eab1093bc070ae7.tar.gz ayatana-indicator-sound-1c9b9820bff54e5b99e8a0833eab1093bc070ae7.tar.bz2 ayatana-indicator-sound-1c9b9820bff54e5b99e8a0833eab1093bc070ae7.zip |
Align with trunk to prepare for landing there
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r-- | src/sound-menu.vala | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala index b93c513..a9efd74 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -23,7 +23,9 @@ public class SoundMenu: Object NONE = 0, SHOW_MUTE = 1, HIDE_INACTIVE_PLAYERS = 2, - HIDE_PLAYERS = 4 + HIDE_PLAYERS = 4, + GREETER_PLAYERS = 8, + SHOW_SILENT_MODE = 16 } public SoundMenu (string? settings_action, DisplayFlags flags) { @@ -33,8 +35,15 @@ public class SoundMenu: Object */ this.volume_section = new Menu (); + if ((flags & DisplayFlags.SHOW_MUTE) != 0) volume_section.append (_("Mute"), "indicator.mute"); + if ((flags & DisplayFlags.SHOW_SILENT_MODE) != 0) { + var item = new MenuItem(_("Silent Mode"), "indicator.silent-mode"); + item.set_attribute("x-canonical-type", "s", "com.canonical.indicator.switch"); + volume_section.append_item(item); + } + volume_section.append_item (this.create_slider_menu_item (_("Volume"), "indicator.volume(0)", 0.0, 1.0, 0.01, "audio-volume-low-zero-panel", "audio-volume-high-panel")); @@ -59,6 +68,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) { @@ -172,6 +183,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) { @@ -205,7 +217,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 ()); |