Commit 03b7ab94 authored by Magnus Boman's avatar Magnus Boman

Add support for GSM and CDMA devices in the Network Status tile

* Add support for GSM and CDMA devices in the Network Status tile

svn path=/trunk/; revision=476
parent b8c72047
2008-07-02 Magnus Boman <captain.magnus@gmail.com>
* main-menu/src/network-status-tile.c
* main-menu/src/network-status-agent.c
Add support for GSM and CDMA devices in the Network Status tile
2008-06-30 Scott Reeves <sreeves@novell.com>
* main-menu/src/main-menu-ui.c:
Fix for BNC#393101 - check title for null
......
......@@ -25,6 +25,8 @@
#include <NetworkManager.h>
#include <libnm-glib/nm-device-802-11-wireless.h>
#include <libnm-glib/nm-device-802-3-ethernet.h>
#include <libnm-glib/nm-gsm-device.h>
#include <libnm-glib/nm-cdma-device.h>
#include <nm-setting-ip4-config.h>
#include <nm-utils.h>
#include <arpa/inet.h>
......@@ -259,6 +261,18 @@ nm_get_device_info (NetworkStatusAgent * agent, NMDevice * device)
info->speed_mbs = nm_device_802_3_ethernet_get_speed (NM_DEVICE_802_3_ETHERNET(device));
info->hw_addr = g_strdup (nm_device_802_3_ethernet_get_hw_address (NM_DEVICE_802_3_ETHERNET(device)));
}
else if (NM_IS_GSM_DEVICE (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->speed_mbs = 0;
info->hw_addr = NULL;
}
return info;
}
......
......@@ -220,6 +220,22 @@ update_tile (NetworkStatusTile * tile)
subheader_text = markup;
break;
case DEVICE_TYPE_GSM:
markup = g_strdup_printf (_("Connected to: %s"), priv->status_info->iface);
icon_name = "nm-device-wireless";
header_text = _("Networ_k: GSM");
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 = "";
......@@ -325,6 +341,16 @@ update_info_dialog (NetworkStatusTile * tile)
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:
iface_and_type =
g_strdup_printf (_("Mobile Ethernet (%s)"), priv->status_info->iface);
break;
default:
iface_and_type = g_strdup_printf (_("Unknown"));
break;
......@@ -348,7 +374,8 @@ update_info_dialog (NetworkStatusTile * tile)
set_glade_label (xml, "label-default-route", priv->status_info->route);
set_glade_label (xml, "label-primary-dns", priv->status_info->primary_dns);
set_glade_label (xml, "label-secondary-dns", priv->status_info->secondary_dns);
set_glade_label (xml, "label-hardware-address", priv->status_info->hw_addr);
if (priv->status_info->hw_addr)
set_glade_label (xml, "label-hardware-address", priv->status_info->hw_addr);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment