[empathy] contact-selector-dialog: emit response when the entry is activated



commit 6101004ea39c479f048d8bdc4f3ce4296fb3dba6
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Dec 15 19:06:28 2009 +0000

    contact-selector-dialog: emit response when the entry is activated

 libempathy-gtk/empathy-contact-selector-dialog.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-selector-dialog.c b/libempathy-gtk/empathy-contact-selector-dialog.c
index de9964d..955487a 100644
--- a/libempathy-gtk/empathy-contact-selector-dialog.c
+++ b/libempathy-gtk/empathy-contact-selector-dialog.c
@@ -219,6 +219,19 @@ contact_selector_change_state_button_cb  (GtkEditable *editable,
 }
 
 static void
+entry_activate_cb (GtkEntry *entry,
+    gpointer self)
+{
+  const gchar *id;
+
+  id = gtk_entry_get_text (entry);
+  if (EMP_STR_EMPTY (id))
+    return;
+
+  gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_ACCEPT);
+}
+
+static void
 empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog)
 {
   EmpathyContactSelectorDialogPriv *priv = GET_PRIV (dialog);
@@ -239,6 +252,10 @@ empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog)
                 NULL);
   g_free (filename);
 
+  empathy_builder_connect (gui, dialog,
+      "entry_id", "activate", entry_activate_cb,
+      NULL);
+
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
   gtk_container_add (GTK_CONTAINER (content_area), priv->table_contact);
 



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