NetworkManager r3543 - in trunk: . libnm-glib
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r3543 - in trunk: . libnm-glib
- Date: Tue, 8 Apr 2008 04:58:44 +0100 (BST)
Author: dcbw
Date: Tue Apr 8 04:58:43 2008
New Revision: 3543
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3543&view=rev
Log:
2008-04-07 Dan Williams <dcbw redhat com>
* libnm-glib/nm-device.c
libnm-glib/nm-device.h
- Proxy the 'managed' property
Modified:
trunk/ChangeLog
trunk/libnm-glib/nm-device.c
trunk/libnm-glib/nm-device.h
Modified: trunk/libnm-glib/nm-device.c
==============================================================================
--- trunk/libnm-glib/nm-device.c (original)
+++ trunk/libnm-glib/nm-device.c Tue Apr 8 04:58:43 2008
@@ -24,6 +24,7 @@
char *udi;
char *driver;
guint32 capabilities;
+ gboolean managed;
NMIP4Config *ip4_config;
gboolean null_ip4_config;
NMDeviceState state;
@@ -37,6 +38,7 @@
PROP_UDI,
PROP_DRIVER,
PROP_CAPABILITIES,
+ PROP_MANAGED,
PROP_IP4_CONFIG,
PROP_STATE,
PROP_PRODUCT,
@@ -104,6 +106,7 @@
{ NM_DEVICE_INTERFACE, nm_object_demarshal_generic, &priv->iface },
{ NM_DEVICE_DRIVER, nm_object_demarshal_generic, &priv->driver },
{ NM_DEVICE_CAPABILITIES, nm_object_demarshal_generic, &priv->capabilities },
+ { NM_DEVICE_MANAGED, nm_object_demarshal_generic, &priv->managed },
{ NM_DEVICE_IP4_CONFIG, demarshal_ip4_config, &priv->ip4_config },
{ NM_DEVICE_STATE, nm_object_demarshal_generic, &priv->state },
{ NULL },
@@ -194,6 +197,9 @@
case PROP_CAPABILITIES:
g_value_set_uint (value, nm_device_get_capabilities (device));
break;
+ case PROP_MANAGED:
+ g_value_set_boolean (value, nm_device_get_managed (device));
+ break;
case PROP_IP4_CONFIG:
g_value_set_object (value, nm_device_get_ip4_config (device));
break;
@@ -259,6 +265,14 @@
G_PARAM_READABLE));
g_object_class_install_property
+ (object_class, PROP_MANAGED,
+ g_param_spec_boolean (NM_DEVICE_MANAGED,
+ "Managed",
+ "Managed",
+ FALSE,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property
(object_class, PROP_IP4_CONFIG,
g_param_spec_object (NM_DEVICE_IP4_CONFIG,
"IP4 Config",
@@ -421,6 +435,23 @@
return priv->capabilities;
}
+gboolean
+nm_device_get_managed (NMDevice *device)
+{
+ NMDevicePrivate *priv;
+
+ g_return_val_if_fail (NM_IS_DEVICE (device), 0);
+
+ priv = NM_DEVICE_GET_PRIVATE (device);
+ if (!priv->managed) {
+ priv->managed = nm_object_get_boolean_property (NM_OBJECT (device),
+ NM_DBUS_INTERFACE_DEVICE,
+ "Managed");
+ }
+
+ return priv->managed;
+}
+
NMIP4Config *
nm_device_get_ip4_config (NMDevice *device)
{
Modified: trunk/libnm-glib/nm-device.h
==============================================================================
--- trunk/libnm-glib/nm-device.h (original)
+++ trunk/libnm-glib/nm-device.h Tue Apr 8 04:58:43 2008
@@ -22,6 +22,7 @@
#define NM_DEVICE_INTERFACE "interface"
#define NM_DEVICE_DRIVER "driver"
#define NM_DEVICE_CAPABILITIES "capabilities"
+#define NM_DEVICE_MANAGED "managed"
#define NM_DEVICE_IP4_CONFIG "ip4-config"
#define NM_DEVICE_STATE "state"
#define NM_DEVICE_VENDOR "vendor"
@@ -43,6 +44,7 @@
const char * nm_device_get_udi (NMDevice *device);
const char * nm_device_get_driver (NMDevice *device);
guint32 nm_device_get_capabilities (NMDevice *device);
+gboolean nm_device_get_managed (NMDevice *device);
NMIP4Config * nm_device_get_ip4_config (NMDevice *device);
NMDeviceState nm_device_get_state (NMDevice *device);
const char * nm_device_get_product (NMDevice *device);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]