show error dialog for lost connection, after

10 reconnect attempts has failed.
No need of po update.
This commit is contained in:
Dimitur Kirov 2006-04-14 09:01:24 +00:00
parent a7fe49be20
commit e6981f6f2b
1 changed files with 9 additions and 5 deletions

View File

@ -148,14 +148,18 @@ class Connection(ConnectionHandlers):
elif self.on_connect_failure: elif self.on_connect_failure:
self.on_connect_failure() self.on_connect_failure()
else: else:
self.dispatch('ERROR', # show error dialog
(_('Connection with account "%s" has been lost') % self.name, self._connection_lost()
_('To continue sending and receiving messages, you will need to reconnect.')))
else: else:
self.disconnect() self.disconnect()
self.on_purpose = False self.on_purpose = False
# END disconenctedReconnCB # END disconenctedReconnCB
def _connection_lost(self):
self.dispatch('ERROR',
(_('Connection with account "%s" has been lost') % self.name,
_('To continue sending and receiving messages, you will need to reconnect.')))
def _event_dispatcher(self, realm, event, data): def _event_dispatcher(self, realm, event, data):
if realm == common.xmpp.NS_REGISTER: if realm == common.xmpp.NS_REGISTER:
if event == common.xmpp.features_nb.REGISTER_DATA_RECEIVED: if event == common.xmpp.features_nb.REGISTER_DATA_RECEIVED:
@ -337,8 +341,8 @@ class Connection(ConnectionHandlers):
if self.on_connect_failure: if self.on_connect_failure:
self.on_connect_failure() self.on_connect_failure()
else: else:
#FIXME show error dialog that connection is lost (line 151) # shown error dialog
pass self._connection_lost()
else: else:
# try reconnect if connection has failed before auth to server # try reconnect if connection has failed before auth to server
self._disconnectedReconnCB() self._disconnectedReconnCB()