Author: asterix Date: 2009-02-19 15:46:54 +0100 (Thu, 19 Feb 2009) New Revision: 11121
Modified: trunk/src/common/connection.py Log: show Error Dialog with full error message instead of popup when Stream Error arrives. see #4660
Modified: trunk/src/common/connection.py =================================================================== --- trunk/src/common/connection.py 2009-02-19 13:18:23 UTC (rev 11120) +++ trunk/src/common/connection.py 2009-02-19 14:46:54 UTC (rev 11121) @@ -625,12 +625,17 @@ if not self.retrycount and self.connected != 0: self.disconnect(on_purpose = True) self.dispatch('STATUS', 'offline') - sectxt = '' + pritxt = _('Could not connect to "%s"') % self._hostname + sectxt = _('Check your connection or try again later.') if self.streamError: - sectxt = _('Server replied: %s\n') % self.streamError - self.dispatch('CONNECTION_LOST', - (_('Could not connect to "%s"') % self._hostname, - _('%sCheck your connection or try again later.') % sectxt)) + # show error dialog + key = common.xmpp.NS_XMPP_STREAMS + ' ' + self.streamError + if key in common.xmpp.ERRORS: + sectxt2 = _('Server replied: %s') % common.xmpp.ERRORS[key][2] + self.dispatch('ERROR', (pritxt, '%s\n%s' % (sectxt2, sectxt))) + return + # show popup + self.dispatch('CONNECTION_LOST', (pritxt, sectxt))
def on_proxy_failure(self, reason): log.error('Connection to proxy failed: %s' % reason)