Set default button on popups

Bug #513978 reported by Emilien Klein
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Lernid
Fix Released
Low
Unassigned

Bug Description

The popups (login and open url) don't have a default button, which means that when you press Enter, nothing happens. Pressing Enter should have the same effect as pressing "Connect" or "Open".

Note: The login popup accepts Enter when you tab into the field containing the nickname, but not when the Event chooser combobox has the focus.

Related branches

description: updated
Revision history for this message
Michael Budde (mbudde) wrote :

I have fixed the open URL dialog. Do don't think there's much I can do about the connect dialog though. I don't think combo boxes sends any signals when enter is clicked. Perhaps the entry widget should be the default instead?

Changed in lernid:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Emilien Klein (emilien-klein) wrote :

Yes, you might change the order, first the nickname and then the event combobox?

But then, someone might change the event and then press enter, and nothing would happen. Would it be possible to use it's key-release-event? http://library.gnome.org/devel/gtk/unstable/GtkWidget.html#GtkWidget-key-release-event

Revision history for this message
Michael Budde (mbudde) wrote :

Actually I wasn't thinking of moving the events around but just making
the entry the default widget. So the focus be start in the entry and if
you wanted to change the event you would have to shift-tab back to the
combo box.

I'm not sure if that's a good way to do it. Actually I think I would
prefer to leave it as it is now. We're talking one key press here and I
suppose most people would use a mouse anyway.

About the key-release-event; I'm pretty sure that won't work. But you
are free to try it out :)

Revision history for this message
Sanne Wouda (snnw) wrote :

The most common use-case for the connect dialog is to check the pre-filled values and hit Connect. Using the combo-box to change the event would be with the mouse. Changing nick is only necessary on Lernid's first run, but this is obviously with keyboard. So, to me it makes most sense to give the entry focus.

Attaching one-line patch:)

Revision history for this message
Sanne Wouda (snnw) wrote :

The most common use-case for the connect dialog is to check the pre-filled values and hit Connect. Using the combo-box to change the event would be with the mouse. Changing nick is only necessary on Lernid's first run, but this is obviously with keyboard. So, to me it makes most sense to give the entry focus.

Attaching one-line patch:)

Revision history for this message
Michael Budde (mbudde) wrote :

Lets say that then. If there's any objections, please reopen the bug.

Changed in lernid:
status: Confirmed → Fix Committed
Revision history for this message
Emilien Klein (emilien-klein) wrote :

Let's leave it like this then for now, but to be honest that solution doesn't seem right to me.
The idea of checking the data is correct, but as you said, you'd change the nickname normally just once, so giving it the focus is giving the focus to something what is most likely not going to be changed.
This solutions fixes the problem (not being able to validate the form with Enter directly), but it introduces a usability bug IMHO.

I'll experiment to see if we can do something like this
    if key_pressed == ENTER:
        validate

using the combobox's key-release-event...

Revision history for this message
Emilien Klein (emilien-klein) wrote :

Using key_press_event and filtering on the Enter key and then generating the gtk.RESPONSE_OK response, I was able to produce the desired behavior for the combobox.

In order to give the focus to the first element again, I've also reverted the change introduced in rev 140 (giving focus to nickname entry textbox).

You'll find the code in the linked branch. If you accept that modification, I guess we could close this bug.

Revision history for this message
Emilien Klein (emilien-klein) wrote :

By the way, in case you decide not to use my proposed branch then you'd need to fix the following:
- Connect to an event: the nickname textbox has the focus.
- Disconnect
- Connect again: now the combobox has the focus by default.

But again, let me say that having the second object having the focus is IMHO a usability bug...

Revision history for this message
Sanne Wouda (snnw) wrote :

Ok, I would agree to switching the text entry and combo-box. Changing focus after a disconnect seems inconsistent to me. What do you think, Michael?

Michael Budde (mbudde)
Changed in lernid:
status: Fix Committed → In Progress
Michael Budde (mbudde)
Changed in lernid:
status: In Progress → Fix Committed
Michael Budde (mbudde)
Changed in lernid:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.