aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>2009-06-15 00:30:40 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-06-15 22:40:24 +0800
commitec4b41130b1b9704abf190a470d65a9e41846284 (patch)
tree2d532cbf920f668b94745528f4a34338c7df1c34 /src
parente37fbd376151222f336650f66476c3cdc0957451 (diff)
downloadgsoc2013-empathy-ec4b41130b1b9704abf190a470d65a9e41846284.tar
gsoc2013-empathy-ec4b41130b1b9704abf190a470d65a9e41846284.tar.gz
gsoc2013-empathy-ec4b41130b1b9704abf190a470d65a9e41846284.tar.bz2
gsoc2013-empathy-ec4b41130b1b9704abf190a470d65a9e41846284.tar.lz
gsoc2013-empathy-ec4b41130b1b9704abf190a470d65a9e41846284.tar.xz
gsoc2013-empathy-ec4b41130b1b9704abf190a470d65a9e41846284.tar.zst
gsoc2013-empathy-ec4b41130b1b9704abf190a470d65a9e41846284.zip
Add contextual popup menu in map view
Diffstat (limited to 'src')
-rw-r--r--src/empathy-map-view.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index 276b69402..ab64b2adc 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -235,6 +235,32 @@ map_view_contact_location_notify (EmpathyContact *contact,
}
static gboolean
+marker_clicked_cb (ChamplainMarker *marker,
+ ClutterButtonEvent *event,
+ EmpathyContact *contact)
+{
+ GtkWidget *menu;
+
+ if (event->button != 3)
+ return FALSE;
+
+ menu = empathy_contact_menu_new (contact,
+ EMPATHY_CONTACT_FEATURE_CHAT |
+ EMPATHY_CONTACT_FEATURE_CALL |
+ EMPATHY_CONTACT_FEATURE_LOG |
+ EMPATHY_CONTACT_FEATURE_INFO);
+
+ if (menu == NULL)
+ return FALSE;
+
+ gtk_widget_show (menu);
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
+ event->button, event->time);
+
+ return FALSE;
+}
+
+static gboolean
map_view_contacts_foreach (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
@@ -293,6 +319,10 @@ map_view_contacts_foreach (GtkTreeModel *model,
champlain_marker_set_text (CHAMPLAIN_MARKER (marker), label);
g_free (label);
+ clutter_actor_set_reactive (CLUTTER_ACTOR (marker), TRUE);
+ g_signal_connect (marker, "button-release-event",
+ G_CALLBACK (marker_clicked_cb), contact);
+
clutter_container_add (CLUTTER_CONTAINER (window->layer), marker, NULL);
g_signal_connect (contact, "notify::location",