diff options
author | Ted Gould <ted@gould.cx> | 2014-09-23 10:19:55 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-09-23 10:19:55 -0500 |
commit | 2776b58639225be50bdc3c7961f60b1fd571df29 (patch) | |
tree | e546514268e7cffb03d007f9185c190bdd13d36c /src | |
parent | 68207ed12f5df6eb81b7d3565aed7acc15f82f54 (diff) | |
download | ayatana-indicator-sound-2776b58639225be50bdc3c7961f60b1fd571df29.tar.gz ayatana-indicator-sound-2776b58639225be50bdc3c7961f60b1fd571df29.tar.bz2 ayatana-indicator-sound-2776b58639225be50bdc3c7961f60b1fd571df29.zip |
Adding in an additional action that is the greeter state
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala index ae1840a..d715ff5 100644 --- a/src/service.vala +++ b/src/service.vala @@ -74,6 +74,10 @@ public class IndicatorSound.Service: Object { } } + bool greeter_show_track () { + return false; + } + void build_accountsservice () { clear_acts_player(); this.accounts_service = null; @@ -402,6 +406,12 @@ public class IndicatorSound.Service: Object { action.set_enabled (player.can_raise); } + SimpleAction? greeter_action = this.actions.lookup_action (player.id + ".greeter") as SimpleAction; + if (greeter_action != null) { + greeter_action.set_state (this.action_state_for_player (player, greeter_show_track())); + greeter_action.set_enabled (player.can_raise); + } + /* If we're playing then put that data in accounts service */ if (player.is_running && accounts_service != null) { accounts_service.player = player; @@ -446,6 +456,11 @@ public class IndicatorSound.Service: Object { action.activate.connect ( () => { player.activate (); }); this.actions.add_action (action); + SimpleAction greeter_action = new SimpleAction.stateful (player.id + ".greeter", null, this.action_state_for_player (player, greeter_show_track())); + greeter_action.set_enabled (player.can_raise); + greeter_action.activate.connect ( () => { player.activate (); }); + this.actions.add_action (greeter_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); |