diff options
author | charles kerr <charlesk@canonical.com> | 2015-12-21 12:25:37 -0600 |
---|---|---|
committer | charles kerr <charlesk@canonical.com> | 2015-12-21 12:25:37 -0600 |
commit | 1d3308fdabcb19dbef2d0d07e11a1f629e7d6eff (patch) | |
tree | 70c785b174d0e30c10bf370acf3822c5fe6e8966 | |
parent | de4493a64a59e6905c6f3f02902783daa86c051e (diff) | |
download | ayatana-indicator-sound-1d3308fdabcb19dbef2d0d07e11a1f629e7d6eff.tar.gz ayatana-indicator-sound-1d3308fdabcb19dbef2d0d07e11a1f629e7d6eff.tar.bz2 ayatana-indicator-sound-1d3308fdabcb19dbef2d0d07e11a1f629e7d6eff.zip |
fix property binding warning
-rw-r--r-- | src/service.vala | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/service.vala b/src/service.vala index fbeb886..de26af4 100644 --- a/src/service.vala +++ b/src/service.vala @@ -50,22 +50,27 @@ public class IndicatorSound.Service: Object { this.volume_control = volume; this.volume_control.notify["active-stream"].connect(() => { - _volume_warning.multimedia_active = - VolumeControl.Stream.MULTIMEDIA == volume_control.active_stream; + var b = VolumeControl.Stream.MULTIMEDIA == volume_control.active_stream; + message("updating _volume_warning.multimedia_active to %d", (int)b); + _volume_warning.multimedia_active = b; }); this.volume_control.active_output_changed.connect(() => { + bool headphones; switch(volume_control.active_output) { case VolumeControl.ActiveOutput.HEADPHONES: case VolumeControl.ActiveOutput.USB_HEADPHONES: case VolumeControl.ActiveOutput.HDMI_HEADPHONES: case VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES: - _volume_warning.headphones_active = true; + headphones = true; break; default: - _volume_warning.headphones_active = false; + headphones = false; break; } + message("setting _volume_warning.headphones_active to %d", (int)headphones); + _volume_warning.headphones_active = headphones; + update_root_icon(); update_notification(); }); @@ -105,7 +110,7 @@ public class IndicatorSound.Service: Object { }); this.menus.@foreach ( (profile, menu) => { - this.volume_control.bind_property ("high-volume", menu, "show-high-volume-warning", BindingFlags.SYNC_CREATE); + _volume_warning.bind_property ("high-volume", menu, "show-high-volume-warning", BindingFlags.SYNC_CREATE); }); this.menus.@foreach ( (profile, menu) => { |