summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-client.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-08-13 17:48:37 -0400
committerDan Winship <danw@gnome.org>2013-08-16 17:27:34 -0400
commit4d8063cd788ea22ee28f35097e1350c2adac1af3 (patch)
treedbf1130e4c609fe2815228ca44fa00f4e4e55098 /libnm-glib/nm-client.c
parentbc091f2f3ea2ee27d012f2332c514516fd61441b (diff)
downloadNetworkManager-4d8063cd788ea22ee28f35097e1350c2adac1af3.tar.gz
libnm-glib: add NMClient:startup, nm_client_get_startup()
Expose the new NMManager:startup property on NMClient.
Diffstat (limited to 'libnm-glib/nm-client.c')
-rw-r--r--libnm-glib/nm-client.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index 9c9371eff2..4bace4fd63 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -57,6 +57,7 @@ typedef struct {
gboolean manager_running;
char *version;
NMState state;
+ gboolean startup;
GPtrArray *devices;
GPtrArray *active_connections;
@@ -83,6 +84,7 @@ enum {
PROP_0,
PROP_VERSION,
PROP_STATE,
+ PROP_STARTUP,
PROP_MANAGER_RUNNING,
PROP_NETWORKING_ENABLED,
PROP_WIRELESS_ENABLED,
@@ -175,6 +177,7 @@ register_properties (NMClient *client)
const NMPropertiesInfo property_info[] = {
{ NM_CLIENT_VERSION, &priv->version },
{ NM_CLIENT_STATE, &priv->state },
+ { NM_CLIENT_STARTUP, &priv->startup },
{ NM_CLIENT_NETWORKING_ENABLED, &priv->networking_enabled },
{ NM_CLIENT_WIRELESS_ENABLED, &priv->wireless_enabled },
{ NM_CLIENT_WIRELESS_HARDWARE_ENABLED, &priv->wireless_hw_enabled },
@@ -1015,6 +1018,27 @@ nm_client_get_state (NMClient *client)
}
/**
+ * nm_client_get_startup:
+ * @client: a #NMClient
+ *
+ * Tests whether the daemon is still in the process of activating
+ * connections at startup.
+ *
+ * Returns: whether the daemon is still starting up
+ *
+ * Since: 0.9.10
+ **/
+gboolean
+nm_client_get_startup (NMClient *client)
+{
+ g_return_val_if_fail (NM_IS_CLIENT (client), NM_STATE_UNKNOWN);
+
+ _nm_object_ensure_inited (NM_OBJECT (client));
+
+ return NM_CLIENT_GET_PRIVATE (client)->startup;
+}
+
+/**
* nm_client_networking_get_enabled:
* @client: a #NMClient
*
@@ -1284,6 +1308,7 @@ proxy_name_owner_changed (DBusGProxy *proxy,
priv->manager_running = new_running;
if (!priv->manager_running) {
priv->state = NM_STATE_UNKNOWN;
+ priv->startup = FALSE;
_nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING);
_nm_object_suppress_property_updates (NM_OBJECT (client), TRUE);
poke_wireless_devices_with_rf_status (client);
@@ -1808,6 +1833,9 @@ get_property (GObject *object,
case PROP_STATE:
g_value_set_uint (value, nm_client_get_state (self));
break;
+ case PROP_STARTUP:
+ g_value_set_boolean (value, nm_client_get_startup (self));
+ break;
case PROP_MANAGER_RUNNING:
g_value_set_boolean (value, priv->manager_running);
break;
@@ -1884,6 +1912,21 @@ nm_client_class_init (NMClientClass *client_class)
G_PARAM_READABLE));
/**
+ * NMClient:startup:
+ *
+ * Whether the daemon is still starting up.
+ *
+ * Since: 0.9.10
+ **/
+ g_object_class_install_property
+ (object_class, PROP_STARTUP,
+ g_param_spec_boolean (NM_CLIENT_STARTUP,
+ "Startup",
+ "Whether the daemon is still starting up",
+ FALSE,
+ G_PARAM_READABLE));
+
+ /**
* NMClient::manager-running:
*
* Whether the daemon is running.