From e6981f6f2b80c759298536ca1504cb430a9e2693 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Fri, 14 Apr 2006 09:01:24 +0000 Subject: [PATCH] show error dialog for lost connection, after 10 reconnect attempts has failed. No need of po update. --- src/common/connection.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 13639124e..29f7771f8 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -148,14 +148,18 @@ class Connection(ConnectionHandlers): elif self.on_connect_failure: self.on_connect_failure() else: - self.dispatch('ERROR', - (_('Connection with account "%s" has been lost') % self.name, - _('To continue sending and receiving messages, you will need to reconnect.'))) + # show error dialog + self._connection_lost() else: self.disconnect() self.on_purpose = False # 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): if realm == common.xmpp.NS_REGISTER: if event == common.xmpp.features_nb.REGISTER_DATA_RECEIVED: @@ -337,8 +341,8 @@ class Connection(ConnectionHandlers): if self.on_connect_failure: self.on_connect_failure() else: - #FIXME show error dialog that connection is lost (line 151) - pass + # shown error dialog + self._connection_lost() else: # try reconnect if connection has failed before auth to server self._disconnectedReconnCB()