[empathy] contact-chooser: add 'activate' signal



commit 061d4ab96a0ebde9665192c3712ca3928ff2c679
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Oct 17 14:10:01 2011 +0200

    contact-chooser: add 'activate' signal
    
    https://bugzilla.gnome.org/show_bug.cgi?id=661993

 libempathy-gtk/empathy-contact-chooser.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c
index c266e3f..1e61667 100644
--- a/libempathy-gtk/empathy-contact-chooser.c
+++ b/libempathy-gtk/empathy-contact-chooser.c
@@ -22,6 +22,7 @@ G_DEFINE_TYPE (EmpathyContactChooser,
 
 enum {
   SIG_SELECTION_CHANGED,
+  SIG_ACTIVATE,
   LAST_SIGNAL
 };
 
@@ -122,6 +123,15 @@ empathy_contact_chooser_class_init (
             g_cclosure_marshal_generic,
             G_TYPE_NONE,
             1, FOLKS_TYPE_INDIVIDUAL);
+
+  signals[SIG_ACTIVATE] = g_signal_new ("activate",
+            G_TYPE_FROM_CLASS (klass),
+            G_SIGNAL_RUN_LAST,
+            0,
+            NULL, NULL,
+            g_cclosure_marshal_generic,
+            G_TYPE_NONE,
+            0);
 }
 
 static void
@@ -284,6 +294,13 @@ search_text_changed (GtkEntry *entry,
 }
 
 static void
+search_activate_cb (GtkEntry *entry,
+    EmpathyContactChooser *self)
+{
+  g_signal_emit (self, signals[SIG_ACTIVATE], 0);
+}
+
+static void
 empathy_contact_chooser_init (EmpathyContactChooser *self)
 {
   EmpathyIndividualManager *mgr;
@@ -309,6 +326,8 @@ empathy_contact_chooser_init (EmpathyContactChooser *self)
 
   g_signal_connect (self->priv->search_entry, "changed",
       G_CALLBACK (search_text_changed), self);
+  g_signal_connect (self->priv->search_entry, "activate",
+      G_CALLBACK (search_activate_cb), self);
 
   /* Add the treeview */
   mgr = empathy_individual_manager_dup_singleton ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]