Merge lp:~ctf/unity-settings-daemon/bug1389099_mic_volume_icons into lp:ubuntu/trusty/unity-settings-daemon

Proposed by TienFu Chen
Status: Rejected
Rejected by: Robert Ancell
Proposed branch: lp:~ctf/unity-settings-daemon/bug1389099_mic_volume_icons
Merge into: lp:ubuntu/trusty/unity-settings-daemon
Diff against target: 69 lines (+29/-2)
1 file modified
plugins/media-keys/gsd-media-keys-manager.c (+29/-2)
To merge this branch: bzr merge lp:~ctf/unity-settings-daemon/bug1389099_mic_volume_icons
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Review via email: mp+240687@code.launchpad.net

Description of the change

added microphone volume icons support.

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Looks good, thanks!

review: Approve
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Actually, it appears this was already solved?

Unmerged revisions

15. By TienFu Chen

added mic volume icons

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
--- plugins/media-keys/gsd-media-keys-manager.c 2014-03-10 17:25:56 +0000
+++ plugins/media-keys/gsd-media-keys-manager.c 2014-11-05 08:25:10 +0000
@@ -210,6 +210,7 @@
210210
211 /* Ubuntu notifications */211 /* Ubuntu notifications */
212 NotifyNotification *volume_notification;212 NotifyNotification *volume_notification;
213 NotifyNotification *mic_volume_notification;
213 NotifyNotification *brightness_notification;214 NotifyNotification *brightness_notification;
214 NotifyNotification *kb_backlight_notification;215 NotifyNotification *kb_backlight_notification;
215216
@@ -257,6 +258,12 @@
257 NULL258 NULL
258};259};
259260
261static const char *mic_volume_icons[] = {
262 "notification-audio-input-microphone-low-zero",
263 "notification-audio-input-microphone-high",
264 NULL
265};
266
260static const char *brightness_icons[] = {267static const char *brightness_icons[] = {
261 "notification-display-brightness-off",268 "notification-display-brightness-off",
262 "notification-display-brightness-low",269 "notification-display-brightness-low",
@@ -350,6 +357,15 @@
350}357}
351358
352static gboolean359static gboolean
360ubuntu_osd_notification_show_mic_volume (GsdMediaKeysManager *manager,
361 gint value,
362 gboolean muted)
363{
364 return ubuntu_osd_do_notification (&manager->priv->mic_volume_notification,
365 "mic-volume", value, muted, mic_volume_icons);
366}
367
368static gboolean
353ubuntu_osd_notification_show_brightness (GsdMediaKeysManager *manager,369ubuntu_osd_notification_show_brightness (GsdMediaKeysManager *manager,
354 gint value)370 gint value)
355{371{
@@ -1337,8 +1353,13 @@
1337 const GvcMixerStreamPort *port;1353 const GvcMixerStreamPort *port;
1338 const char *icon;1354 const char *icon;
13391355
1340 if (ubuntu_osd_notification_show_volume (manager, vol, muted))1356 if (GVC_IS_MIXER_SINK (stream)) {
1341 goto done;1357 if (ubuntu_osd_notification_show_volume (manager, vol, muted))
1358 goto done;
1359 } else {
1360 if (ubuntu_osd_notification_show_mic_volume (manager, vol, muted))
1361 goto done;
1362 }
13421363
1343 vol = CLAMP (vol, 0, 100);1364 vol = CLAMP (vol, 0, 100);
13441365
@@ -3115,6 +3136,12 @@
3115 priv->volume_notification = NULL;3136 priv->volume_notification = NULL;
3116 }3137 }
31173138
3139 if (priv->mic_volume_notification != NULL) {
3140 notify_notification_close (priv->mic_volume_notification, NULL);
3141 g_object_unref (priv->mic_volume_notification);
3142 priv->mic_volume_notification = NULL;
3143 }
3144
3118 if (priv->brightness_notification != NULL) {3145 if (priv->brightness_notification != NULL) {
3119 notify_notification_close (priv->brightness_notification, NULL);3146 notify_notification_close (priv->brightness_notification, NULL);
3120 g_object_unref (priv->brightness_notification);3147 g_object_unref (priv->brightness_notification);

Subscribers

People subscribed via source and target branches

to all changes: