From: <umg...@us...> - 2007-06-20 15:10:34
|
Revision: 430 http://svn.sourceforge.net/pybridge/?rev=430&view=rev Author: umgangee Date: 2007-06-20 08:10:30 -0700 (Wed, 20 Jun 2007) Log Message: ----------- Display notification dialog when connection is lost unexpectedly. 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:09:13 UTC (rev 429) +++ trunk/pybridge/pybridge/ui/window_main.py 2007-06-20 15:10:30 UTC (rev 430) @@ -96,7 +96,7 @@ # Event handlers. - def event_connectedAsUser(self, username): + def event_loggedIn(self, username): self.notebook.set_property('sensitive', True) self.menu_connect.set_property('visible', False) self.menu_disconnect.set_property('visible', True) @@ -104,7 +104,7 @@ self.newtable.set_property('sensitive', True) - def event_connectionLost(self, reason): + def event_loggedOut(self): for table in self.tables.values(): self.tables.close(table) @@ -118,6 +118,23 @@ self.peopleview_model.clear() + def event_connectionLost(self, host, port): + dialog = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_MODAL, + type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK) + 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.')) + # If this problem persists... + + #dialog.add_button() + + def dialog_response_cb(dialog, response_id): + dialog.destroy() + + dialog.connect('response', dialog_response_cb) + dialog.show() + + def event_gotRoster(self, name, roster): lookup = {'tables' : (self.tableview_model, self.tableview_icon), 'users' : (self.peopleview_model, self.peopleview_icon)} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |