From 5f2c23beff36962c2f3ae1a797c8835d060ad0d4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 2 Feb 2005 21:22:40 +0000 Subject: [PATCH] 2005-02-02 Dan Williams * panel-applet/NMWirelessApplet.c - Display name of wireless network we are connecting to or connected to in the tooltip of the applet git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@406 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 6 ++++++ panel-applet/NMWirelessApplet.c | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5da574238..4bf3170abb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-02-02 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Display name of wireless network we are connecting to or connected to + in the tooltip of the applet + 2005-02-02 Dan Williams * src/NetworkManagerDHCP.c diff --git a/panel-applet/NMWirelessApplet.c b/panel-applet/NMWirelessApplet.c index 6e6ae2b101..54de3b931b 100644 --- a/panel-applet/NMWirelessApplet.c +++ b/panel-applet/NMWirelessApplet.c @@ -271,9 +271,11 @@ nmwa_update_state (NMWirelessApplet *applet) GdkPixbuf *pixbuf = NULL; gint strength = -1; char *tip = NULL; + WirelessNetwork *active_network = NULL; g_mutex_lock (applet->data_mutex); - if (applet->active_device) + if ( applet->active_device + && (applet->active_device->type == DEVICE_TYPE_WIRELESS_ETHERNET)) { GSList *list; for (list = applet->active_device->networks; list; list = list->next) @@ -281,9 +283,13 @@ nmwa_update_state (NMWirelessApplet *applet) WirelessNetwork *network = (WirelessNetwork *) list->data; if (network->active) + { strength = CLAMP ((int) network->strength, 0, 100); + active_network = network; + } } + /* Fall back to old strength if current strength is invalid */ if (strength <= 0) strength = applet->active_device->strength; } @@ -337,7 +343,8 @@ nmwa_update_state (NMWirelessApplet *applet) pixbuf = applet->wireless_25_icon; else pixbuf = applet->wireless_00_icon; - tip = g_strdup_printf (_("Wireless network connection (%d%%)"), strength); + tip = g_strdup_printf (_("Wireless network connection to '%s' (%d%%)"), + active_network ? active_network->essid : "(unknown)", strength); } } else @@ -346,7 +353,8 @@ nmwa_update_state (NMWirelessApplet *applet) case (APPLET_STATE_WIRELESS_CONNECTING): need_animation = TRUE; - tip = g_strdup (_("Connecting to a wireless network...")); + tip = g_strdup_printf (_("Connecting to wireless network '%s'..."), + active_network ? active_network->essid : "(unknown)"); break; case (APPLET_STATE_NO_NM):