From: <umg...@us...> - 2007-06-20 18:04:17
|
Revision: 434 http://svn.sourceforge.net/pybridge/?rev=434&view=rev Author: umgangee Date: 2007-06-20 11:04:19 -0700 (Wed, 20 Jun 2007) Log Message: ----------- When connection fails unexpectedly, provide a Reconnect option to user. Modified Paths: -------------- trunk/pybridge/pybridge/ui/window_main.py Modified: trunk/pybridge/pybridge/ui/window_main.py =================================================================== --- trunk/pybridge/pybridge/ui/window_main.py 2007-06-20 15:15:27 UTC (rev 433) +++ trunk/pybridge/pybridge/ui/window_main.py 2007-06-20 18:04:19 UTC (rev 434) @@ -120,17 +120,20 @@ def event_connectionLost(self, host, port): dialog = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_MODAL, - type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK) + type=gtk.MESSAGE_ERROR) dialog.set_title(_('Connection to server lost')) dialog.set_markup(_('The connection to %s was lost unexpectedly.' % host)) - dialog.format_secondary_text(_('Please check your computer\'s network connection status. If you cannot reconnect, the server may be offline.')) + dialog.format_secondary_text(_('Please check your computer\'s network connection status before reconnecting. If you cannot reconnect, the server may be offline.')) # If this problem persists... - #dialog.add_button() - def dialog_response_cb(dialog, response_id): dialog.destroy() + if response_id == gtk.RESPONSE_OK: + wm.open(DialogConnection, parent=self) + dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) + dialog.add_button(gtk.STOCK_CONNECT, gtk.RESPONSE_OK) + dialog.connect('response', dialog_response_cb) dialog.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |