]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-individual-widget.c
use gtk_box_new() instead of gtk_[h,v]box_new()
[empathy.git] / libempathy-gtk / empathy-individual-widget.c
index 49e52861c47f710ffd07497a982816b801e0404c..5a1c559d13229262613f68d6ee7005dd7cce29ff 100644 (file)
@@ -189,7 +189,7 @@ update_weak_contact (EmpathyIndividualWidget *self)
               presence_type_cur = folks_presence_details_get_presence_type (
                   presence);
 
-              if (folks_presence_details_typecmp (
+              if (tp_contact == NULL || folks_presence_details_typecmp (
                     presence_type_cur, presence_type) > 0)
                 {
                   presence_type = presence_type_cur;
@@ -235,6 +235,9 @@ details_update_show (EmpathyIndividualWidget *self,
   EmpathyIndividualWidgetPriv *priv = GET_PRIV (self);
   GList *info, *l;
   guint n_rows = 0;
+  GtkWidget *channels_label;
+  TpConnection *conn;
+  TpAccount *account;
 
   info = tp_contact_get_contact_info (contact);
   info = g_list_sort (info, (GCompareFunc) empathy_contact_info_field_cmp);
@@ -287,6 +290,25 @@ details_update_show (EmpathyIndividualWidget *self,
 
       n_rows++;
     }
+
+  conn = tp_contact_get_connection (contact);
+  account = tp_connection_get_account (conn);
+
+  channels_label = empathy_contact_info_create_channel_list_label (account,
+      info, n_rows);
+
+  if (channels_label != NULL)
+    {
+      GtkWidget *title_widget;
+
+      title_widget =  gtk_label_new (_("Channels:"));
+
+      add_row (GTK_GRID (priv->grid_details), n_rows, title_widget,
+          channels_label);
+
+      n_rows++;
+    }
+
   g_list_free (info);
 
   return n_rows;
@@ -1301,7 +1323,7 @@ alias_presence_avatar_favourite_set_up (EmpathyIndividualWidget *self,
   current_row++;
 
   /* Presence */
-  priv->hbox_presence = gtk_hbox_new (FALSE, 6);
+  priv->hbox_presence = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
 
   /* Presence image */
   image = gtk_image_new_from_stock (GTK_STOCK_MISSING_IMAGE,
@@ -1456,7 +1478,7 @@ add_persona (EmpathyIndividualWidget *self,
   gtk_widget_show (label);
 
   /* Pack the protocol icon with the account name in an hbox */
-  hbox = GTK_BOX (gtk_hbox_new (FALSE, 6));
+  hbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6));
 
   account_label = gtk_label_new (NULL);
   gtk_label_set_selectable (GTK_LABEL (account_label),
@@ -1518,7 +1540,7 @@ add_persona (EmpathyIndividualWidget *self,
   gtk_widget_show (GTK_WIDGET (grid));
 
   /* Pack a separator after the grid */
-  separator = gtk_hseparator_new ();
+  separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
   g_object_set_data (G_OBJECT (grid), "separator", separator);
   gtk_box_pack_start (GTK_BOX (priv->vbox_individual), separator, FALSE, FALSE,
       0);
@@ -2066,7 +2088,7 @@ finalize (GObject *object)
 {
   EmpathyIndividualWidgetPriv *priv = GET_PRIV (object);
 
-  g_hash_table_destroy (priv->persona_grids);
+  g_hash_table_unref (priv->persona_grids);
 
   G_OBJECT_CLASS (empathy_individual_widget_parent_class)->finalize (object);
 }