[empathy] map-view: use the individual menu
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] map-view: use the individual menu
- Date: Wed, 14 Dec 2011 12:24:53 +0000 (UTC)
commit a162bb98ecb9fc05e6a444f7b9a4c70c90daf65f
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Dec 9 17:57:05 2011 +0100
map-view: use the individual menu
https://bugzilla.gnome.org/show_bug.cgi?id=665038
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 5916dd0..9ab82c0 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]