Steps to reproduce:
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) Unplug the device. The dialog is still on screen.
5) Press OK in the dialog
What happens: Dialog remains open, the click was ignored. Subsequent
Cancel and OK do not close the dialog either. Window manager's close
button works.
Probably the best thing to do when device unplugs while password
dialog is still open is to destroy the dialog right away. However it
seem that while a dialog is open D-Bus events are delayed until
application returns to main loop.
So the attached patch just handles exception that is thrown when D-Bus
ProvidePassword() is called on detached device.
--
/Petr4
Index: synce/synce-gnome/src-buttons/test.py
===================================================================
--- synce/synce-gnome/src-buttons/test.py (revision 3043)
+++ synce/synce-gnome/src-buttons/test.py (working copy)
@@ -99,7 +99,21 @@
print "Dialog canceled by user"
dlg.destroy()
return
- authenticated = self.dev_iface.ProvidePassword(dlg.get_text())
+ print "Verifying password..."
+
+ try:
+ authenticated = self.dev_iface.ProvidePassword(dlg.get_text())
+ except:
+ msg = gtk.MessageDialog(
+ dlg, gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
+ "Device disconnected")
+ msg.run()
+ msg.destroy()
+ self._dlg.destroy()
+ return
+
+ print "Verification result %s" % authenticated
dlg.destroy()
if not authenticated:
print "Password mismatch"
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel