diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-06-01 21:00:35 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-06-14 15:21:49 +0800 |
commit | a96c2a5c0ac5133ab8b7a14fab0f2857cead162d (patch) | |
tree | 95c9305295e9461b5575e8576a395072855dfc54 /tests | |
parent | 785ce2292d3b61afd25099fd87eb3b7fbf4f4270 (diff) | |
download | gsoc2013-empathy-a96c2a5c0ac5133ab8b7a14fab0f2857cead162d.tar gsoc2013-empathy-a96c2a5c0ac5133ab8b7a14fab0f2857cead162d.tar.gz gsoc2013-empathy-a96c2a5c0ac5133ab8b7a14fab0f2857cead162d.tar.bz2 gsoc2013-empathy-a96c2a5c0ac5133ab8b7a14fab0f2857cead162d.tar.lz gsoc2013-empathy-a96c2a5c0ac5133ab8b7a14fab0f2857cead162d.tar.xz gsoc2013-empathy-a96c2a5c0ac5133ab8b7a14fab0f2857cead162d.tar.zst gsoc2013-empathy-a96c2a5c0ac5133ab8b7a14fab0f2857cead162d.zip |
Add popup-individual-menu signal
Diffstat (limited to 'tests')
-rw-r--r-- | tests/interactive/test-empathy-roster-view.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/interactive/test-empathy-roster-view.c b/tests/interactive/test-empathy-roster-view.c index fd9457d53..c76f670c8 100644 --- a/tests/interactive/test-empathy-roster-view.c +++ b/tests/interactive/test-empathy-roster-view.c @@ -24,6 +24,34 @@ individual_activated_cb (EmpathyRosterView *self, folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (individual))); } +static void +popup_individual_menu_cb (EmpathyRosterView *self, + FolksIndividual *individual, + guint button, + guint time, + gpointer user_data) +{ + GtkWidget *menu, *item; + + g_print ("'%s' popup menu\n", + folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (individual))); + + menu = gtk_menu_new (); + + g_signal_connect (menu, "deactivate", + G_CALLBACK (gtk_widget_destroy), NULL); + + item = gtk_menu_item_new_with_label (folks_alias_details_get_alias ( + FOLKS_ALIAS_DETAILS (individual))); + gtk_widget_show (item); + + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + gtk_menu_attach_to_widget (GTK_MENU (menu), GTK_WIDGET (self), NULL); + + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, time); +} + int main (int argc, char **argv) @@ -57,6 +85,8 @@ main (int argc, g_signal_connect (view, "individual-activated", G_CALLBACK (individual_activated_cb), NULL); + g_signal_connect (view, "popup-individual-menu", + G_CALLBACK (popup_individual_menu_cb), NULL); empathy_roster_view_show_offline (EMPATHY_ROSTER_VIEW (view), show_offline); empathy_roster_view_show_groups (EMPATHY_ROSTER_VIEW (view), show_groups); |