From db31456921f9977d8fef8ed1dcee6517107358ff Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 17 Oct 2013 09:04:03 +0200 Subject: all: Add GetCriticalAction daemon method This allows desktop front-ends to get which action will actually be taken when we hit critical battery. This is not a property as availability of actions might change over the course of the run of the system, and we didn't want to make unnecessary D-Bus calls on startup. --- tools/up-tool.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/up-tool.c') diff --git a/tools/up-tool.c b/tools/up-tool.c index 99dba78..8e58d00 100644 --- a/tools/up-tool.c +++ b/tools/up-tool.c @@ -124,6 +124,7 @@ up_client_print (UpClient *client) gboolean lid_is_closed; gboolean lid_is_present; gboolean is_docked; + char *action; g_object_get (client, "daemon-version", &daemon_version, @@ -138,6 +139,9 @@ up_client_print (UpClient *client) g_print (" lid-is-closed: %s\n", lid_is_closed ? "yes" : "no"); g_print (" lid-is-present: %s\n", lid_is_present ? "yes" : "no"); g_print (" is-docked: %s\n", is_docked ? "yes" : "no"); + action = up_client_get_critical_action (client); + g_print (" critical-action: %s\n", action); + g_free (action); g_free (daemon_version); } -- cgit v1.2.1