]> git.0d.be Git - empathy.git/commitdiff
Bug 628133 — Linking dialog's live search should copy the one from the roster
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 1 Sep 2010 17:30:08 +0000 (18:30 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Thu, 2 Sep 2010 10:16:24 +0000 (11:16 +0100)
When launching a linking dialogue from EmpathyIndividualView, copy the view's
live search text to the EmpathyIndividualView in the linking dialogue.
Closes: bgo#628133
libempathy-gtk/empathy-individual-view.c

index 2f47f843cca6d209708b030e70922c936c6d45e9..573cef6f9c73f971259a52fee24e3c62a39d423f 100644 (file)
@@ -48,6 +48,7 @@
 #include "empathy-individual-menu.h"
 #include "empathy-individual-store.h"
 #include "empathy-images.h"
+#include "empathy-linking-dialog.h"
 #include "empathy-cell-renderer-expander.h"
 #include "empathy-cell-renderer-text.h"
 #include "empathy-cell-renderer-activatable.h"
@@ -2356,6 +2357,19 @@ individual_view_remove_activate_cb (GtkMenuItem *menuitem,
     }
 }
 
+static void
+individual_menu_link_contacts_activated_cb (EmpathyIndividualMenu *menu,
+    EmpathyLinkingDialog *linking_dialog,
+    EmpathyIndividualView *self)
+{
+  EmpathyIndividualViewPriv *priv = GET_PRIV (self);
+  EmpathyIndividualLinker *linker;
+
+  linker = empathy_linking_dialog_get_individual_linker (linking_dialog);
+  empathy_individual_linker_set_search_text (linker,
+      empathy_live_search_get_text (EMPATHY_LIVE_SEARCH (priv->search_widget)));
+}
+
 GtkWidget *
 empathy_individual_view_get_individual_menu (EmpathyIndividualView *view)
 {
@@ -2403,6 +2417,12 @@ empathy_individual_view_get_individual_menu (EmpathyIndividualView *view)
           G_CALLBACK (individual_view_remove_activate_cb), view);
     }
 
+  /* Connect to EmpathyIndividualMenu::link-contacts-activated so that we can
+   * set the live search text on the new linking dialogue to be the same as
+   * our own. */
+  g_signal_connect (menu, "link-contacts-activated",
+      (GCallback) individual_menu_link_contacts_activated_cb, view);
+
   g_object_unref (individual);
 
   return menu;