Merge lp:~emilien-klein/lernid/event-combobox-enter into lp:lernid

Proposed by Emilien Klein
Status: Rejected
Rejected by: Michael Budde
Proposed branch: lp:~emilien-klein/lernid/event-combobox-enter
Merge into: lp:lernid
Diff against target: 38 lines (+10/-1)
2 files modified
data/ui/ConnectDialog.ui (+1/-1)
lernid/ConnectDialog.py (+9/-0)
To merge this branch: bzr merge lp:~emilien-klein/lernid/event-combobox-enter
Reviewer Review Type Date Requested Status
Michael Budde Disapprove
Review via email: mp+18282@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Emilien Klein (emilien-klein) wrote :

Fixes the fact that you couldn't validate the connection popup by pressing Enter when the event combobox had the focus. Also reverting rev 140 (give focus to nickname entry textbox)

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

Thank you for working on this, Emilien. But I'm not sure if it's a good thing to change the behavior of a standard widget. IMHO with rev 140, everything works as a normal user would expect.

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

Well, I don't agree that giving the focus to the second element is what a normal user would expect.

In case you don't want to change the behavior of a standard widget (and I respect your opinion), then you should at least put the nickname textbox at the first place, on top of the event selection combobox. Otherwise you risk confusing users that will try to use the up/down arrow thinking that the combobox has the focus, before realizing that it's actually the textbox that has it.

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

I agree that giving the second widget focus is not good usability but I can also see Sannes point that changing the behavior of a widget is not such a good idea. Users could be used to using enter to activate the combo box. So based on that, I think we should go for moving the two around.

review: Disapprove

Unmerged revisions

141. By Emilien Klein

Make the event combobox generate the default event when pressed Enter. (LP #513978)
Revert giving focus to the nickname textbox (rev 140)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/ui/ConnectDialog.ui'
2--- data/ui/ConnectDialog.ui 2010-01-29 13:31:52 +0000
3+++ data/ui/ConnectDialog.ui 2010-01-29 19:29:11 +0000
4@@ -69,6 +69,7 @@
5 <object class="GtkComboBox" id="event_combo">
6 <property name="visible">True</property>
7 <signal name="changed" handler="check_ready_to_connect"/>
8+ <signal name="key_press_event" handler="combo_key_pressed"/>
9 </object>
10 <packing>
11 <property name="left_attach">1</property>
12@@ -80,7 +81,6 @@
13 <object class="GtkEntry" id="nick_textentry">
14 <property name="visible">True</property>
15 <property name="can_focus">True</property>
16- <property name="has_focus">True</property>
17 <property name="invisible_char">&#x25CF;</property>
18 <property name="activates_default">True</property>
19 <signal name="changed" handler="check_ready_to_connect"/>
20
21=== modified file 'lernid/ConnectDialog.py'
22--- lernid/ConnectDialog.py 2010-01-28 14:51:52 +0000
23+++ lernid/ConnectDialog.py 2010-01-29 19:29:11 +0000
24@@ -90,6 +90,15 @@
25 else:
26 self.builder.get_object("button_connect").set_sensitive(False)
27
28+ def combo_key_pressed(self, widget, event):
29+ """combo_key_pressed - The user has pressed a key.
30+ If it is the enter key, then generate the default event
31+ """
32+ if event.keyval == gtk.keysyms.Return:
33+ self.ok(widget, None)
34+ # As if the default button had been pressed
35+ self.emit('response', gtk.RESPONSE_OK)
36+
37 def get_nick(self):
38 return self.builder.get_object('nick_textentry').get_text()
39

Subscribers

People subscribed via source and target branches