GNOME Bugzilla – Bug 767295
Hitting ENTER inside TpawAccountWidget doesn't emit GtkDialog::response
Last modified: 2016-06-07 07:46:48 UTC
If TpawAccountWidget is placed 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. (Once the account has been created and ready to use, TpawAccountWidget::close is emitted. Without a GtkDialog, as in empathy, there is no GtkDialog::response and TpawAccountWidget::close is the only signal that is emitted.) I don't know of a way to mask the emission of GtkDialog::response because this is a dialog that has been handed down to us from outside, and since there is obvious value in addressing this inconsistency, I think we should ensure that the same signals are emitted regardless of how the form was filled. See bug 730578 for the change to allow specifying a GtkDialog during construction.
Created attachment 329204 [details] [review] account-widget: Hitting ENTER should also emit GtkDialog::response
Since it took me a while to untangle the whole yarn, here is a more verbose account of what is going on here: There are two possibilities when adding an account: - The user hits ENTER after entering the credentials. GtkDialog::response won't be emitted. Instead, only TpawAccountWidget::close will be emitted once the TpAccount has been created and ready for use. - The user clicks the Add button. GtkDialog::response will be emitted with GTK_RESPONSE_APPLY. At this point the operation has just begun - the TpAccount hasn't even been created. Once it is ready, TpawAccountWidget::close will be emitted. Note that this doesn't affect users of this API who don't pass a GtkDialog during construction. So, gnome-control-center / gnome-online-accounts is affected, but empathy isn't.
Comment on attachment 329204 [details] [review] account-widget: Hitting ENTER should also emit GtkDialog::response Pushed to master.