core: add active connection state DEACTIVATING

Not used yet, but will be when device deactivating state gets
used.  Should be 100% backwards compatible with users that don't
know about it for now.
This commit is contained in:
Dan Williams 2011-03-17 14:23:21 -05:00
parent 23943e7ce2
commit 1701df4b75
7 changed files with 43 additions and 7 deletions

View file

@ -1187,6 +1187,8 @@ active_connection_state_to_string (NMActiveConnectionState state)
return _("activating");
case NM_ACTIVE_CONNECTION_STATE_ACTIVATED:
return _("activated");
case NM_ACTIVE_CONNECTION_STATE_DEACTIVATING:
return _("deactivating");
case NM_ACTIVE_CONNECTION_STATE_UNKNOWN:
default:
return _("unknown");

View file

@ -316,6 +316,22 @@
</para>
</section>
<section>
<title>New Active Connection State</title>
<para>
Along with the new device states, an
<ulink url="spec.html#type-NM_ACTIVE_CONNECTION_STATE">additional
ActiveConnection state</ulink> has been added: DEACTIVATING. This state
is entered when the connection is being torn down and deactivated.
</para>
<para>
<emphasis role="strong">Action:</emphasis> where code checks active
connection states or shows UI indication of active connection states, make
sure the DEACTIVATING state is processed correctly, and that code in
switch()-type statements is updated to handle it.
</para>
</section>
<section>
<title>Consolidated Modem Devices</title>
<para>

View file

@ -417,14 +417,23 @@ typedef enum {
} NMDeviceStateReason;
/**
* NMActiveConnectionState:
* @NM_ACTIVE_CONNECTION_STATE_UNKNOWN: the state of the connection is unknown
* @NM_ACTIVE_CONNECTION_STATE_ACTIVATING: a network connection is being prepared
* @NM_ACTIVE_CONNECTION_STATE_ACTIVATED: there is a connection to the network
* @NM_ACTIVE_CONNECTION_STATE_DEACTIVATING: the network connection is being
* torn down and cleaned up
*
* #NMActiveConnectionState values indicate the state of a connection to a
* specific network while it is starting, connected, or disconnecting from that
* network.
*/
typedef enum {
NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0,
/* Indicates the connection is activating */
NM_ACTIVE_CONNECTION_STATE_ACTIVATING,
/* Indicates the connection is currently active */
NM_ACTIVE_CONNECTION_STATE_ACTIVATED
NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
NM_ACTIVE_CONNECTION_STATE_DEACTIVATING
} NMActiveConnectionState;
#endif /* NETWORK_MANAGER_H */

View file

@ -48,6 +48,11 @@
The connection is activated.
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="DEACTIVATING" value="3">
<tp:docstring>
The connection is being torn down and cleaned up.
</tp:docstring>
</tp:enumvalue>
</tp:enum>
</interface>
</node>

View file

@ -454,7 +454,7 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
"State",
"State",
NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
NM_ACTIVE_CONNECTION_STATE_DEACTIVATING,
NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
G_PARAM_READABLE));

View file

@ -440,8 +440,12 @@ device_state_changed (NMDevice *device,
new_default = priv->is_default;
new_default6 = priv->is_default6;
break;
case NM_DEVICE_STATE_DEACTIVATING:
new_ac_state = NM_ACTIVE_CONNECTION_STATE_DEACTIVATING;
break;
default:
new_ac_state = NM_ACTIVE_CONNECTION_STATE_UNKNOWN;
new_default = new_default6 = FALSE;
break;
}

View file

@ -68,7 +68,7 @@ nm_active_connection_install_properties (GObjectClass *object_class,
"State",
"State",
NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
NM_ACTIVE_CONNECTION_STATE_DEACTIVATING,
NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
G_PARAM_READABLE));