network-manager-applet r925 - in trunk: . src



Author: dcbw
Date: Sat Oct  4 22:29:46 2008
New Revision: 925
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=925&view=rev

Log:
2008-10-04  Dan Williams  <dcbw redhat com>

	* src/applet-device-gsm.c
	  src/applet-device-cdma.c
	  src/applet-device-wired.c
		- (wired_device_state_changed, cdma_device_state_changed,
		   gsm_device_state_changed): show what connection just got connected



Modified:
   trunk/ChangeLog
   trunk/src/applet-device-cdma.c
   trunk/src/applet-device-gsm.c
   trunk/src/applet-device-wired.c

Modified: trunk/src/applet-device-cdma.c
==============================================================================
--- trunk/src/applet-device-cdma.c	(original)
+++ trunk/src/applet-device-cdma.c	Sat Oct  4 22:29:46 2008
@@ -283,10 +283,22 @@
                            NMApplet *applet)
 {
 	if (new_state == NM_DEVICE_STATE_ACTIVATED) {
+		NMConnection *connection;
+		NMSettingConnection *s_con = NULL;
+		char *str = NULL;
+
+		connection = applet_find_active_connection_for_device (device, applet, NULL);
+		if (connection) {
+			s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
+			if (s_con && s_con->id)
+				str = g_strdup_printf (_("You are now connected to '%s'."), s_con->id);
+		}
+
 		applet_do_notify (applet, NOTIFY_URGENCY_LOW,
 					      _("Connection Established"),
-						  _("You are now connected to the CDMA network."),
+						  str ? str : _("You are now connected to the CDMA network."),
 						  "nm-device-wwan", NULL, NULL, NULL, NULL);
+		g_free (str);
 	}
 }
 

Modified: trunk/src/applet-device-gsm.c
==============================================================================
--- trunk/src/applet-device-gsm.c	(original)
+++ trunk/src/applet-device-gsm.c	Sat Oct  4 22:29:46 2008
@@ -284,10 +284,22 @@
                           NMApplet *applet)
 {
 	if (new_state == NM_DEVICE_STATE_ACTIVATED) {
+		NMConnection *connection;
+		NMSettingConnection *s_con = NULL;
+		char *str = NULL;
+
+		connection = applet_find_active_connection_for_device (device, applet, NULL);
+		if (connection) {
+			s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
+			if (s_con && s_con->id)
+				str = g_strdup_printf (_("You are now connected to '%s'."), s_con->id);
+		}
+
 		applet_do_notify (applet, NOTIFY_URGENCY_LOW,
 					      _("Connection Established"),
-						  _("You are now connected to the GSM network."),
+						  str ? str : _("You are now connected to the GSM network."),
 						  "nm-device-wwan", NULL, NULL, NULL, NULL);
+		g_free (str);
 	}
 }
 

Modified: trunk/src/applet-device-wired.c
==============================================================================
--- trunk/src/applet-device-wired.c	(original)
+++ trunk/src/applet-device-wired.c	Sat Oct  4 22:29:46 2008
@@ -245,10 +245,22 @@
                             NMApplet *applet)
 {
 	if (new_state == NM_DEVICE_STATE_ACTIVATED) {
+		NMConnection *connection;
+		NMSettingConnection *s_con = NULL;
+		char *str = NULL;
+
+		connection = applet_find_active_connection_for_device (device, applet, NULL);
+		if (connection) {
+			s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
+			if (s_con && s_con->id)
+				str = g_strdup_printf (_("You are now connected to '%s'."), s_con->id);
+		}
+
 		applet_do_notify (applet, NOTIFY_URGENCY_LOW,
-						  _("Connection Established"),
-						  _("You are now connected to the wired network."),
+					      _("Connection Established"),
+						  str ? str : _("You are now connected to the wired network."),
 						  "nm-device-wired", NULL, NULL, NULL, NULL);
+		g_free (str);
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]