aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-01-29 09:26:31 -0600
committerTed Gould <ted@gould.cx>2015-01-29 09:26:31 -0600
commit7774969eac0d06926060e39368c4f5906446421d (patch)
tree9b1bbd3a31b7125782824a8b33bf932b59baab18 /src
parent90c987b1683219a68f54c70fe4d58e4482df7df3 (diff)
parent93ff215251fdc43692d3800b7e9d4b091beacd75 (diff)
downloadayatana-indicator-sound-7774969eac0d06926060e39368c4f5906446421d.tar.gz
ayatana-indicator-sound-7774969eac0d06926060e39368c4f5906446421d.tar.bz2
ayatana-indicator-sound-7774969eac0d06926060e39368c4f5906446421d.zip
Merge trunk
Diffstat (limited to 'src')
-rw-r--r--src/accounts-service-user.vala4
-rw-r--r--src/service.vala9
2 files changed, 10 insertions, 3 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala
index ec52730..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;
}
@@ -211,7 +212,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);
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;