From 89540b0c2e5b42e83af1b8b8eb31510f8ea8c0fa Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 4 Jan 2013 23:11:07 +0100 Subject: [PATCH] fix registering an account --- data/gui/account_creation_wizard_window.ui | 25 +++++++++++----------- src/common/connection.py | 4 ++-- src/common/connection_handlers_events.py | 11 +++++----- src/dataforms_widget.py | 3 ++- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/data/gui/account_creation_wizard_window.ui b/data/gui/account_creation_wizard_window.ui index ea32887cc..f6630681d 100644 --- a/data/gui/account_creation_wizard_window.ui +++ b/data/gui/account_creation_wizard_window.ui @@ -12,6 +12,12 @@ + + + + + + server_liststore 0 @@ -36,6 +42,7 @@ True False + False False @@ -276,7 +283,7 @@ to the Jabber network. False False True - 0.5 + 0 True @@ -404,7 +411,7 @@ to the Jabber network. False False True - 0.5 + 0 True @@ -484,7 +491,7 @@ to the Jabber network. False False True - 0.5 + 0 True @@ -649,7 +656,7 @@ SHA1 fingerprint of the certificate: False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False - 0.5 + 0 True @@ -793,7 +800,7 @@ Please wait... False False True - 0.5 + 0 True True @@ -812,7 +819,7 @@ Please wait... False False True - 0.5 + 0 True True @@ -1028,10 +1035,4 @@ Please wait... - - - - - - diff --git a/src/common/connection.py b/src/common/connection.py index 54efb7e8d..2d802af06 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -913,8 +913,8 @@ class Connection(CommonConnection, ConnectionHandlers): self.connection.SendAndCallForResponse(iq, _on_register_result) else: - if self.new_account_form.keys().sort() != \ - conf.keys().sort(): + if list(self.new_account_form.keys()).sort() != \ + list(conf.keys()).sort(): # requested config has changed since first connection reason = _('Server %s provided a different ' 'registration form') % data[0] diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index 1ac49596a..a41929993 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -1560,12 +1560,13 @@ class NewAccountConnectedEvent(nec.NetworkIncomingEvent): try: self.errnum = self.conn.connection.Connection.ssl_errnum except AttributeError: - self.errnum = -1 # we don't have an errnum + self.errnum = [] # we don't have an errnum self.ssl_msg = '' - if self.errnum > 0: - from common.connection import ssl_error - self.ssl_msg = ssl_error.get(self.errnum, _( - 'Unknown SSL error: %d') % self.errnum) + for er in self.errnum: + if er > 0: + from common.connection import ssl_error + self.ssl_msg = ssl_error.get(er, _('Unknown SSL error: %d') % \ + er) self.ssl_cert = '' if hasattr(self.conn.connection.Connection, 'ssl_cert_pem'): self.ssl_cert = self.conn.connection.Connection.ssl_cert_pem diff --git a/src/dataforms_widget.py b/src/dataforms_widget.py index 1d17be1de..992dbb290 100644 --- a/src/dataforms_widget.py +++ b/src/dataforms_widget.py @@ -26,6 +26,7 @@ single means these with one record of data (without element), multiple - these which may contain more data (with element).''' from gi.repository import Gtk +from gi.repository import Gdk from gi.repository import GdkPixbuf from gi.repository import GObject import base64 @@ -566,7 +567,7 @@ class SingleForm(Gtk.Table, object): for uri in field.media.uris: if uri.type_.startswith('image/'): try: - img_data = base64.decodestring(uri.uri_data) + img_data = base64.b64decode(uri.uri_data) pixbuf_l = GdkPixbuf.PixbufLoader() pixbuf_l.write(img_data) pixbuf_l.close()