From 29fd0490ab7f2a03b87b34247743fa03e3278faf Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Sep 2014 14:45:14 -0500 Subject: Fleshing out drawing attention --- src/im-accounts-service.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/im-accounts-service.c b/src/im-accounts-service.c index c7d3083..a993e6e 100644 --- a/src/im-accounts-service.c +++ b/src/im-accounts-service.c @@ -155,13 +155,33 @@ im_accounts_service_ref_default (void) return g_object_ref(as); } +/* The draws attention setting is very legacy right now, we've patched and not changed + things much. We're gonna do better in the future, this function abstracts out the ugly */ void im_accounts_service_set_draws_attention (ImAccountsService * service, gboolean draws_attention) { + g_return_if_fail(IM_IS_ACCOUNTS_SERVICE(service)); + ImAccountsServicePrivate * priv = IM_ACCOUNTS_SERVICE_GET_PRIVATE(service); + if (priv->touch_settings == NULL) { + return; + } + g_dbus_connection_call(g_dbus_proxy_get_connection(priv->touch_settings), + g_dbus_proxy_get_name(priv->touch_settings), + g_dbus_proxy_get_object_path(priv->touch_settings), + "org.freedesktop.Accounts.User", + "SetXHasMessages", + g_variant_new("(b)", draws_attention), + NULL, /* reply */ + G_DBUS_CALL_FLAGS_NONE, + -1, /* timeout */ + NULL, /* cancellable */ + NULL, NULL); /* cb */ } +/* Looks at the property that is set by settings. We default to off in any case + that we can or we don't know what the state is. */ gboolean im_accounts_service_get_show_on_greeter (ImAccountsService * service) { -- cgit v1.2.3