From e1c5a98895875aaa39aeb274e631f19fb0cb6414 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 12 Feb 2009 08:24:36 -0600 Subject: Adding in a timer function to change the time every three minutes or so in order to test modifying times. --- tests/im-client.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/im-client.c b/tests/im-client.c index 255ca37..3670bfa 100644 --- a/tests/im-client.c +++ b/tests/im-client.c @@ -23,6 +23,20 @@ with this program. If not, see . #include "libindicate/server.h" #include "libindicate/indicator-message.h" +static gboolean +timeout_cb (gpointer data) +{ + g_debug("Modifying time"); + + IndicateIndicator * indicator = INDICATE_INDICATOR(data); + + GTimeVal time; + g_get_current_time(&time); + indicate_indicator_set_property_time(INDICATE_INDICATOR(indicator), "time", &time); + + return TRUE; +} + static void display (IndicateIndicator * indicator, gpointer data) { @@ -54,6 +68,8 @@ main (int argc, char ** argv) g_signal_connect(G_OBJECT(indicator), INDICATE_INDICATOR_SIGNAL_DISPLAY, G_CALLBACK(display), NULL); + g_timeout_add_seconds(180, timeout_cb, indicator); + g_main_loop_run(g_main_loop_new(NULL, FALSE)); return 0; -- cgit v1.2.3