[gnome-control-center] network: display a different icon if the wired ethernet device is disconnected



commit eeac17e2265bde858ddcf807c2243abaf9d2d9b4
Author: Richard Hughes <richard hughsie com>
Date:   Fri Mar 11 15:13:20 2011 +0000

    network: display a different icon if the wired ethernet device is disconnected

 panels/network/panel-common.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/panels/network/panel-common.c b/panels/network/panel-common.c
index 1820a4a..f84941b 100644
--- a/panels/network/panel-common.c
+++ b/panels/network/panel-common.c
@@ -35,10 +35,17 @@ const gchar *
 panel_device_to_icon_name (NMDevice *device)
 {
         const gchar *value = NULL;
+        NMDeviceState state;
         NMDeviceModemCapabilities caps;
         switch (nm_device_get_device_type (device)) {
         case NM_DEVICE_TYPE_ETHERNET:
-                value = "network-wired";
+                state = nm_device_get_state (device);
+                if (state == NM_DEVICE_STATE_DISCONNECTED) {
+                        /* TODO: we really want network-wired-disconnected */
+                        value = "network-offline";
+                } else {
+                        value = "network-wired";
+                }
                 break;
         case NM_DEVICE_TYPE_WIFI:
         case NM_DEVICE_TYPE_BT:



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