aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-20 22:40:33 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-20 23:43:56 +0800
commit485836b9e046d420bc349749ac15c82b0dbd6261 (patch)
tree4530ea836a8eb29a7d5c5bcba12c133d57a1a859 /libempathy-gtk
parentb713ffc898aaa18edee52c0ef0c499d632ade836 (diff)
downloadgsoc2013-empathy-485836b9e046d420bc349749ac15c82b0dbd6261.tar
gsoc2013-empathy-485836b9e046d420bc349749ac15c82b0dbd6261.tar.gz
gsoc2013-empathy-485836b9e046d420bc349749ac15c82b0dbd6261.tar.bz2
gsoc2013-empathy-485836b9e046d420bc349749ac15c82b0dbd6261.tar.lz
gsoc2013-empathy-485836b9e046d420bc349749ac15c82b0dbd6261.tar.xz
gsoc2013-empathy-485836b9e046d420bc349749ac15c82b0dbd6261.tar.zst
gsoc2013-empathy-485836b9e046d420bc349749ac15c82b0dbd6261.zip
Add a "Linked Contacts" label at the top of the Information dialogue
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-individual-information-dialog.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-individual-information-dialog.c b/libempathy-gtk/empathy-individual-information-dialog.c
index 63623cd2d..486770684 100644
--- a/libempathy-gtk/empathy-individual-information-dialog.c
+++ b/libempathy-gtk/empathy-individual-information-dialog.c
@@ -110,6 +110,9 @@ individual_information_dialog_set_individual (
{
EmpathyIndividualInformationDialogPriv *priv;
GtkWidget *individual_widget;
+ GtkBox *content_area;
+ GList *personas, *l;
+ guint num_personas = 0;
g_return_if_fail (EMPATHY_INDIVIDUAL_INFORMATION_DIALOG (dialog));
g_return_if_fail (FOLKS_IS_INDIVIDUAL (individual));
@@ -119,13 +122,42 @@ individual_information_dialog_set_individual (
gtk_window_set_title (GTK_WINDOW (dialog),
folks_individual_get_alias (individual));
+ content_area = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
+
+ /* Determine how many personas we have, because we only want to display the
+ * label if we have more than one persona. */
+ personas = folks_individual_get_personas (individual);
+ for (l = personas; l != NULL; l = l->next)
+ {
+ if (TPF_IS_PERSONA (l->data))
+ num_personas++;
+ }
+
+ /* Label */
+ if (num_personas > 1)
+ {
+ gchar *label_string;
+ GtkWidget *label;
+
+ /* Translators: the heading at the top of the Information dialogue */
+ label_string = g_strdup_printf ("<b>%s</b>", _("Linked Contacts"));
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), label_string);
+ g_free (label_string);
+
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label), 6, 6);
+ gtk_box_pack_start (content_area, label, FALSE, TRUE, 0);
+ gtk_widget_show (label);
+ }
+
+ /* Individual widget */
individual_widget = empathy_individual_widget_new (individual,
EMPATHY_INDIVIDUAL_WIDGET_SHOW_LOCATION |
EMPATHY_INDIVIDUAL_WIDGET_SHOW_DETAILS |
EMPATHY_INDIVIDUAL_WIDGET_SHOW_PERSONAS);
- gtk_container_set_border_width (GTK_CONTAINER (individual_widget), 8);
- gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (
- GTK_DIALOG (dialog))), individual_widget, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (individual_widget), 6);
+ gtk_box_pack_start (content_area, individual_widget, TRUE, TRUE, 0);
gtk_widget_show (individual_widget);
priv->individual = g_object_ref (individual);