aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-widget.c
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-04-08 04:04:31 +0800
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-28 00:52:04 +0800
commitb12b63f0c0a992d3caf8c0ada68e502bd8d3a506 (patch)
tree24c628aabb896d7efb1cef23794b2cde0bc28b18 /libempathy-gtk/empathy-contact-widget.c
parent30165e135359e217e7a9581277f8bf9b7b5c7459 (diff)
downloadgsoc2013-empathy-b12b63f0c0a992d3caf8c0ada68e502bd8d3a506.tar
gsoc2013-empathy-b12b63f0c0a992d3caf8c0ada68e502bd8d3a506.tar.gz
gsoc2013-empathy-b12b63f0c0a992d3caf8c0ada68e502bd8d3a506.tar.bz2
gsoc2013-empathy-b12b63f0c0a992d3caf8c0ada68e502bd8d3a506.tar.lz
gsoc2013-empathy-b12b63f0c0a992d3caf8c0ada68e502bd8d3a506.tar.xz
gsoc2013-empathy-b12b63f0c0a992d3caf8c0ada68e502bd8d3a506.tar.zst
gsoc2013-empathy-b12b63f0c0a992d3caf8c0ada68e502bd8d3a506.zip
Add a map in the Contact Information dialog
For now, the map in the tool tip is disabled as Clutter-gtk does like at all this type of window/initialisation
Diffstat (limited to 'libempathy-gtk/empathy-contact-widget.c')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index a32ac65d6..1fcfc4e56 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -27,6 +27,11 @@
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
+#if HAVE_LIBCHAMPLAIN
+#include <champlain/champlain.h>
+#include <champlain-gtk/champlain-gtk.h>
+#endif
+
#include <libmissioncontrol/mc-account.h>
#include <telepathy-glib/util.h>
@@ -90,6 +95,15 @@ typedef struct
GtkWidget *table_contact;
GtkWidget *vbox_avatar;
+#if HAVE_LIBCHAMPLAIN
+ /* Location */
+ GtkWidget *vbox_location;
+ GtkWidget *label_location;
+ GtkWidget *viewport_map;
+ GtkWidget *map_view_embed;
+ ClutterActor *map_view;
+#endif
+
/* Groups */
GtkWidget *vbox_groups;
GtkWidget *entry_group;
@@ -135,6 +149,10 @@ static void contact_widget_presence_notify_cb (
EmpathyContactWidget *information);
static void contact_widget_avatar_notify_cb (
EmpathyContactWidget *information);
+#if HAVE_LIBCHAMPLAIN
+static void contact_widget_location_setup (
+ EmpathyContactWidget *information);
+#endif
static void contact_widget_groups_setup (
EmpathyContactWidget *information);
static void contact_widget_groups_update (EmpathyContactWidget *information);
@@ -203,6 +221,11 @@ empathy_contact_widget_new (EmpathyContact *contact,
"label_status", &information->label_status,
"table_contact", &information->table_contact,
"vbox_avatar", &information->vbox_avatar,
+#if HAVE_LIBCHAMPLAIN
+ "vbox_location", &information->vbox_location,
+ "label_location", &information->label_location,
+ "viewport_map", &information->viewport_map,
+#endif
"vbox_groups", &information->vbox_groups,
"entry_group", &information->entry_group,
"button_group", &information->button_group,
@@ -229,6 +252,9 @@ empathy_contact_widget_new (EmpathyContact *contact,
/* Create widgets */
contact_widget_contact_setup (information);
+#if HAVE_LIBCHAMPLAIN
+ contact_widget_location_setup (information);
+#endif
contact_widget_groups_setup (information);
contact_widget_details_setup (information);
contact_widget_client_setup (information);
@@ -880,6 +906,28 @@ contact_widget_avatar_notify_cb (EmpathyContactWidget *information)
EMPATHY_AVATAR_IMAGE (information->widget_avatar), avatar);
}
+#if HAVE_LIBCHAMPLAIN
+static void
+contact_widget_location_setup (EmpathyContactWidget *information)
+{
+ if (/* information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP || */
+ information->flags & EMPATHY_CONTACT_WIDGET_SHOW_LOCATION)
+ {
+ information->map_view = champlain_view_new (CHAMPLAIN_VIEW_MODE_KINETIC);
+ information->map_view_embed = champlain_view_embed_new (
+ CHAMPLAIN_VIEW (information->map_view));
+
+ gtk_container_add (GTK_CONTAINER (information->viewport_map),
+ information->map_view_embed);
+ g_object_set (G_OBJECT (information->map_view), "show-license", FALSE,
+ NULL);
+ champlain_view_center_on (CHAMPLAIN_VIEW(information->map_view), 45, -73);
+
+ gtk_widget_show_all (information->vbox_location);
+ }
+}
+#endif
+
static void
contact_widget_groups_setup (EmpathyContactWidget *information)
{