#include <champlain-gtk/champlain-gtk.h>
#endif
-#include <libempathy/empathy-contactinfo-utils.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-location.h>
#include <libempathy/empathy-time.h>
#include "empathy-avatar-image.h"
+#include "empathy-contactinfo-utils.h"
#include "empathy-groups-widget.h"
#include "empathy-gtk-enum-types.h"
#include "empathy-individual-widget.h"
-#include "empathy-string-parser.h"
#include "empathy-ui-utils.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
/* Location */
GtkWidget *vbox_location;
GtkWidget *subvbox_location;
- GtkWidget *table_location;
+ GtkWidget *grid_location;
GtkWidget *label_location;
#ifdef HAVE_LIBCHAMPLAIN
GtkWidget *viewport_map;
TpContactInfoField *field = l->data;
gchar *title;
const gchar *value;
- gboolean linkify;
+ EmpathyContactInfoFormatFunc format;
GtkWidget *w;
if (field->field_value == NULL || field->field_value[0] == NULL)
value = field->field_value[0];
if (!empathy_contact_info_lookup_field (field->field_name,
- NULL, &linkify))
+ NULL, &format))
{
DEBUG ("Unhandled ContactInfo field: %s", field->field_name);
continue;
/* Add Value */
w = gtk_label_new (value);
- if (linkify == TRUE)
+ if (format != NULL)
{
gchar *markup;
- markup = empathy_add_link_markup (value);
+ markup = format (field->field_value);
gtk_label_set_markup (GTK_LABEL (w), markup);
g_free (markup);
}
}
/* Prepare the location information table */
- if (priv->table_location != NULL)
- gtk_widget_destroy (priv->table_location);
+ if (priv->grid_location != NULL)
+ gtk_widget_destroy (priv->grid_location);
- priv->table_location = gtk_table_new (1, 2, FALSE);
+ priv->grid_location = gtk_grid_new ();
gtk_box_pack_start (GTK_BOX (priv->subvbox_location),
- priv->table_location, FALSE, FALSE, 5);
+ priv->grid_location, FALSE, FALSE, 5);
for (i = 0; (skey = ordered_geolocation_keys[i]); i++)
label = gtk_label_new (user_label);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_table_attach (GTK_TABLE (priv->table_location),
- label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 10, 0);
+ gtk_grid_attach (GTK_GRID (priv->grid_location),
+ label, 0, row, 1, 1);
gtk_widget_show (label);
if (G_VALUE_TYPE (gvalue) == G_TYPE_DOUBLE)
if (svalue != NULL)
{
label = gtk_label_new (svalue);
- gtk_table_attach_defaults (GTK_TABLE (priv->table_location),
- label, 1, 2, row, row + 1);
+ gtk_grid_attach (GTK_GRID (priv->grid_location),
+ label, 1, row, 1, 1);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
gtk_widget_show (label);
if (row > 0)
{
/* We can display some fields */
- gtk_widget_show (priv->table_location);
+ gtk_widget_show (priv->grid_location);
}
else if (display_map == FALSE)
{
NULL);
g_free (filename);
- priv->table_location = NULL;
+ priv->grid_location = NULL;
gtk_box_pack_start (GTK_BOX (self), priv->vbox_individual_widget, TRUE, TRUE,
0);