Merge lp:~ted/indicator-sound/backport-silent-icon into lp:indicator-sound/rtm-14.09

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 467
Merged at revision: 466
Proposed branch: lp:~ted/indicator-sound/backport-silent-icon
Merge into: lp:indicator-sound/rtm-14.09
Diff against target: 22 lines (+5/-0)
1 file modified
src/service.vala (+5/-0)
To merge this branch: bzr merge lp:~ted/indicator-sound/backport-silent-icon
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Review via email: mp+254917@code.launchpad.net

Commit message

When in silent mode show muted icon on the panel

Description of the change

Backport of silent icon change

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Works for me, tested on krillin r260

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/service.vala'
2--- src/service.vala 2014-10-21 18:59:42 +0000
3+++ src/service.vala 2015-04-01 13:55:17 +0000
4@@ -242,6 +242,8 @@
5 string icon;
6 if (this.volume_control.mute)
7 icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
8+ else if (this.accounts_service != null && this.accounts_service.silentMode)
9+ icon = "audio-volume-muted-panel";
10 else if (volume <= 0.0)
11 icon = "audio-volume-low-zero-panel";
12 else if (volume <= 0.3)
13@@ -254,6 +256,9 @@
14 string accessible_name;
15 if (this.volume_control.mute) {
16 accessible_name = _("Volume (muted)");
17+ } else if (this.accounts_service != null && this.accounts_service.silentMode) {
18+ int volume_int = (int)(volume * 100);
19+ accessible_name = "%s (%s %d%%)".printf (_("Volume"), _("silent"), volume_int);
20 } else {
21 int volume_int = (int)(volume * 100);
22 accessible_name = "%s (%d%%)".printf (_("Volume"), volume_int);

Subscribers

People subscribed via source and target branches