diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-12-10 00:57:05 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-12-14 20:24:04 +0800 |
commit | a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f (patch) | |
tree | 8ceb84c97cb0485419a815c12d0f955efdca9680 /src | |
parent | 4db09641569a416334fd5c93d2c6cbc669848806 (diff) | |
download | gsoc2013-empathy-a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f.tar gsoc2013-empathy-a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f.tar.gz gsoc2013-empathy-a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f.tar.bz2 gsoc2013-empathy-a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f.tar.lz gsoc2013-empathy-a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f.tar.xz gsoc2013-empathy-a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f.tar.zst gsoc2013-empathy-a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f.zip |
map-view: use the individual menu
https://bugzilla.gnome.org/show_bug.cgi?id=665038
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-map-view.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index 5916dd02e..9ab82c091 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -35,7 +35,7 @@ #include <libempathy/empathy-utils.h> #include <libempathy/empathy-location.h> -#include <libempathy-gtk/empathy-contact-menu.h> +#include <libempathy-gtk/empathy-individual-menu.h> #include <libempathy-gtk/empathy-ui-utils.h> #include "empathy-map-view.h" @@ -192,28 +192,41 @@ marker_clicked_cb (ChamplainMarker *marker, { GtkWidget *menu; EmpathyContact *contact; + TpContact *tp_contact; + FolksIndividual *individual; if (event->button != 3) return FALSE; contact = g_object_get_data (G_OBJECT (marker), "contact"); + if (contact == NULL) + return FALSE; - menu = empathy_contact_menu_new (contact, - EMPATHY_CONTACT_FEATURE_CHAT | - EMPATHY_CONTACT_FEATURE_CALL | - EMPATHY_CONTACT_FEATURE_LOG | - EMPATHY_CONTACT_FEATURE_FT | - EMPATHY_CONTACT_FEATURE_INFO); + tp_contact = empathy_contact_get_tp_contact (contact); + if (tp_contact == NULL) + return FALSE; - if (menu == NULL) + individual = empathy_create_individual_from_tp_contact (tp_contact); + if (individual == NULL) return FALSE; + menu = empathy_individual_menu_new (individual, + EMPATHY_INDIVIDUAL_FEATURE_CHAT | + EMPATHY_INDIVIDUAL_FEATURE_CALL | + EMPATHY_INDIVIDUAL_FEATURE_LOG | + EMPATHY_INDIVIDUAL_FEATURE_INFO, NULL); + + if (menu == NULL) + goto out; + gtk_menu_attach_to_widget (GTK_MENU (menu), GTK_WIDGET (self), NULL); gtk_widget_show (menu); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time); +out: + g_object_unref (individual); return FALSE; } |