Discussion:
[Synce-devel] [synce-gnome] PATCH Make Enter submit password dialog
petr bug
2007-09-16 21:24:26 UTC
Permalink
To reproduce
1) Enable password protection on your device
2) Make sure synce-gnome/src/test.py is running (not synce-engine)
3) Plug the device to USB (or bluetoothe, not tested). Password dialog appears.
4) Type password to the dialog
5) Press Enter key

What happens: Dialog remains open, the keypress was ignored.
What should happen: Dialog should be submited as if OK button were
clicked by mouse.

This patch also reorders buttons so that the default action is on the
right (see Gnome Human Interface Guidelines).

This patch also removes vertical bar separating password box and the
buttons. I find it more aesthetic.


--- synce/synce-gnome/src/test.py (revision 2955)
+++ synce/synce-gnome/src/test.py (working copy)
@@ -84,6 +84,7 @@
flags = self.dev_iface.GetPasswordFlags()

if flags & ODCCM_DEVICE_PASSWORD_FLAG_PROVIDE:
+ print "Device requires password, asking user"
authenticated = False
while not authenticated:
dlg = EntryDialog(None, "Password required",
@@ -97,10 +98,12 @@
class EntryDialog(gtk.Dialog):
def __init__(self, parent, title, text, password=False):
gtk.Dialog.__init__(self, title, parent,
- gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
- (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
- gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
+ gtk.DIALOG_MODAL |
gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR,
+ (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
+ gtk.STOCK_OK, gtk.RESPONSE_ACCEPT |
gtk.CAN_DEFAULT)
+ )

+ self.set_default_response(gtk.RESPONSE_ACCEPT)
label = gtk.Label(text)
label.set_alignment(0.0, 0.5)
self.vbox.pack_start(label, False)
@@ -108,6 +111,7 @@

entry = gtk.Entry()
entry.set_visibility(not password)
+ entry.set_activates_default(True)
self.vbox.pack_start(entry, False, True, 5)
self._entry = entry
David Eriksson
2007-09-17 15:36:26 UTC
Permalink
Post by petr bug
To reproduce
1) Enable password protection on your device
2) Make sure synce-gnome/src/test.py is running (not synce-engine)
3) Plug the device to USB (or bluetoothe, not tested). Password dialog appears.
4) Type password to the dialog
5) Press Enter key
What happens: Dialog remains open, the keypress was ignored.
What should happen: Dialog should be submited as if OK button were
clicked by mouse.
This patch also reorders buttons so that the default action is on the
right (see Gnome Human Interface Guidelines).
This patch also removes vertical bar separating password box and the
buttons. I find it more aesthetic.
Hi!

Could you please attach the patch instead? Thanks!

\David
--
petr bug
2007-09-17 21:32:50 UTC
Permalink
Post by David Eriksson
Could you please attach the patch instead? Thanks!
Here it is a a attachment. (For those with scrambling mail agent, e.g.
sourceforge.) Sory, David, for spamming you.

petr4
Jonny Lamb
2007-09-18 15:21:02 UTC
Permalink
Post by petr bug
Here it is a a attachment. (For those with scrambling mail agent, e.g.
sourceforge.) Sory, David, for spamming you.
Wicked. Committed in r3025.
--
Jonny Lamb, UK ***@jonnylamb.com
http://jonnylamb.com GPG: 0x2E039402
Dr J A Gow
2007-09-25 21:41:12 UTC
Permalink
Post by Jonny Lamb
Post by petr bug
Here it is a a attachment. (For those with scrambling mail agent, e.g.
sourceforge.) Sory, David, for spamming you.
Wicked. Committed in r3025.
Just folded this into authgui.py in sync-engine. Thanks!

John.

Loading...