#include <champlain-gtk/champlain-gtk.h>
#endif
-#include <libmissioncontrol/mc-account.h>
#include <telepathy-glib/util.h>
#include <libempathy/empathy-tp-contact-factory.h>
#include <libempathy/empathy-location.h>
#include <libempathy/empathy-time.h>
#include <libempathy/empathy-utils.h>
+#include <libempathy/empathy-account.h>
#include "empathy-contact-widget.h"
#include "empathy-account-chooser.h"
#include "empathy-avatar-chooser.h"
#include "empathy-avatar-image.h"
#include "empathy-ui-utils.h"
+#include "empathy-kludge-label.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
#include <libempathy/empathy-debug.h>
#if HAVE_LIBCHAMPLAIN
GtkWidget *viewport_map;
GtkWidget *map_view_embed;
- ClutterActor *map_view;
+ ChamplainView *map_view;
#endif
/* Groups */
"hbox_presence", &information->hbox_presence,
"label_alias", &information->label_alias,
"image_state", &information->image_state,
- "label_status", &information->label_status,
"table_contact", &information->table_contact,
"vbox_avatar", &information->vbox_avatar,
"vbox_location", &information->vbox_location,
information->factory = empathy_tp_contact_factory_dup_singleton (connection);
}
+ /* set the selected account to be the account this contact came from */
+ if (contact && EMPATHY_IS_ACCOUNT_CHOOSER (information->widget_account)) {
+ empathy_account_chooser_set_account (
+ EMPATHY_ACCOUNT_CHOOSER (information->widget_account),
+ empathy_contact_get_account (contact));
+ }
+
/* Update information for widgets */
contact_widget_contact_update (information);
contact_widget_groups_update (information);
static void
contact_widget_contact_setup (EmpathyContactWidget *information)
{
+ /* Setup label_status as a KludgeLabel */
+ information->label_status = empathy_kludge_label_new ("");
+ gtk_label_set_line_wrap_mode (GTK_LABEL (information->label_status),
+ PANGO_WRAP_WORD_CHAR);
+ gtk_label_set_line_wrap (GTK_LABEL (information->label_status),
+ TRUE);
+
+ if (!(information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP))
+ gtk_label_set_selectable (GTK_LABEL (information->label_status), TRUE);
+
+ gtk_box_pack_start (GTK_BOX (information->hbox_presence),
+ information->label_status, TRUE, TRUE, 0);
+ gtk_widget_show (information->label_status);
+
/* Setup account label/chooser */
if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT)
{
static void
contact_widget_contact_update (EmpathyContactWidget *information)
{
- McAccount *account = NULL;
+ EmpathyAccount *account = NULL;
const gchar *id = NULL;
/* Connect and get info from new contact */
{
const gchar *name;
- name = mc_account_get_display_name (account);
+ name = empathy_account_get_display_name (account);
gtk_label_set_label (GTK_LABEL (information->widget_account), name);
}
}
else if (tp_strdiff (key, EMPATHY_LOCATION_CLIMB) == FALSE)
return _("Climb Speed:");
else if (tp_strdiff (key, EMPATHY_LOCATION_TIMESTAMP) == FALSE)
- return _("Taken at:");
+ return _("Last Updated on:");
else if (tp_strdiff (key, EMPATHY_LOCATION_LON) == FALSE)
return _("Longitude:");
else if (tp_strdiff (key, EMPATHY_LOCATION_LAT) == FALSE)
{
GHashTable *location;
GValue *value;
- gdouble lat, lon;
+ gdouble lat = 0.0, lon = 0.0;
gboolean has_position = TRUE;
GtkWidget *label;
guint row = 0;
stamp = g_value_get_int64 (value);
time = stamp;
- user_date = empathy_time_to_string_local (time, _("%B %e, %Y at %R"));
+ user_date = empathy_time_to_string_relative (time);
- text = g_strconcat ( _("<b>Location</b> on "), user_date, NULL);
+ text = g_strconcat ( _("<b>Location</b>, "), user_date, NULL);
gtk_label_set_markup (GTK_LABEL (information->label_location), text);
g_free (text);
}
char *svalue = NULL;
skey = (const gchar *) key;
- if (tp_strdiff (skey, EMPATHY_LOCATION_TIMESTAMP) == FALSE)
- continue;
user_label = location_key_to_label (skey);
gvalue = (GValue *) pvalue;
{
svalue = g_value_dup_string (gvalue);
}
+ else if (G_VALUE_TYPE (gvalue) == G_TYPE_INT64)
+ {
+ time_t time;
+
+ time = g_value_get_int64 (value);
+ svalue = empathy_time_to_string_utc (time, _("%B %e, %Y at %R UTC"));
+ }
if (svalue != NULL)
{
ClutterActor *marker;
ChamplainLayer *layer;
- information->map_view = champlain_view_new ();
- information->map_view_embed = champlain_view_embed_new (
- CHAMPLAIN_VIEW (information->map_view));
+ information->map_view_embed = gtk_champlain_embed_new ();
+ information->map_view = gtk_champlain_embed_get_view (
+ GTK_CHAMPLAIN_EMBED (information->map_view_embed));
gtk_container_add (GTK_CONTAINER (information->viewport_map),
information->map_view_embed);
NULL);
layer = champlain_layer_new ();
- champlain_view_add_layer (CHAMPLAIN_VIEW (information->map_view), layer);
+ champlain_view_add_layer (information->map_view, layer);
marker = champlain_marker_new_with_text (
empathy_contact_get_name (information->contact), NULL, NULL, NULL);
champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker), lat, lon);
clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
- champlain_view_center_on (CHAMPLAIN_VIEW(information->map_view), lat, lon);
+ champlain_view_center_on (information->map_view, lat, lon);
gtk_widget_show_all (information->viewport_map);
}
#endif