diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2010-02-25 22:19:50 +0100 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2010-02-25 22:19:50 +0100 |
commit | 08b711551f30656386c6eadb7b82e6885ba55c63 (patch) | |
tree | 8d611fbff08d2de1d24103ed08933af134f262dc /tests/test-glib-proxy-client.c | |
parent | 0af5090188b1002d4cbca3e8a60b701153a8b391 (diff) | |
parent | 688b1c13a36bf5c0dcc885000b7cec42e043bf24 (diff) | |
download | libdbusmenu-08b711551f30656386c6eadb7b82e6885ba55c63.tar.gz libdbusmenu-08b711551f30656386c6eadb7b82e6885ba55c63.tar.bz2 libdbusmenu-08b711551f30656386c6eadb7b82e6885ba55c63.zip |
releasing version 0.2.6-0ubuntu1
Diffstat (limited to 'tests/test-glib-proxy-client.c')
-rw-r--r-- | tests/test-glib-proxy-client.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/test-glib-proxy-client.c b/tests/test-glib-proxy-client.c index 50ad5d3..0ae2e20 100644 --- a/tests/test-glib-proxy-client.c +++ b/tests/test-glib-proxy-client.c @@ -26,10 +26,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "test-glib-proxy.h" -static guint layouton = -1; +static guint layouton = -2; static GMainLoop * mainloop = NULL; static gboolean passed = TRUE; static guint death_timer = 0; +static guint verify_timer = 0; static gboolean verify_props (DbusmenuMenuitem * mi, gchar ** properties) @@ -118,16 +119,22 @@ layout_updated (DbusmenuClient * client, gpointer data) g_debug("\tIgnored, no root"); return; } - layouton++; - g_timeout_add (1500, layout_verify_timer, client); + if (verify_timer != 0) { + g_source_remove(verify_timer); + } + + verify_timer = g_timeout_add (3000, layout_verify_timer, client); return; } static gboolean layout_verify_timer (gpointer data) { - g_debug("Verifing Layout: %d", layouton); DbusmenuMenuitem * menuroot = dbusmenu_client_get_root(DBUSMENU_CLIENT(data)); + layouton = dbusmenu_menuitem_property_get_int(menuroot, LAYOUT_ON); + + g_debug("Verifing Layout: %d", layouton); + verify_timer = 0; proplayout_t * layout = &layouts[layouton]; if (!verify_root_to_layout(menuroot, layout)) { @@ -136,13 +143,18 @@ layout_verify_timer (gpointer data) } else { /* Extend our death */ g_source_remove(death_timer); - death_timer = g_timeout_add_seconds(10, timer_func, data); + death_timer = g_timeout_add_seconds(4, timer_func, data); } if (layouts[layouton+1].id == -1) { g_main_loop_quit(mainloop); } + GValue value = {0}; + g_value_init(&value, G_TYPE_INT); + g_value_set_int(&value, 0); + dbusmenu_menuitem_handle_event(menuroot, "clicked", &value, layouton); + return FALSE; } @@ -154,7 +166,7 @@ main (int argc, char ** argv) DbusmenuClient * client = dbusmenu_client_new("test.proxy.first_proxy", "/org/test"); g_signal_connect(G_OBJECT(client), DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED, G_CALLBACK(layout_updated), NULL); - death_timer = g_timeout_add_seconds(10, timer_func, client); + death_timer = g_timeout_add_seconds(4, timer_func, client); mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); |