]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-linking-dialog.c
individual_view_drag_end: remove the auto scroll
[empathy.git] / libempathy-gtk / empathy-linking-dialog.c
index cb6461a815a3ec53ac3761bb7b4637e33b63a865..350bfdc22622f51543e76b33d6a99520265fc717 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "empathy-linking-dialog.h"
 #include "empathy-individual-linker.h"
+#include "empathy-ui-utils.h"
 
 /**
  * SECTION:empathy-individual-widget
@@ -107,7 +108,6 @@ empathy_linking_dialog_init (EmpathyLinkingDialog *self)
   dialog = GTK_DIALOG (self);
 
   /* Set up dialog */
-  gtk_dialog_set_has_separator (dialog, FALSE);
   gtk_window_set_resizable (GTK_WINDOW (self), TRUE);
   /* Translators: this is the title of the linking dialogue (reached by
    * right-clicking on a contact and selecting "Link…"). "Link" in this title
@@ -119,7 +119,7 @@ empathy_linking_dialog_init (EmpathyLinkingDialog *self)
   button = gtk_button_new_with_mnemonic (
       C_("Unlink individual (button)", "_Unlink…"));
   gtk_widget_set_tooltip_text (button, _("Completely split the displayed "
-      "meta-contact into the contacts it contains."));
+      "linked contacts into the separate contacts."));
   gtk_dialog_add_action_widget (dialog, button, RESPONSE_UNLINK);
   gtk_widget_show (button);
 
@@ -159,7 +159,7 @@ linking_response_cb (EmpathyLinkingDialog *self,
   if (response == GTK_RESPONSE_OK)
     {
       EmpathyIndividualManager *manager;
-      GList *personas;
+      GeeSet *personas;
 
       manager = empathy_individual_manager_dup_singleton ();
 
@@ -179,12 +179,12 @@ linking_response_cb (EmpathyLinkingDialog *self,
 
       /* Show a confirmation dialogue first */
       dialog = gtk_message_dialog_new (GTK_WINDOW (self), GTK_DIALOG_MODAL,
-          GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, _("Unlink meta-contact '%s'?"),
-          folks_individual_get_alias (individual));
+          GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
+          _("Unlink linked contacts '%s'?"),
+          folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (individual)));
       gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-          _("Are you sure you want to unlink this meta-contact? This will "
-            "completely split the meta-contact into the contacts it "
-            "contains."));
+          _("Are you sure you want to unlink these linked contacts? This will "
+            "completely split the linked contacts into separate contacts."));
       gtk_dialog_add_buttons (GTK_DIALOG (dialog),
           GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
           C_("Unlink individual (button)", "_Unlink"), GTK_RESPONSE_OK,
@@ -223,7 +223,8 @@ empathy_linking_dialog_show (FolksIndividual *individual,
     GtkWindow *parent)
 {
   EmpathyLinkingDialogPriv *priv;
-  GList *personas, *l;
+  GeeSet *personas;
+  GeeIterator *iter;
   guint num_personas = 0;
 
   /* Create the dialogue if it doesn't exist */
@@ -246,11 +247,16 @@ empathy_linking_dialog_show (FolksIndividual *individual,
   /* Count how many Telepathy personas we have, to see whether we can
    * unlink */
   personas = folks_individual_get_personas (individual);
-  for (l = personas; l != NULL; l = l->next)
+  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
+  while (gee_iterator_next (iter))
     {
-      if (TPF_IS_PERSONA (l->data))
+      FolksPersona *persona = gee_iterator_get (iter);
+      if (empathy_folks_persona_is_interesting (persona))
         num_personas++;
+
+      g_clear_object (&persona);
     }
+  g_clear_object (&iter);
 
   /* Only make the "Unlink" button sensitive if we have enough personas */
   gtk_dialog_set_response_sensitive (GTK_DIALOG (linking_dialog),