[telepathy-account-widgets] account-widget: Hitting ENTER should also emit GtkDialog::response



commit 0bad64b02bf3e9fd1c0d24c249951f15c4114b60
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Jun 6 17:24:19 2016 +0200

    account-widget: Hitting ENTER should also emit GtkDialog::response
    
    If the widget is inside a GtkDialog, then clicking one of the response
    buttons emits GtkDialog::response, as one would expect. However, just
    hitting ENTER inside a GtkEntry doesn't. This is an awkward
    inconsistency for applications using this widget.
    
    From now on, when TpawAccountWidget is inside a GtkDialog, it will emit
    GtkDialog::response followed by TpawAccountWidget::close when the
    widget has finished adding the account.
    
    Fall out from b838c54c673165a9d948b18f21580a0ca94f8cd5
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767295

 tp-account-widgets/tpaw-account-widget.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/tp-account-widgets/tpaw-account-widget.c b/tp-account-widgets/tpaw-account-widget.c
index 9ba43af..b225246 100644
--- a/tp-account-widgets/tpaw-account-widget.c
+++ b/tp-account-widgets/tpaw-account-widget.c
@@ -565,6 +565,9 @@ tpaw_account_widget_setup_widget (TpawAccountWidget *self,
 
       if (strstr (param_name, "password"))
         {
+          if (self->priv->dialog != NULL)
+            gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
+
           gtk_entry_set_visibility (GTK_ENTRY (widget), FALSE);
 
           /* Add 'clear' icon */
@@ -582,8 +585,13 @@ tpaw_account_widget_setup_widget (TpawAccountWidget *self,
               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);
+        {
+          if (self->priv->dialog != NULL)
+            gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
+
+          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]