Update the icon to shor the wireless strength correctly if we have wireless
authorRoy Marples <roy@marples.name>
Mon, 6 Apr 2015 19:15:09 +0000 (19:15 +0000)
committerRoy Marples <roy@marples.name>
Mon, 6 Apr 2015 19:15:09 +0000 (19:15 +0000)
going on/offline and a non wireless interface online.

src/dhcpcd-gtk/main.c

index 6299d4232ec524e7fb4d910377633c5a593c82a8..047c1f079be7e487b63db14b13b66a7d20bbc4ec 100644 (file)
@@ -233,7 +233,16 @@ update_online(DHCPCD_CONNECTION *con, bool showif)
                        gtk_status_icon_set_from_icon_name(status_icon,
                            "network-offline");
                }
+       } else {
+               const char *icon;
+               DHCPCD_WI_SCAN *scan;
+
+               scan = get_strongest_scan();
+               icon = scan ? get_strength_icon_name(scan->strength.value) :
+                   "network-transmit-receive";
+               gtk_status_icon_set_from_icon_name(status_icon, icon);
        }
+
        gtk_status_icon_set_tooltip_text(status_icon, msgs);
        g_free(msgs);
 }