Commit facf6b17 authored by Jiří Klimeš's avatar Jiří Klimeš

core: add Version property to org.freedesktop.NetworkManager interface

parent 358261cc
......@@ -61,6 +61,7 @@ object. dbus-glib generates the same bound function names for D-Bus the methods
<property name="WwanEnabled" type="b" access="readwrite"/>
<property name="WwanHardwareEnabled" type="b" access="read"/>
<property name="ActiveConnections" type="ao" access="read"/>
<property name="Version" type="s" access="read"/>
<property name="State" type="u" access="read"/>
<signal name="StateChanged">
......
......@@ -206,6 +206,12 @@
</tp:docstring>
</property>
<property name="Version" type="s" access="read">
<tp:docstring>
NetworkManager version.
</tp:docstring>
</property>
<property name="State" type="u" access="read" tp:type="NM_STATE">
<tp:docstring>
The overall state of the NetworkManager daemon.
......
......@@ -274,6 +274,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
enum {
PROP_0,
PROP_VERSION,
PROP_STATE,
PROP_NETWORKING_ENABLED,
PROP_WIRELESS_ENABLED,
......@@ -4398,6 +4399,9 @@ get_property (GObject *object, guint prop_id,
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
switch (prop_id) {
case PROP_VERSION:
g_value_set_string (value, VERSION);
break;
case PROP_STATE:
nm_manager_update_state (self);
g_value_set_uint (value, priv->state);
......@@ -4587,6 +4591,14 @@ nm_manager_class_init (NMManagerClass *manager_class)
object_class->dispose = dispose;
/* properties */
g_object_class_install_property
(object_class, PROP_VERSION,
g_param_spec_string (NM_MANAGER_VERSION,
"Version",
"NetworkManager version",
NULL,
G_PARAM_READABLE));
g_object_class_install_property
(object_class, PROP_STATE,
g_param_spec_uint (NM_MANAGER_STATE,
......
......@@ -35,6 +35,7 @@
#define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_MANAGER))
#define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass))
#define NM_MANAGER_VERSION "version"
#define NM_MANAGER_STATE "state"
#define NM_MANAGER_NETWORKING_ENABLED "networking-enabled"
#define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled"
......
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