From 8fcaa914e11a1ab4cb6d4174bb3f6e1ddcd5700f Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 5 Aug 2009 20:53:58 +0200 Subject: [PATCH] ability to use anonymous authentication --- .../account_creation_wizard_window.glade | 169 ++++++++++----- data/glade/accounts_window.glade | 197 +++++++++++------- src/common/config.py | 1 + src/common/connection.py | 8 +- src/config.py | 195 ++++++++++------- 5 files changed, 363 insertions(+), 207 deletions(-) diff --git a/data/glade/account_creation_wizard_window.glade b/data/glade/account_creation_wizard_window.glade index 8458e66e6..028492ba3 100644 --- a/data/glade/account_creation_wizard_window.glade +++ b/data/glade/account_creation_wizard_window.glade @@ -1,7 +1,7 @@ - - - + + + 12 Gajim: Account Creation Wizard @@ -30,13 +30,14 @@ to the Jabber network. False False + 0 True 0 - GTK_SHADOW_NONE + none True @@ -49,25 +50,26 @@ to the Jabber network. 6 + I already have an account I want to _use True True - I already have an account I want to _use + False True - 0 True False False + 0 + I want to _register for a new account True True - I want to _register for a new account + False True - 0 True use_existing_account_radiobutton @@ -105,8 +107,8 @@ to the Jabber network. True - tab False + tab @@ -124,12 +126,13 @@ to the Jabber network. False False + 0 True - 2 + 3 4 12 6 @@ -154,21 +157,21 @@ to the Jabber network. password_entry - 1 - 2 + 2 + 3 GTK_FILL + Save pass_word True True + False If checked, Gajim will remember the password for this account - Save pass_word True False - 0 True True @@ -176,8 +179,8 @@ to the Jabber network. 2 4 - 1 - 2 + 2 + 3 GTK_FILL @@ -192,8 +195,8 @@ to the Jabber network. 1 2 - 1 - 2 + 2 + 3 @@ -225,10 +228,6 @@ to the Jabber network. True - - - - 3 @@ -237,6 +236,26 @@ to the Jabber network. GTK_FILL + + + Anon_ymous authentication + True + True + False + True + True + + + + 1 + 4 + 1 + 2 + + + + + False @@ -253,9 +272,9 @@ to the Jabber network. True - tab 1 False + tab @@ -273,6 +292,7 @@ to the Jabber network. False False + 0 @@ -289,15 +309,12 @@ to the Jabber network. False False + 0 True - - - - 1 @@ -310,6 +327,20 @@ to the Jabber network. 1 + + + Anon_ymous authentication + True + True + False + True + True + + + False + 2 + + True @@ -347,11 +378,11 @@ to the Jabber network. + Manage... True True - Manage... + False True - 0 @@ -363,11 +394,11 @@ to the Jabber network. + Use custom hostname/port True True - Use custom hostname/port + False True - 0 True @@ -394,6 +425,7 @@ to the Jabber network. False False + 0 @@ -454,7 +486,7 @@ to the Jabber network. - 2 + 3 @@ -467,9 +499,9 @@ to the Jabber network. True - tab 2 False + tab @@ -484,10 +516,11 @@ to the Jabber network. True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-dialog-warning - 5 + 5 False + 0 @@ -502,17 +535,18 @@ to the Jabber network. False + 0 - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Add this certificate to the list of trusted certificates. SHA1 fingerprint of the certificate: - 0 + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True @@ -530,9 +564,9 @@ SHA1 fingerprint of the certificate: True - tab 3 False + tab @@ -551,9 +585,9 @@ SHA1 fingerprint of the certificate: True - tab 4 False + tab @@ -566,10 +600,11 @@ SHA1 fingerprint of the certificate: Please wait... True - GTK_JUSTIFY_CENTER + center False + 0 @@ -593,9 +628,9 @@ Please wait... True - tab 5 False + tab @@ -613,6 +648,7 @@ Please wait... False False + 0 @@ -627,14 +663,17 @@ Please wait... + + 0 + + Connect when I press Finish True True - Connect when I press Finish + False True - 0 True True @@ -646,11 +685,11 @@ Please wait... + Set my profile when I connect True True - Set my profile when I connect + False True - 0 True True @@ -670,56 +709,68 @@ Please wait... True - tab 6 False + tab + + 0 + True 12 - GTK_BUTTONBOX_END + end + gtk-cancel True True True - gtk-cancel + False True - 0 + + False + False + 0 + + gtk-go-back True False True True - gtk-go-back + False True - 0 + False + False 1 + gtk-go-forward True True True True - gtk-go-forward + False True - 0 + False + False 2 @@ -727,8 +778,8 @@ Please wait... True True + False True - 0 @@ -747,6 +798,7 @@ Please wait... False False + 0 @@ -767,6 +819,8 @@ Please wait... + False + False 3 @@ -774,8 +828,8 @@ Please wait... True True + False True - 0 @@ -794,6 +848,7 @@ Please wait... False False + 0 @@ -814,6 +869,8 @@ Please wait... + False + False 4 diff --git a/data/glade/accounts_window.glade b/data/glade/accounts_window.glade index f74128ad9..55daa9acc 100644 --- a/data/glade/accounts_window.glade +++ b/data/glade/accounts_window.glade @@ -1,12 +1,12 @@ - - - + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 Accounts - 700 + 800 @@ -30,9 +30,9 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN + automatic + automatic + in True @@ -43,16 +43,18 @@ + + 0 + + gtk-add True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-add True - 0 @@ -62,13 +64,12 @@ + gtk-remove True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove True - 0 @@ -82,7 +83,6 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 @@ -96,6 +96,7 @@ False + 0 @@ -177,7 +178,7 @@ 6 6 - + True 0 _Jabber ID: @@ -224,13 +225,13 @@ + Save pass_word True True + False If checked, Gajim will remember the password for this account - Save pass_word True False - 0 True @@ -275,12 +276,12 @@ + A_djust to status True True + False Priority will change automatically according to your status. - A_djust to status True - 0 True @@ -323,26 +324,27 @@ True + Synchronise contacts True True + False Click to request authorization to all contacts of another account - Synchronise contacts True - 0 False + 0 + Chan_ge Password True True + False Click to change account's password - Chan_ge Password True - 0 @@ -379,7 +381,7 @@ 1 - 3 + 2 @@ -400,6 +402,22 @@ + + + Anonymous authentication + True + True + False + True + + + + 2 + 3 + GTK_FILL + + + @@ -408,8 +426,8 @@ Account - tab False + tab @@ -419,27 +437,28 @@ 6 + C_onnect on Gajim startup True True + False If checked, Gajim, when launched, will automatically connect to jabber using this account - C_onnect on Gajim startup True - 0 True False False + 0 + Auto-reconnect when connection is lost True True - Auto-reconnect when connection is lost + False True - 0 True @@ -451,11 +470,11 @@ + Save conversation _logs for all contacts True True - Save conversation _logs for all contacts + False True - 0 True True @@ -468,12 +487,12 @@ + Synch_ronize account status with global status True True + False If checked, any change to the global status (handled by the combobox at the bottom of the roster window) will change the status of this account accordingly - Synch_ronize account status with global status True - 0 True @@ -485,12 +504,12 @@ + Use file transfer proxies True True + False If checked, Gajim will also broadcast some more IPs except from just your IP, so file transfer has higher chances of working. - Use file transfer proxies True - 0 True @@ -512,9 +531,9 @@ True - tab 1 False + tab @@ -527,7 +546,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE + none True @@ -541,17 +560,18 @@ 6 + _use HTTP__PROXY environment variable True True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _use HTTP__PROXY environment variable True - 0 True False + 0 @@ -564,14 +584,17 @@ None + + 0 + + _Manage... True True - _Manage... + False True - 0 @@ -602,12 +625,15 @@ + + 0 + True 0 - GTK_SHADOW_NONE + none True @@ -619,28 +645,29 @@ 6 + _Warn before using an insecure connection True True + False Check this so Gajim will ask you before sending your password over an insecure connection. - _Warn before using an insecure connection True - 0 True False False + 0 + Send _keep-alive packets True True + False If checked, Gajim will send keep-alive packets to prevent connection timeout which results in disconnection - Send _keep-alive packets True - 0 True True @@ -653,11 +680,11 @@ + Use cust_om hostname/port True True - Use cust_om hostname/port + False True - 0 True @@ -681,6 +708,7 @@ False False + 0 @@ -754,9 +782,9 @@ Connection - tab 2 False + tab @@ -768,7 +796,7 @@ True 0 - GTK_SHADOW_NONE + none True @@ -792,6 +820,7 @@ False False + 0 @@ -806,11 +835,11 @@ + Choose _Key... True True - Choose _Key... + False True - 0 @@ -822,17 +851,18 @@ False + 0 + Use G_PG Agent True False True + False If checked, Gajim will get the password from a GPG agent like seahorse - Use G_PG Agent True - 0 True @@ -859,13 +889,14 @@ False + 0 True 0 - GTK_SHADOW_NONE + none True @@ -873,12 +904,12 @@ 12 + _Edit Personal Information... True True + False Information about you, as stored in the server - _Edit Personal Information... True - 0 @@ -911,9 +942,9 @@ Personal Information - tab 3 False + tab @@ -933,17 +964,18 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + _Enable True True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _Enable True - 0 True False + 0 @@ -957,27 +989,28 @@ 6 + Co_nnect on Gajim startup True True + False If checked, Gajim, when launched, will automatically connect to jabber using this account - Co_nnect on Gajim startup True - 0 True False False + 0 + Save conversation _logs for all contacts True True - Save conversation _logs for all contacts + False True - 0 True @@ -989,12 +1022,12 @@ + Synchroni_ze account status with global status True True + False If checked, any change to the global status (handled by the combobox at the bottom of the roster window) will change the status of this account accordingly - Synchroni_ze account status with global status True - 0 True @@ -1009,19 +1042,20 @@ True + Use cust_om port: True True + False If the default port that is used for incoming messages is unfitting for your setup you can select another one here. You might consider to change possible firewall settings. - Use cust_om port: True - 0 True False False + 0 @@ -1053,8 +1087,8 @@ You might consider to change possible firewall settings. True - tab False + tab @@ -1079,6 +1113,7 @@ You might consider to change possible firewall settings. False False + 0 @@ -1093,6 +1128,7 @@ You might consider to change possible firewall settings. False False + 0 @@ -1105,11 +1141,11 @@ You might consider to change possible firewall settings. + Choose _Key... True True - Choose _Key... + False True - 0 @@ -1125,12 +1161,12 @@ You might consider to change possible firewall settings. + Use G_PG Agent True True + False If checked, Gajim will get the password from a GPG agent like seahorse - Use G_PG Agent True - 0 True @@ -1276,9 +1312,9 @@ You might consider to change possible firewall settings. Personal Information - tab 1 False + tab @@ -1304,15 +1340,18 @@ You might consider to change possible firewall settings. + + 0 + + Mer_ge accounts True True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Mer_ge accounts True - 0 True @@ -1325,18 +1364,22 @@ You might consider to change possible firewall settings. True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 6 - GTK_BUTTONBOX_END + end + gtk-close True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-close True - 0 + + False + False + 0 + diff --git a/src/common/config.py b/src/common/config.py index 4e5104dda..ff780715a 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -265,6 +265,7 @@ class Config: 'accounts': ({ 'name': [ opt_str, '', '', True ], 'hostname': [ opt_str, '', '', True ], + 'anonymous_auth': [ opt_bool, False ], 'savepass': [ opt_bool, False ], 'password': [ opt_str, '' ], 'resource': [ opt_str, 'gajim', '', True ], diff --git a/src/common/connection.py b/src/common/connection.py index c155bd1a2..1fb866ade 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -700,7 +700,10 @@ class Connection(ConnectionHandlers): self._current_host['host'], self._current_host['port'], con_type)) self.last_connection_type = con_type - name = gajim.config.get_per('accounts', self.name, 'name') + if gajim.config.get_per('accounts', self.name, 'anonymous_auth'): + name = None + else: + name = gajim.config.get_per('accounts', self.name, 'name') hostname = gajim.config.get_per('accounts', self.name, 'hostname') self.connection = con try: @@ -775,6 +778,9 @@ class Connection(ConnectionHandlers): return if hasattr(con, 'Resource'): self.server_resource = con.Resource + if gajim.config.get_per('accounts', self.name, 'anonymous_auth'): + # Get jid given by server + gajim.config.set_per('accounts', self.name, 'name', con.User) if auth: self.last_io = gajim.idlequeue.current_time() self.connected = 2 diff --git a/src/config.py b/src/config.py index 2fcad148d..43f030bc1 100644 --- a/src/config.py +++ b/src/config.py @@ -1553,23 +1553,44 @@ class AccountsWindow: use_gpg_agent_checkbutton.set_sensitive(True) use_gpg_agent_checkbutton.set_active(use_gpg_agent) + def draw_normal_jid(self): + account = self.current_account + self.ignore_events = True + if gajim.config.get_per('accounts', account, 'anonymous_auth'): + self.xml.get_widget('anonymous_checkbutton1').set_active(True) + self.xml.get_widget('jid_label1').set_text(_('Server:')) + save_password = self.xml.get_widget('save_password_checkbutton1') + save_password.set_active(False) + save_password.set_sensitive(False) + password_entry = self.xml.get_widget('password_entry1') + password_entry.set_text('') + password_entry.set_sensitive(False) + jid = gajim.config.get_per('accounts', account, 'hostname') + else: + self.xml.get_widget('anonymous_checkbutton1').set_active(False) + self.xml.get_widget('jid_label1').set_text(_('Jabber ID:')) + savepass = gajim.config.get_per('accounts', account, 'savepass') + save_password = self.xml.get_widget('save_password_checkbutton1') + save_password.set_sensitive(True) + save_password.set_active(savepass) + password_entry = self.xml.get_widget('password_entry1') + if savepass: + passstr = passwords.get_password(account) or '' + password_entry.set_sensitive(True) + else: + passstr = '' + password_entry.set_sensitive(False) + password_entry.set_text(passstr) + + jid = gajim.config.get_per('accounts', account, 'name') \ + + '@' + gajim.config.get_per('accounts', account, 'hostname') + self.xml.get_widget('jid_entry1').set_text(jid) + self.ignore_events = False + def init_normal_account(self): account = self.current_account # Account tab - jid = gajim.config.get_per('accounts', account, 'name') \ - + '@' + gajim.config.get_per('accounts', account, 'hostname') - self.xml.get_widget('jid_entry1').set_text(jid) - savepass = gajim.config.get_per('accounts', account, 'savepass') - self.xml.get_widget('save_password_checkbutton1').set_active(savepass) - password_entry = self.xml.get_widget('password_entry1') - if savepass: - passstr = passwords.get_password(account) or '' - password_entry.set_sensitive(True) - else: - passstr = '' - password_entry.set_sensitive(False) - password_entry.set_text(passstr) - + self.draw_normal_jid() self.xml.get_widget('resource_entry1').set_text(gajim.config.get_per( 'accounts', account, 'resource')) self.xml.get_widget('adjust_priority_with_status_checkbutton1').\ @@ -1817,7 +1838,8 @@ class AccountsWindow: return True jid_splited = jid.split('@', 1) - if len(jid_splited) != 2: + if len(jid_splited) != 2 and not gajim.config.get_per('accounts', + self.current_account, 'anonymous_auth'): if not widget.is_focus(): pritext = _('Invalid Jabber ID') sectext = _('A Jabber ID must be in the form "user@servername".') @@ -1825,14 +1847,30 @@ class AccountsWindow: gobject.idle_add(lambda: widget.grab_focus()) return True - if self.option_changed('name', jid_splited[0]) or \ - self.option_changed('hostname', jid_splited[1]): - self.need_relogin = True - gajim.config.set_per('accounts', self.current_account, 'name', - jid_splited[0]) - gajim.config.set_per('accounts', self.current_account, 'hostname', - jid_splited[1]) + if gajim.config.get_per('accounts', self.current_account, + 'anonymous_auth'): + gajim.config.set_per('accounts', self.current_account, 'hostname', + jid_splited[0]) + if self.option_changed('hostname', jid_splited[0]): + self.need_relogin = True + else: + if self.option_changed('name', jid_splited[0]) or \ + self.option_changed('hostname', jid_splited[1]): + self.need_relogin = True + + gajim.config.set_per('accounts', self.current_account, 'name', + jid_splited[0]) + gajim.config.set_per('accounts', self.current_account, 'hostname', + jid_splited[1]) + + def on_anonymous_checkbutton1_toggled(self, widget): + if self.ignore_events: + return + active = widget.get_active() + gajim.config.set_per('accounts', self.current_account, 'anonymous_auth', + active) + self.draw_normal_jid() def on_password_entry1_changed(self, widget): if self.ignore_events: @@ -3077,6 +3115,42 @@ class AccountCreationWizardWindow: else: self.notebook.set_current_page(2) # Go to server page + def on_anonymous_checkbutton1_toggled(self, widget): + active = widget.get_active() + self.xml.get_widget('username_entry').set_sensitive(not active) + self.xml.get_widget('password_entry').set_sensitive(not active) + self.xml.get_widget('save_password_checkbutton').set_sensitive(not active) + + def show_finish_page(self): + self.cancel_button.hide() + self.back_button.hide() + self.forward_button.hide() + if self.modify: + finish_text = '%s\n\n%s' % ( + _('Account has been added successfully'), + _('You can set advanced account options by pressing the ' + 'Advanced button, or later by choosing the Accounts menuitem ' + 'under the Edit menu from the main window.')) + else: + finish_text = '%s\n\n%s' % ( + _('Your new account has been created successfully'), + _('You can set advanced account options by pressing the Advanced ' + 'button, or later by choosing the Accounts menuitem under the Edit ' + 'menu from the main window.')) + self.finish_label.set_markup(finish_text) + self.finish_button.show() + self.finish_button.set_property('has-default', True) + self.advanced_button.show() + self.go_online_checkbutton.show() + img = self.xml.get_widget('finish_image') + if self.modify: + img.set_from_stock(gtk.STOCK_APPLY, gtk.ICON_SIZE_DIALOG) + else: + path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps', 'gajim.png') + img.set_from_file(path_to_file) + self.show_vcard_checkbutton.set_active(not self.modify) + self.notebook.set_current_page(6) # show finish page + def on_forward_button_clicked(self, widget): cur_page = self.notebook.get_current_page() @@ -3093,9 +3167,10 @@ class AccountCreationWizardWindow: elif cur_page == 1: # We are adding an existing account + anonymous = self.xml.get_widget('anonymous_checkbutton1').get_active() username = self.xml.get_widget('username_entry').get_text().decode( 'utf-8').strip() - if not username: + if not username and not anonymous: pritext = _('Invalid username') sectext = _( 'You must provide a username to configure this account.') @@ -3124,25 +3199,11 @@ class AccountCreationWizardWindow: i += 1 username, server = gajim.get_name_and_server_from_jid(jid) - self.save_account(username, server, savepass, password) - self.cancel_button.hide() - self.back_button.hide() - self.forward_button.hide() - if self.modify: - finish_text = '%s\n\n%s' % ( - _('Account has been added successfully'), - _('You can set advanced account options by pressing the ' - 'Advanced button, or later by choosing the Accounts menuitem ' - 'under the Edit menu from the main window.')) - self.finish_label.set_markup(finish_text) - self.finish_button.show() - self.finish_button.set_property('has-default', True) - self.advanced_button.show() - self.go_online_checkbutton.show() - img = self.xml.get_widget('finish_image') - img.set_from_stock(gtk.STOCK_APPLY, gtk.ICON_SIZE_DIALOG) - self.notebook.set_current_page(6) # show finish page - self.show_vcard_checkbutton.set_active(False) + if self.xml.get_widget('anonymous_checkbutton1').get_active(): + self.save_account('', server, False, '', anonymous=True) + else: + self.save_account(username, server, savepass, password) + self.show_finish_page() elif cur_page == 2: # We are creating a new account server = self.xml.get_widget('server_comboboxentry1').child.get_text()\ @@ -3180,15 +3241,20 @@ class AccountCreationWizardWindow: config['custom_host'] = self.xml.get_widget( 'custom_host_entry').get_text().decode('utf-8') - self.notebook.set_current_page(5) # show creating page - self.back_button.hide() - self.forward_button.hide() - self.update_progressbar_timeout_id = gobject.timeout_add(100, - self.update_progressbar) - # Get form from serveur - con = connection.Connection(self.account) - gajim.connections[self.account] = con - con.new_account(self.account, config) + if self.xml.get_widget('anonymous_checkbutton2').get_active(): + self.modify = True + self.save_account('', server, False, '', anonymous=True) + self.show_finish_page() + else: + self.notebook.set_current_page(5) # show creating page + self.back_button.hide() + self.forward_button.hide() + self.update_progressbar_timeout_id = gobject.timeout_add(100, + self.update_progressbar) + # Get form from serveur + con = connection.Connection(self.account) + gajim.connections[self.account] = con + con.new_account(self.account, config) elif cur_page == 3: checked = self.xml.get_widget('ssl_checkbutton').get_active() if checked: @@ -3308,25 +3374,7 @@ class AccountCreationWizardWindow: def acc_is_ok(self, config): '''Account creation succeeded''' self.create_vars(config) - self.cancel_button.hide() - self.back_button.hide() - self.forward_button.hide() - self.finish_button.show() - self.finish_button.set_property('has-default', True) - self.advanced_button.show() - self.go_online_checkbutton.show() - self.show_vcard_checkbutton.show() - img = self.xml.get_widget('finish_image') - path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps', 'gajim.png') - img.set_from_file(path_to_file) - - finish_text = '%s\n\n%s' % ( - _('Your new account has been created successfully'), - _('You can set advanced account options by pressing the Advanced ' - 'button, or later by choosing the Accounts menuitem under the Edit ' - 'menu from the main window.')) - self.finish_label.set_markup(finish_text) - self.notebook.set_current_page(6) # show finish page + self.show_finish_page() if self.update_progressbar_timeout_id is not None: gobject.source_remove(self.update_progressbar_timeout_id) @@ -3386,13 +3434,14 @@ class AccountCreationWizardWindow: username_entry.set_position(-1) return True - def get_config(self, login, server, savepass, password): + def get_config(self, login, server, savepass, password, anonymous=False): config = {} config['name'] = login config['hostname'] = server config['savepass'] = savepass config['password'] = password config['resource'] = 'Gajim' + config['anonymous_auth'] = anonymous config['priority'] = 5 config['autoconnect'] = True config['no_log_for'] = '' @@ -3406,7 +3455,7 @@ class AccountCreationWizardWindow: config['keyid'] = '' return config - def save_account(self, login, server, savepass, password): + def save_account(self, login, server, savepass, password, anonymous=False): if self.account in gajim.connections: dialogs.ErrorDialog(_('Account name is in use'), _('You already have an account using this name.')) @@ -3414,7 +3463,7 @@ class AccountCreationWizardWindow: con = connection.Connection(self.account) con.password = password - config = self.get_config(login, server, savepass, password) + config = self.get_config(login, server, savepass, password, anonymous) if not self.modify: con.new_account(self.account, config)