diff options
author | Ted Gould <ted@gould.cx> | 2014-02-28 16:42:24 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-02-28 16:42:24 -0600 |
commit | 386d973866817541a904198865d49ec040d4755d (patch) | |
tree | ecba39a9a69166e62eb8da468d886e545c237013 | |
parent | dd42fb51e44d1a1233e6a803a997af7c20b8dc56 (diff) | |
download | ayatana-indicator-sound-386d973866817541a904198865d49ec040d4755d.tar.gz ayatana-indicator-sound-386d973866817541a904198865d49ec040d4755d.tar.bz2 ayatana-indicator-sound-386d973866817541a904198865d49ec040d4755d.zip |
Use the standard code for only showing ready players
-rw-r--r-- | src/media-player-list-greeter.vala | 12 | ||||
-rw-r--r-- | src/service.vala | 2 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/media-player-list-greeter.vala b/src/media-player-list-greeter.vala index 101211d..541fe3e 100644 --- a/src/media-player-list-greeter.vala +++ b/src/media-player-list-greeter.vala @@ -73,15 +73,7 @@ public class MediaPlayerListGreeter : MediaPlayerList { } if (selected_user != null && !players.contains(selected_user)) { - var newplayer = new MediaPlayerUser(selected_user); - newplayer.notify["is-running"].connect((obj, prop) => { - MediaPlayerUser? player = obj as MediaPlayerUser; - if (player == null) return; - if (player.is_running && player.id == this.selected_user) - this.player_added(player); - }); - - players.insert(selected_user, newplayer); + players.insert(selected_user, new MediaPlayerUser(selected_user)); } if (old_user != null) { @@ -92,7 +84,7 @@ public class MediaPlayerListGreeter : MediaPlayerList { if (selected_user != null) { var new_player = players.lookup(selected_user); - if (new_player.is_running) + if (new_player != null) player_added(new_player); } } diff --git a/src/service.vala b/src/service.vala index be0164d..f1a002f 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)); + this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_INACTIVE_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)); |