aboutsummaryrefslogtreecommitdiff
path: root/src/service.vala
diff options
context:
space:
mode:
authorcharles kerr <charlesk@canonical.com>2015-12-19 23:09:49 -0600
committercharles kerr <charlesk@canonical.com>2015-12-19 23:09:49 -0600
commita5d0e139cbd332419d2e82f45e8656462e39d029 (patch)
tree89ba5668385bb26e9ec193635f3bebd3884c1989 /src/service.vala
parentca18e99ee04c10fbc0baff2e836278f4f8817af0 (diff)
downloadayatana-indicator-sound-a5d0e139cbd332419d2e82f45e8656462e39d029.tar.gz
ayatana-indicator-sound-a5d0e139cbd332419d2e82f45e8656462e39d029.tar.bz2
ayatana-indicator-sound-a5d0e139cbd332419d2e82f45e8656462e39d029.zip
remove 'high_volume' property from volume-control
Diffstat (limited to 'src/service.vala')
-rw-r--r--src/service.vala17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/service.vala b/src/service.vala
index 51f5cb6..5f6b00e 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -617,7 +617,7 @@ public class IndicatorSound.Service: Object {
notify_server_caps_checked = true;
}
- var loud = volume_control.high_volume;
+ var loud = _volume_warning.high_volume;
bool ignore_warning_this_time = _volume_warning.ignore_high_volume;
var warn = loud
&& this.notify_server_supports_actions
@@ -821,12 +821,19 @@ public class IndicatorSound.Service: Object {
return mic_volume_action;
}
+ private Variant create_high_volume_action_state() {
+ return new Variant.boolean (_volume_warning.high_volume);
+ }
+ private void update_high_volume_action_state() {
+ high_volume_action.set_state(create_high_volume_action_state());
+ }
+
SimpleAction high_volume_action;
Action create_high_volume_action () {
- high_volume_action = new SimpleAction.stateful("high-volume", null, new Variant.boolean (this.volume_control.high_volume));
+ high_volume_action = new SimpleAction.stateful("high-volume", null, create_high_volume_action_state());
- this.volume_control.notify["high-volume"].connect( () => {
- high_volume_action.set_state(new Variant.boolean (this.volume_control.high_volume));
+ _volume_warning.notify["high-volume"].connect( () => {
+ update_high_volume_action_state();
update_notification();
});
@@ -982,7 +989,7 @@ public class IndicatorSound.Service: Object {
private bool clamp_to_high_idle() {
_clamp_to_high_timeout = 0;
- volume_control.clamp_to_high_volume();
+ _volume_warning.clamp_to_high_volume();
return false; // Source.REMOVE;
}
}