[empathy: 1/2] Make <Enter> on the account name try to log in



commit 4de0e218a3e225bbbfbbe3baf91036a262c0f782
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Mon Nov 15 14:51:27 2010 +0100

    Make <Enter> on the account name try to log in
    
    https://bugzilla.gnome.org/show_bug.cgi?id=607146

 libempathy-gtk/empathy-account-widget.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 8a39814..a6237cf 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -180,6 +180,12 @@ account_widget_set_control_buttons_sensitivity (EmpathyAccountWidget *self,
       gtk_widget_set_sensitive (priv->apply_button, sensitive);
       gtk_widget_set_sensitive (priv->cancel_button,
           (sensitive || priv->creating_account) && priv->other_accounts_exist);
+
+      if (sensitive)
+        {
+          gtk_widget_set_can_default (priv->apply_button, TRUE);
+          gtk_widget_grab_default (priv->apply_button);
+        }
     }
 }
 
@@ -470,6 +476,16 @@ password_entry_activated_cb (GtkEntry *entry,
         account_widget_apply_and_log_in (self);
 }
 
+static void
+account_entry_activated_cb (GtkEntry *entry,
+    EmpathyAccountWidget *self)
+{
+    EmpathyAccountWidgetPriv *priv = GET_PRIV (self);
+
+    if (gtk_widget_get_sensitive (priv->apply_button))
+        account_widget_apply_and_log_in (self);
+}
+
 void
 empathy_account_widget_setup_widget (EmpathyAccountWidget *self,
     GtkWidget *widget,
@@ -549,6 +565,10 @@ empathy_account_widget_setup_widget (EmpathyAccountWidget *self,
           g_signal_connect (widget, "activate",
               G_CALLBACK (password_entry_activated_cb), self);
         }
+      else if (strstr (param_name, "account"))
+        g_signal_connect (widget, "activate",
+            G_CALLBACK (account_entry_activated_cb), self);
+
 
       g_signal_connect (widget, "changed",
           G_CALLBACK (account_widget_entry_changed_cb), self);



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