diff options
author | Ted Gould <ted@canonical.com> | 2009-04-07 22:25:24 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-04-07 22:25:24 -0500 |
commit | a8ab75df408384d4dc0995ac00db27c4fbb46c76 (patch) | |
tree | cc74c0de021d6ad30b06e81b715524a44146be2d /tests/show-hide-server.c | |
parent | 13aa4e53918e0dc6cbc90e01ce0297ad18bc6aaf (diff) | |
parent | c1955c5ca3f460f0ac8fc7de84325345b60b8919 (diff) | |
download | libayatana-indicator-a8ab75df408384d4dc0995ac00db27c4fbb46c76.tar.gz libayatana-indicator-a8ab75df408384d4dc0995ac00db27c4fbb46c76.tar.bz2 libayatana-indicator-a8ab75df408384d4dc0995ac00db27c4fbb46c76.zip |
Lots of fixes from trunk
Diffstat (limited to 'tests/show-hide-server.c')
-rw-r--r-- | tests/show-hide-server.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/show-hide-server.c b/tests/show-hide-server.c new file mode 100644 index 0000000..23c1ea1 --- /dev/null +++ b/tests/show-hide-server.c @@ -0,0 +1,44 @@ +/* From LP: #351537 */ + +#include <glib.h> +#include "libindicate/server.h" +#include "libindicate/indicator-message.h" + +gboolean hidden = TRUE; + +static gboolean +timeout_cb (gpointer data) +{ + IndicateServer * server = INDICATE_SERVER(data); + + if (hidden) { + printf("showing... "); + indicate_server_show(server); + printf("ok\n"); + hidden = FALSE; + } else { + printf("hiding... "); + indicate_server_hide(server); + printf("ok\n"); + hidden = TRUE; + } + + return TRUE; +} + + +int +main (int argc, char ** argv) +{ + g_type_init(); + + IndicateServer * server = indicate_server_ref_default(); + indicate_server_set_type(server, "message.im"); + indicate_server_set_desktop_file(server, "/usr/share/applications/empathy.desktop"); + g_timeout_add_seconds(1, timeout_cb, server); + + g_main_loop_run(g_main_loop_new(NULL, FALSE)); + + return 0; +} + |