aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-map-view.c
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-27 03:38:32 +0800
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-28 00:52:09 +0800
commitc40737394bff5c27daea7e4ee08f240224475904 (patch)
tree23b00052be64cd0601148b67c41a59e96e44648b /src/empathy-map-view.c
parentc734c5e2451582a52596e44f96e617ee346b6598 (diff)
downloadgsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar
gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.gz
gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.bz2
gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.lz
gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.xz
gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.zst
gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.zip
Display relative time to user
The time of the geolocation update is displayed relatively to current time (1 min ago, 3 hours ago). The function just prints ("in the future") for debugging purpuses for time in the future.
Diffstat (limited to 'src/empathy-map-view.c')
-rw-r--r--src/empathy-map-view.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index 688195443..8c6dc54e6 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -296,6 +296,10 @@ map_view_contacts_foreach (GtkTreeModel *model,
GHashTable *location;
GdkPixbuf *avatar;
const gchar *name;
+ gchar *date;
+ gchar *label;
+ GValue *gtime;
+ time_t time;
gtk_tree_model_get (model, iter, EMPATHY_CONTACT_LIST_STORE_COL_CONTACT,
&contact, -1);
@@ -321,7 +325,20 @@ map_view_contacts_foreach (GtkTreeModel *model,
champlain_marker_set_image (CHAMPLAIN_MARKER (marker), NULL);
name = empathy_contact_get_name (contact);
- champlain_marker_set_text (CHAMPLAIN_MARKER (marker), name);
+ gtime = g_hash_table_lookup (location, EMPATHY_LOCATION_TIMESTAMP);
+ if (gtime != NULL)
+ {
+ time = g_value_get_int64 (gtime);
+ date = empathy_time_to_string_relative (time);
+ label = g_strconcat ("<b>", name, "</b>\n<small>", date, "</small>", NULL);
+ }
+ else
+ {
+ label = g_strconcat ("<b>", name, "</b>\n", NULL);
+ }
+ champlain_marker_set_use_markup (CHAMPLAIN_MARKER (marker), TRUE);
+ champlain_marker_set_text (CHAMPLAIN_MARKER (marker), label);
+ g_free (label);
clutter_container_add (CLUTTER_CONTAINER (window->layer), marker, NULL);