aboutsummaryrefslogtreecommitdiff
path: root/src/service.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-04 15:40:28 -0600
committerTed Gould <ted@gould.cx>2014-03-04 15:40:28 -0600
commite6fab6c96fe0e9414f214d47c8b762c8a435cc51 (patch)
tree25569bade0f178b7ce44205acb2e5c7ec82c8994 /src/service.vala
parentf06b9ff784c15e9e1c0ad0840299ed70b5616a74 (diff)
parente9f0b68ab8b9afec9466011b8a8bae3b202b4bf9 (diff)
downloadayatana-indicator-sound-e6fab6c96fe0e9414f214d47c8b762c8a435cc51.tar.gz
ayatana-indicator-sound-e6fab6c96fe0e9414f214d47c8b762c8a435cc51.tar.bz2
ayatana-indicator-sound-e6fab6c96fe0e9414f214d47c8b762c8a435cc51.zip
Update to the latest player
Diffstat (limited to 'src/service.vala')
-rw-r--r--src/service.vala11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/service.vala b/src/service.vala
index be0164d..ca00caa 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -35,7 +35,8 @@ 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.DONT_SHOW_PLAYERS));
+ this.menus.insert ("phone_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));
@@ -366,15 +367,15 @@ public class IndicatorSound.Service: Object {
this.menus.@foreach ( (profile, menu) => menu.add_player (player));
SimpleAction action = new SimpleAction.stateful (player.id, null, this.action_state_for_player (player));
+ action.set_enabled (player.can_raise);
action.activate.connect ( () => { player.activate (); });
this.actions.add_action (action);
var play_action = new SimpleAction.stateful ("play." + player.id, null, player.state);
play_action.activate.connect ( () => player.play_pause () );
this.actions.add_action (play_action);
- player.notify.connect ( (object, pspec) => {
- if (pspec.name == "state")
- play_action.set_state (player.state);
+ player.notify["state"].connect ( (object, pspec) => {
+ play_action.set_state (player.state);
});
var next_action = new SimpleAction ("next." + player.id, null);
@@ -401,6 +402,8 @@ public class IndicatorSound.Service: Object {
this.actions.remove_action ("previous." + player.id);
this.actions.remove_action ("play-playlist." + player.id);
+ player.notify.disconnect (this.eventually_update_player_actions);
+
this.menus.@foreach ( (profile, menu) => menu.remove_player (player));
this.update_preferred_players ();