Merge lp:~philip.scott/wingpanel-indicator-sound/wingpanel-indicator-sound into lp:~wingpanel-devs/wingpanel-indicator-sound/trunk

Proposed by Felipe Escoto
Status: Merged
Approved by: Djax
Approved revision: 24
Merged at revision: 23
Proposed branch: lp:~philip.scott/wingpanel-indicator-sound/wingpanel-indicator-sound
Merge into: lp:~wingpanel-devs/wingpanel-indicator-sound/trunk
Diff against target: 63 lines (+12/-5)
1 file modified
src/Indicator.vala (+12/-5)
To merge this branch: bzr merge lp:~philip.scott/wingpanel-indicator-sound/wingpanel-indicator-sound
Reviewer Review Type Date Requested Status
kay van der Zander Needs Fixing
Review via email: mp+263009@code.launchpad.net

Description of the change

Makes sure the sound confirmation is closed whenever the sound indicator's popover is opened.

* If the confirmation was opened, close it when the popover appears
* If the popover is opened, do not show a notification when you scroll on the icon

It does not fix: https://bugs.launchpad.net/wingpanel-indicator-sound/+bug/1463578 though.

A small change with how the settings panel opens also slipped by, before if you open the sound settings from the indicator, you sometimes couldn't interact with the sound indicator until you closed switchboard. But this is fixed on this merge by closing the indicator before opening switchboard

To post a comment you must log in.
24. By Felipe Escoto

Don't play a sound if reached max volume

Revision history for this message
kay van der Zander (kay20) wrote :

Hey please improve:
Dif line 16 17 remove space behind bracket
Dif line 34 35 remove space behind bracket
Dif line 49 do something with the error information

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Indicator.vala'
--- src/Indicator.vala 2015-06-22 19:30:34 +0000
+++ src/Indicator.vala 2015-06-25 17:42:44 +0000
@@ -39,6 +39,7 @@
3939
40 private Services.Settings settings;40 private Services.Settings settings;
4141
42 bool open = false;
42 bool mute_blocks_sound = false;43 bool mute_blocks_sound = false;
43 uint sound_was_blocked_timeout_id;44 uint sound_was_blocked_timeout_id;
4445
@@ -76,7 +77,7 @@
76 Canberra.PROP_APPLICATION_LANGUAGE, locale,77 Canberra.PROP_APPLICATION_LANGUAGE, locale,
77 null);78 null);
78 ca_context.open ();79 ca_context.open ();
79 }80 }
8081
81 ~Indicator () {82 ~Indicator () {
82 if (this.sound_was_blocked_timeout_id > 0) {83 if (this.sound_was_blocked_timeout_id > 0) {
@@ -236,7 +237,7 @@
236 vol.reason = Services.VolumeControl.VolumeReasons.USER_KEYPRESS;237 vol.reason = Services.VolumeControl.VolumeReasons.USER_KEYPRESS;
237 this.volume_control.volume = vol;238 this.volume_control.volume = vol;
238239
239 if (this.notification != null && v >= -0.05 && v <= (this.max_volume + 0.05)) {240 if (open == false && this.notification != null && v >= -0.05 && v <= (this.max_volume + 0.05)) {
240 string icon;241 string icon;
241 if (v <= 0.0)242 if (v <= 0.0)
242 icon = "notification-audio-volume-off";243 icon = "notification-audio-volume-off";
@@ -255,7 +256,9 @@
255 }256 }
256 catch (Error e) {257 catch (Error e) {
257 warning ("unable to show notification: %s", e.message);258 warning ("unable to show notification: %s", e.message);
258 }259 }
260 } else if (v <= (this.max_volume + 0.05)) {
261 play_sound_blubble ();
259 }262 }
260263
261 return Gdk.EVENT_STOP;264 return Gdk.EVENT_STOP;
@@ -351,16 +354,20 @@
351 }354 }
352355
353 public override void opened () {356 public override void opened () {
354357 open = true;
358 try {
359 notification.close ();
360 } catch (Error E) {}
355 }361 }
356362
357 public override void closed () {363 public override void closed () {
364 open = false;
358 }365 }
359366
360 private void show_settings () {367 private void show_settings () {
361 var cmd = new Granite.Services.SimpleCommand ("/usr/bin", SETTINGS_EXEC);368 var cmd = new Granite.Services.SimpleCommand ("/usr/bin", SETTINGS_EXEC);
369 close ();
362 cmd.run ();370 cmd.run ();
363 close ();
364 }371 }
365372
366 private void play_sound_blubble () {373 private void play_sound_blubble () {

Subscribers

People subscribed via source and target branches

to all changes: