diff options
author | Ted Gould <ted@gould.cx> | 2014-03-04 15:29:57 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-03-04 15:29:57 -0600 |
commit | 8c23ea52648f4555403acf42a096e83853ff7e08 (patch) | |
tree | 33d9ba44ba7e378488927aba0da853ce11bd45e5 /src | |
parent | 6a34818664b50a6b2e9157e6321ed663e9359b1d (diff) | |
download | ayatana-indicator-sound-8c23ea52648f4555403acf42a096e83853ff7e08.tar.gz ayatana-indicator-sound-8c23ea52648f4555403acf42a096e83853ff7e08.tar.bz2 ayatana-indicator-sound-8c23ea52648f4555403acf42a096e83853ff7e08.zip |
Make it so the desktop greeter doesn't have any players on it
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 2 | ||||
-rw-r--r-- | src/sound-menu.vala | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/service.vala b/src/service.vala index 075c6df..b4dae65 100644 --- a/src/service.vala +++ b/src/service.vala @@ -35,7 +35,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 | SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS)); + this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.DONT_SHOW_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 e4b8ad1..ebb7632 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -22,7 +22,8 @@ public class SoundMenu: Object public enum DisplayFlags { NONE = 0, SHOW_MUTE = 1, - HIDE_INACTIVE_PLAYERS = 2 + HIDE_INACTIVE_PLAYERS = 2, + DONT_SHOW_PLAYERS = 4 } public SoundMenu (string? settings_action, DisplayFlags flags) { @@ -31,6 +32,8 @@ public class SoundMenu: Object * it has a dynamic amount of player sections, one for each registered player. */ + this.no_players = ((flags & DisplayFlags.DONT_SHOW_PLAYERS) != 0); + this.volume_section = new Menu (); if ((flags & DisplayFlags.SHOW_MUTE) != 0) volume_section.append (_("Mute"), "indicator.mute"); @@ -87,6 +90,8 @@ public class SoundMenu: Object } public void add_player (MediaPlayer player) { + if (this.no_players) + return; if (this.notify_handlers.contains (player)) return; @@ -129,6 +134,7 @@ public class SoundMenu: Object bool mic_volume_shown; bool settings_shown = false; bool hide_inactive; + bool no_players; HashTable<MediaPlayer, ulong> notify_handlers; /* returns the position in this.menu of the section that's associated with @player */ |