core: bring the state() D-Bus method back

It's a lot easier for app developers to use.
This commit is contained in:
Dan Williams 2011-03-08 12:57:35 -06:00
parent 5c260cfe4a
commit 62ad893a4a
3 changed files with 21 additions and 6 deletions

View file

@ -445,12 +445,6 @@
go to sleep or wake up.
</entry>
</row>
<row>
<entry><screen>state() method</screen></entry>
<entry>
Use the <literal>State</literal> property instead.
</entry>
</row>
</tbody>
</tgroup>
</table>

View file

@ -212,6 +212,15 @@
</arg>
</method>
<method name="state">
<tp:docstring>
The overall networking state as determined by the NetworkManager daemon,
based on the state of network devices under it's management.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_state"/>
<arg name="state" type="u" direction="out" tp:type="NM_STATE"/>
</method>
<property name="NetworkingEnabled" type="b" access="read">
<tp:docstring>
Indicates if overall networking is currently enabled or not. See the

View file

@ -93,6 +93,10 @@ static void impl_manager_enable (NMManager *manager,
static void impl_manager_get_permissions (NMManager *manager,
DBusGMethodInvocation *context);
static gboolean impl_manager_get_state (NMManager *manager,
guint32 *state,
GError **error);
static gboolean impl_manager_set_logging (NMManager *manager,
const char *level,
const char *domains,
@ -2726,6 +2730,14 @@ impl_manager_get_permissions (NMManager *self,
nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME, FALSE);
}
static gboolean
impl_manager_get_state (NMManager *manager, guint32 *state, GError **error)
{
nm_manager_update_state (manager);
*state = NM_MANAGER_GET_PRIVATE (manager)->state;
return TRUE;
}
static gboolean
impl_manager_set_logging (NMManager *manager,
const char *level,