]> git.0d.be Git - empathy.git/commitdiff
contact-chooser: add 'activate' signal
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 17 Oct 2011 12:10:01 +0000 (14:10 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 18 Oct 2011 08:46:21 +0000 (10:46 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=661993

libempathy-gtk/empathy-contact-chooser.c

index c266e3febd8247f57701f223292e5f5c8de22da7..1e61667fae9f1e4ccba933aec9189522c3da6381 100644 (file)
@@ -22,6 +22,7 @@ G_DEFINE_TYPE (EmpathyContactChooser,
 
 enum {
   SIG_SELECTION_CHANGED,
 
 enum {
   SIG_SELECTION_CHANGED,
+  SIG_ACTIVATE,
   LAST_SIGNAL
 };
 
   LAST_SIGNAL
 };
 
@@ -122,6 +123,15 @@ empathy_contact_chooser_class_init (
             g_cclosure_marshal_generic,
             G_TYPE_NONE,
             1, FOLKS_TYPE_INDIVIDUAL);
             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
 }
 
 static void
@@ -283,6 +293,13 @@ search_text_changed (GtkEntry *entry,
   empathy_individual_view_refilter (self->priv->view);
 }
 
   empathy_individual_view_refilter (self->priv->view);
 }
 
+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)
 {
 static void
 empathy_contact_chooser_init (EmpathyContactChooser *self)
 {
@@ -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, "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 ();
 
   /* Add the treeview */
   mgr = empathy_individual_manager_dup_singleton ();