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
1=== modified file 'src/Indicator.vala'
2--- src/Indicator.vala 2015-06-22 19:30:34 +0000
3+++ src/Indicator.vala 2015-06-25 17:42:44 +0000
4@@ -39,6 +39,7 @@
5
6 private Services.Settings settings;
7
8+ bool open = false;
9 bool mute_blocks_sound = false;
10 uint sound_was_blocked_timeout_id;
11
12@@ -76,7 +77,7 @@
13 Canberra.PROP_APPLICATION_LANGUAGE, locale,
14 null);
15 ca_context.open ();
16- }
17+ }
18
19 ~Indicator () {
20 if (this.sound_was_blocked_timeout_id > 0) {
21@@ -236,7 +237,7 @@
22 vol.reason = Services.VolumeControl.VolumeReasons.USER_KEYPRESS;
23 this.volume_control.volume = vol;
24
25- if (this.notification != null && v >= -0.05 && v <= (this.max_volume + 0.05)) {
26+ if (open == false && this.notification != null && v >= -0.05 && v <= (this.max_volume + 0.05)) {
27 string icon;
28 if (v <= 0.0)
29 icon = "notification-audio-volume-off";
30@@ -255,7 +256,9 @@
31 }
32 catch (Error e) {
33 warning ("unable to show notification: %s", e.message);
34- }
35+ }
36+ } else if (v <= (this.max_volume + 0.05)) {
37+ play_sound_blubble ();
38 }
39
40 return Gdk.EVENT_STOP;
41@@ -351,16 +354,20 @@
42 }
43
44 public override void opened () {
45-
46+ open = true;
47+ try {
48+ notification.close ();
49+ } catch (Error E) {}
50 }
51
52 public override void closed () {
53+ open = false;
54 }
55
56 private void show_settings () {
57 var cmd = new Granite.Services.SimpleCommand ("/usr/bin", SETTINGS_EXEC);
58+ close ();
59 cmd.run ();
60- close ();
61 }
62
63 private void play_sound_blubble () {

Subscribers

People subscribed via source and target branches

to all changes: