[gnome-main-menu] Update to latest NetworkManager libs



commit 2e048785d4b5cefd3031732309ad3f2fa76dba86
Author: Stefano Karapetsas <stefano karapetsas com>
Date:   Tue Feb 12 23:41:35 2013 +0100

    Update to latest NetworkManager libs

 configure.in                         |    2 +-
 main-menu/src/network-status-agent.c |   21 +++++++--------------
 main-menu/src/network-status-info.c  |    2 +-
 main-menu/src/network-status-tile.c  |   29 ++++++++---------------------
 4 files changed, 17 insertions(+), 37 deletions(-)
---
diff --git a/configure.in b/configure.in
index 36d054f..14f06bc 100644
--- a/configure.in
+++ b/configure.in
@@ -62,7 +62,7 @@ if test "x$NM_GLIB" = "x"; then
 	NM_GLIB=libnm-glib
 fi
 
-PKG_CHECK_MODULES(NETWORKMANAGER, [NetworkManager $NM_GLIB >= 0.7.0 libnm-util >= 0.7.0], HAVE_NM=1, HAVE_NM=0)
+PKG_CHECK_MODULES(NETWORKMANAGER, [NetworkManager $NM_GLIB >= 0.8.0 libnm-util >= 0.8.0], HAVE_NM=1, HAVE_NM=0)
 if test "x$HAVE_NM" != "x1"; then
 	AC_WARN(NetworkManager is not available)
 fi
diff --git a/main-menu/src/network-status-agent.c b/main-menu/src/network-status-agent.c
index 9b49e8c..33f783a 100644
--- a/main-menu/src/network-status-agent.c
+++ b/main-menu/src/network-status-agent.c
@@ -25,8 +25,7 @@
 #include <NetworkManager.h>
 #include <nm-device-wifi.h>
 #include <nm-device-ethernet.h>
-#include <nm-gsm-device.h>
-#include <nm-cdma-device.h>
+#include <nm-device-modem.h>
 #include <nm-setting-ip4-config.h>
 #include <nm-utils.h>
 #include <arpa/inet.h>
@@ -242,7 +241,7 @@ nm_get_device_info (NetworkStatusAgent * agent, NMDevice * device)
 		NMAccessPoint * activeap = NULL;
 		const GByteArray * ssid;
 
-		info->type = DEVICE_TYPE_802_11_WIRELESS;
+		info->type = NM_DEVICE_TYPE_WIFI;
 		info->speed_mbs = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI(device));
 		info->hw_addr = g_strdup (nm_device_wifi_get_hw_address (NM_DEVICE_WIFI(device)));
 
@@ -259,19 +258,13 @@ nm_get_device_info (NetworkStatusAgent * agent, NMDevice * device)
 	}
 	else if (NM_IS_DEVICE_ETHERNET (device))
 	{
-		info->type = DEVICE_TYPE_802_3_ETHERNET;
+		info->type = NM_DEVICE_TYPE_ETHERNET;
 		info->speed_mbs = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET(device));
 		info->hw_addr = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET(device)));
 	}
-	else if (NM_IS_GSM_DEVICE (device))
+	else if (NM_IS_DEVICE_MODEM (device))
 	{
-		info->type = DEVICE_TYPE_GSM;
-		info->speed_mbs = 0;
-		info->hw_addr = NULL;
-	}
-	else if (NM_IS_CDMA_DEVICE (device))
-	{
-		info->type = DEVICE_TYPE_CDMA;
+		info->type = NM_DEVICE_TYPE_MODEM;
 		info->speed_mbs = 0;
 		info->hw_addr = NULL;
 	}
@@ -340,7 +333,7 @@ gtop_get_first_active_device_info ()
 
 			if (ret >= 0)
 			{
-				info->type = DEVICE_TYPE_802_11_WIRELESS;
+				info->type = NM_DEVICE_TYPE_WIFI;
 				info->essid = g_strdup (wl_cfg.essid);
 				info->iface = g_strdup (networks[i]);
 
@@ -348,7 +341,7 @@ gtop_get_first_active_device_info ()
 			}
 			else
 			{
-				info->type = DEVICE_TYPE_802_3_ETHERNET;
+				info->type = NM_DEVICE_TYPE_ETHERNET;
 				info->essid = NULL;
 				info->iface = g_strdup (networks[i]);
 
diff --git a/main-menu/src/network-status-info.c b/main-menu/src/network-status-info.c
index 5abf64e..b62f591 100644
--- a/main-menu/src/network-status-info.c
+++ b/main-menu/src/network-status-info.c
@@ -35,7 +35,7 @@ static void
 network_status_info_init (NetworkStatusInfo * info)
 {
 	info->active = FALSE;
-	info->type = DEVICE_TYPE_UNKNOWN;
+	info->type = NM_DEVICE_TYPE_UNKNOWN;
 	info->iface = NULL;
 	info->essid = NULL;
 
diff --git a/main-menu/src/network-status-tile.c b/main-menu/src/network-status-tile.c
index 5d9071e..4bf2e5c 100644
--- a/main-menu/src/network-status-tile.c
+++ b/main-menu/src/network-status-tile.c
@@ -215,7 +215,7 @@ update_tile (NetworkStatusTile * tile)
 	{
 		switch (priv->status_info->type)
 		{
-		case DEVICE_TYPE_802_11_WIRELESS:
+		case NM_DEVICE_TYPE_WIFI:
 			markup = g_strdup_printf (_("Connected to: %s"), priv->status_info->essid);
 
 			icon_name = "nm-device-wireless";
@@ -223,7 +223,7 @@ update_tile (NetworkStatusTile * tile)
 			subheader_text = markup;
 			break;
 
-		case DEVICE_TYPE_802_3_ETHERNET:
+		case NM_DEVICE_TYPE_ETHERNET:
 			markup = g_strdup_printf (_("Using ethernet (%s)"),
 				priv->status_info->iface);
 
@@ -232,7 +232,7 @@ update_tile (NetworkStatusTile * tile)
 			subheader_text = markup;
 			break;
 
-		case DEVICE_TYPE_GSM:
+		case NM_DEVICE_TYPE_MODEM:
 			markup = g_strdup_printf (_("Connected to: %s"), priv->status_info->iface);
 
 			icon_name = "nm-device-wireless";
@@ -240,14 +240,6 @@ update_tile (NetworkStatusTile * tile)
 			subheader_text = markup;
 			break;
 
-		case DEVICE_TYPE_CDMA:
-			markup = g_strdup_printf (_("Connected to: %s"), priv->status_info->iface);
-
-			icon_name = "nm-device-wireless";
-			header_text = _("Networ_k: CDMA");
-			subheader_text = markup;
-			break;
-
 		default:
 			icon_name = "";
 			header_text = "";
@@ -345,22 +337,17 @@ update_info_dialog (NetworkStatusTile * tile)
 
 	switch (priv->status_info->type)
 	{
-	case DEVICE_TYPE_802_11_WIRELESS:
+	case NM_DEVICE_TYPE_WIFI:
 		iface_and_type =
 			g_strdup_printf (_("Wireless Ethernet (%s)"), priv->status_info->iface);
 		break;
 
-	case DEVICE_TYPE_802_3_ETHERNET:
+	case NM_DEVICE_TYPE_ETHERNET:
 		iface_and_type =
 			g_strdup_printf (_("Wired Ethernet (%s)"), priv->status_info->iface);
 		break;
 
-	case DEVICE_TYPE_GSM:
-		iface_and_type =
-			g_strdup_printf (_("Mobile Ethernet (%s)"), priv->status_info->iface);
-		break;
-
-	case DEVICE_TYPE_CDMA:
+	case NM_DEVICE_TYPE_MODEM:
 		iface_and_type =
 			g_strdup_printf (_("Mobile Ethernet (%s)"), priv->status_info->iface);
 		break;
@@ -459,7 +446,6 @@ launch_network_config (const gchar * desktop_key)
 	desktop_file = g_settings_get_string (settings, desktop_key);
 	g_object_unref (settings);
 	appinfo = g_desktop_app_info_new (desktop_file);
-	g_free (desktop_file);
 
 	if (appinfo)
 	{
@@ -472,6 +458,7 @@ launch_network_config (const gchar * desktop_key)
 	}
 	else
 	{
-		g_warning ("network_status_tile_open: couldn't exec item\n");
+		g_warning ("network_status_tile_open: couldn't exec item: %s\n", desktop_file);
 	}
+	g_free (desktop_file);
 }


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