Add GetTimeSinceAction client API code

This commit is contained in:
Richard Hughes 2007-11-20 20:22:36 +00:00
parent 71cb908005
commit 05790b1151
2 changed files with 33 additions and 0 deletions

View File

@ -2176,6 +2176,36 @@ pk_client_get_backend_detail (PkClient *client, gchar **name, gchar **author)
return TRUE;
}
/**
* pk_client_get_time_since_action:
**/
gboolean
pk_client_get_time_since_action (PkClient *client, PkRoleEnum role, guint *seconds)
{
gboolean ret;
GError *error;
const gchar *role_text;
g_return_val_if_fail (client != NULL, FALSE);
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
error = NULL;
role_text = pk_role_enum_to_text (role);
ret = dbus_g_proxy_call (client->priv->proxy, "GetTimeSinceAction", &error,
G_TYPE_STRING, role_text,
G_TYPE_INVALID,
G_TYPE_UINT, seconds,
G_TYPE_INVALID);
if (ret == FALSE) {
/* abort as the DBUS method failed */
pk_warning ("GetTimeSinceAction failed :%s", error->message);
g_error_free (error);
return FALSE;
}
return TRUE;
}
/**
* pk_client_is_caller_active:
**/

View File

@ -152,6 +152,9 @@ gboolean pk_client_get_old_transactions (PkClient *client,
gboolean pk_client_get_backend_detail (PkClient *client,
gchar **name,
gchar **author);
gboolean pk_client_get_time_since_action (PkClient *client,
PkRoleEnum role,
guint *seconds);
gboolean pk_client_is_caller_active (PkClient *client,
gboolean *is_active);