diff options
author | Nick Dedekind <nick.dedekind@canonical.com> | 2015-01-20 22:02:46 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-01-20 22:02:46 +0000 |
commit | b8619a7d550d64bf82ca00821e7d21d4f4646aab (patch) | |
tree | 4b9ef153546e3608b974b13e1794069e25cfa38a /src | |
parent | 12715e73912b581db49f93619ad23dc48aef3d93 (diff) | |
parent | 0c675658b0a897e08f475b33895d9a2202ce3dd3 (diff) | |
download | ayatana-indicator-sound-b8619a7d550d64bf82ca00821e7d21d4f4646aab.tar.gz ayatana-indicator-sound-b8619a7d550d64bf82ca00821e7d21d4f4646aab.tar.bz2 ayatana-indicator-sound-b8619a7d550d64bf82ca00821e7d21d4f4646aab.zip |
Update the panel icon when entering/exiting silent mode. Fixes: #1390067
Approved by: Ted Gould, PS Jenkins bot
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/service.vala b/src/service.vala index fd0c08d..3bb8b39 100644 --- a/src/service.vala +++ b/src/service.vala @@ -242,6 +242,8 @@ public class IndicatorSound.Service: Object { string icon; if (this.volume_control.mute) icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel"; + else if (this.accounts_service != null && this.accounts_service.silentMode) + icon = "audio-volume-muted-panel"; else if (volume <= 0.0) icon = "audio-volume-low-zero-panel"; else if (volume <= 0.3) @@ -254,6 +256,9 @@ public class IndicatorSound.Service: Object { string accessible_name; if (this.volume_control.mute) { accessible_name = _("Volume (muted)"); + } else if (this.accounts_service != null && this.accounts_service.silentMode) { + int volume_int = (int)(volume * 100); + accessible_name = "%s (%s %d%%)".printf (_("Volume"), _("silent"), volume_int); } else { int volume_int = (int)(volume * 100); accessible_name = "%s (%d%%)".printf (_("Volume"), volume_int); @@ -443,13 +448,13 @@ public class IndicatorSound.Service: Object { action.set_state (this.action_state_for_player (player)); 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 && export_to_accounts_service && accounts_service != null) { accounts_service.player = player; |