petr bug
2007-09-16 21:24:26 UTC
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
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