GNOME Bugzilla – Bug 686357
NM-applet always show full signal strength in connection established notification
Last modified: 2016-02-23 22:11:36 UTC
In applet-device-xxx.c, when the connections are establisthed, a notification is triggered "Connection Established", but the icon is always e.g. "notification-gsm-high". We need separate icons for the other network strengths, or if it is too early to know the network strength, the icon should not look like signal strength.
Downstream Ubuntu bug report: https://bugs.launchpad.net/network-manager/+bug/387626
This is now called "nm-signal-100" in src/applet-device-gsm.c, but it is still the same used regardless of signal strength. Seems like for wifi, a general icon is used without any signal strength.
(In reply to Marius Kotsbak from comment #0) > In applet-device-xxx.c, when the connections are establisthed, a > notification is triggered "Connection Established", but the icon is always > e.g. "notification-gsm-high". > > We need separate icons for the other network strengths, or if it is too > early to know the network strength, the icon should not look like signal > strength. This bothered me too, so I made a patch that makes the icon in the notification vary based on actual signal strength. Note that the icons used are the 22x22 ones that ship with nm-applet, whereas the one used previously, nm-device-wireless.png, is 48x48. This leads to some image interpolation blur. Also, if the signal strength changes during the display time of the notification, this change does not reflect in the icon (unlike the system tray status icon). Here's the patch: From add14003900cc18d4af35bde9197a17ace417606 Mon Sep 17 00:00:00 2001 From: Matias Wilkman <matias.wilkman@gmail.com> Date: Wed, 27 May 2015 13:06:24 +0300 Subject: [PATCH 1/1] Modified the wifi connected notification to indicate true signal strength instead of showing full bars always. --- src/applet-device-wifi.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c index 91d0ea8..99c2d78 100644 --- a/src/applet-device-wifi.c +++ b/src/applet-device-wifi.c @@ -1226,13 +1226,30 @@ wifi_notify_connected (NMDevice *device, NMAccessPoint *ap; char *esc_ssid; char *ssid_msg; + char *signal_strength_icon; + guint8 strength; ap = g_object_get_data (G_OBJECT (device), ACTIVE_AP_TAG); esc_ssid = get_ssid_utf8 (ap); + + strength = ap ? nm_access_point_get_strength (ap) : 0; + strength = MIN (strength, 100); + + if (strength > 80) + signal_strength_icon = "nm-signal-100"; + else if (strength > 55) + signal_strength_icon = "nm-signal-75"; + else if (strength > 30) + signal_strength_icon = "nm-signal-50"; + else if (strength > 5) + signal_strength_icon = "nm-signal-25"; + else + signal_strength_icon = "nm-signal-00"; + ssid_msg = g_strdup_printf (_("You are now connected to the Wi-Fi network '%s'."), esc_ssid); applet_do_notify_with_pref (applet, _("Connection Established"), - ssid_msg, "nm-device-wireless", + ssid_msg, signal_strength_icon/*"nm-device-wireless"*/, PREF_DISABLE_CONNECTED_NOTIFICATIONS); g_free (ssid_msg); g_free (esc_ssid); -- 2.1.4
Created attachment 304057 [details] [review] Modified the wifi connected notification to indicate true signal strength Note that the icons used are the 22x22 ones that ship with nm-applet, whereas the one used previously, nm-device-wireless.png, is 48x48. This leads to some image interpolation blur. Also, if the signal strength changes during the display time of the notification, this change does not reflect in the icon (unlike the system tray status icon).
(In reply to Matias Wilkman from comment #4) > Created attachment 304057 [details] [review] [review] > Modified the wifi connected notification to indicate true signal strength > > Note that the icons used are the 22x22 ones that ship with nm-applet, > whereas the one used previously, nm-device-wireless.png, is 48x48. This > leads to some image interpolation blur. Also, if the signal strength changes > during the display time of the notification, this change does not reflect in > the icon (unlike the system tray status icon). IMO it's ok that later changes are not considered for the notification-icon. How about replacing the if/else with: + + if (!ap) + signal_strength_icon = "nm-device-wireless"; + else + signal_strength_icon = mobile_helper_get_quality_icon_name (nm_access_point_get_strength (ap)); + for one, if we don't have an @ap, continue to use "nm-device-wireless". Secondly, reuse mobile_helper_get_quality_icon_name().
>How about replacing the if/else with: Yes, that's better!
Created attachment 304460 [details] [review] applet: indicate true signal strength in wifi connected notification Instead of showing always full bars. [thaller@redhat.com: modified original patch]
As far as I can tell, this is now fixed in network-manager-gnome 1.0.2-1 in Debian Unstable. Feel free to close this issue after verification.
(In reply to Thomas Haller from comment #7) > Created attachment 304460 [details] [review] [review] > applet: indicate true signal strength in wifi connected notification > > Instead of showing always full bars. > > [thaller@redhat.com: modified original patch] LGTM
merged to master: https://git.gnome.org/browse/network-manager-applet/commit/?id=3b50ee0a09b8d71575c8457ca6d73b55dc5f211b
and a second fix for nm-device-broadband.c: https://git.gnome.org/browse/network-manager-applet/commit/?id=0261738a42f2c082114a7ef7b7085908498cac56 Closing bug as RESOLVED.