~xnox/indicator-sound/unbreak-ubiquity

« back to all changes in this revision

Viewing changes to src/service.vala

  • Committer: Tarmac
  • Author(s): Lars Uebernickel
  • Date: 2013-10-30 16:49:25 UTC
  • mfrom: (400.1.3 lp710824)
  • Revision ID: tarmac-20131030164925-ub0sf9ow91an1i83
Call Raise() when a media player is already running

Before, it was repeatedly launching the player. This patch also make the menu item insensitive if the player can't be raised. Fixes: https://bugs.launchpad.net/bugs/710824.

Approved by Charles Kerr, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
        bool update_player_actions () {
267
267
                foreach (var player in this.players) {
268
268
                        SimpleAction? action = this.actions.lookup_action (player.id) as SimpleAction;
269
 
                        if (action != null)
 
269
                        if (action != null) {
270
270
                                action.set_state (this.action_state_for_player (player));
 
271
                                action.set_enabled (player.can_raise);
 
272
                        }
271
273
                }
272
274
 
273
275
                this.player_action_update_id = 0;
290
292
                this.menus.@foreach ( (profile, menu) => menu.add_player (player));
291
293
 
292
294
                SimpleAction action = new SimpleAction.stateful (player.id, null, this.action_state_for_player (player));
293
 
                action.activate.connect ( () => { player.launch (); });
 
295
                action.activate.connect ( () => { player.activate (); });
294
296
                this.actions.add_action (action);
295
297
 
296
298
                var play_action = new SimpleAction.stateful ("play." + player.id, null, player.state);