diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-03-13 15:33:03 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-03-13 15:33:03 +0000 |
commit | e3bdb0df9321d239aa25da6b4aa461e1cb41c9c0 (patch) | |
tree | db9d004b8e4fa909d96c5cdd7242ffcaa0fc02fe | |
parent | e2fdd75b6e7fd1c8572dd10356272668b99d33dd (diff) | |
parent | ee91c5f1f89d771e9187f21bbf490e45f0c93f1e (diff) | |
download | ayatana-indicator-sound-e3bdb0df9321d239aa25da6b4aa461e1cb41c9c0.tar.gz ayatana-indicator-sound-e3bdb0df9321d239aa25da6b4aa461e1cb41c9c0.tar.bz2 ayatana-indicator-sound-e3bdb0df9321d239aa25da6b4aa461e1cb41c9c0.zip |
Don't show player sections on the greeter and lock screen Fixes: 1280378
-rw-r--r-- | src/service.vala | 2 | ||||
-rw-r--r-- | src/sound-menu.vala | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/service.vala b/src/service.vala index 2b21275..970867f 100644 --- a/src/service.vala +++ b/src/service.vala @@ -38,7 +38,7 @@ public class IndicatorSound.Service: Object { this.actions.add_action (this.create_mic_volume_action ()); this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal); - this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE)); + this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_PLAYERS)); this.menus.insert ("desktop", new SoundMenu ("indicator.desktop-settings", SoundMenu.DisplayFlags.SHOW_MUTE)); this.menus.insert ("phone", new SoundMenu ("indicator.phone-settings", SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS)); 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); |