From 4eb240c40ac3b9a83d2af9d39264da0cb4e39aab Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 10 Nov 2014 12:41:52 -0600 Subject: Set the internal variable and not the property --- src/accounts-service-user.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala index ec52730..21e8431 100644 --- a/src/accounts-service-user.vala +++ b/src/accounts-service-user.vala @@ -211,7 +211,8 @@ public class AccountsServiceUser : Object { } }); - this.silentMode = this.syssoundproxy.silent_mode; + this._silentMode = this.syssoundproxy.silent_mode; + this.notify_property("silentMode"); } catch (Error e) { this.syssoundproxy = null; warning("Unable to get proxy to system sound settings: %s", e.message); -- cgit v1.2.3 From 0c675658b0a897e08f475b33895d9a2202ce3dd3 Mon Sep 17 00:00:00 2001 From: Nick Dedekind Date: Wed, 19 Nov 2014 17:21:11 +0000 Subject: silent mode updates icon --- src/service.vala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3 From bc82d53ffb97ed3bed87e65f4dc3dabea99cd9b3 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sun, 23 Nov 2014 15:03:22 +0300 Subject: Fix crash when active_port is null. --- src/volume-control.vala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/volume-control.vala b/src/volume-control.vala index 6f22dc5..6201935 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -185,9 +185,10 @@ public class VolumeControl : Object * checking for the port name. On touch (with the pulseaudio droid element) * the headset/headphone port is called 'output-headset' and 'output-headphone'. * On the desktop this is usually called 'analog-output-headphones' */ - if (i.active_port.name == "output-wired_headset" || + if (i.active_port != null && ( + i.active_port.name == "output-wired_headset" || i.active_port.name == "output-wired_headphone" || - i.active_port.name == "analog-output-headphones") { + i.active_port.name == "analog-output-headphones")) { _active_port_headphone = true; } else { _active_port_headphone = false; -- cgit v1.2.3 From 2862112c262c8d4d211f378388f3286b5f0642a6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 9 Dec 2014 09:55:37 -0600 Subject: Make sure to set the internal variable too --- src/accounts-service-user.vala | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala index 21e8431..e8db7c4 100644 --- a/src/accounts-service-user.vala +++ b/src/accounts-service-user.vala @@ -35,6 +35,7 @@ public class AccountsServiceUser : Object { return _silentMode; } set { + _silentMode = value; if (syssoundproxy != null) syssoundproxy.silent_mode = value; } -- cgit v1.2.3