fix indentation
This commit is contained in:
parent
751caeaa42
commit
bc0844f7f1
|
@ -3413,8 +3413,8 @@ class AccountCreationWizardWindow:
|
|||
def on_wizard_window_destroy(self, widget):
|
||||
page = self.notebook.get_current_page()
|
||||
if page in (4, 5) and self.account in gajim.connections:
|
||||
# connection instance is saved in gajim.connections and we canceled the
|
||||
# addition of the account
|
||||
# connection instance is saved in gajim.connections and we canceled
|
||||
# the addition of the account
|
||||
del gajim.connections[self.account]
|
||||
if self.account in gajim.config.get_per('accounts'):
|
||||
gajim.config.del_per('accounts', self.account)
|
||||
|
@ -3461,7 +3461,8 @@ class AccountCreationWizardWindow:
|
|||
active = widget.get_active()
|
||||
self.xml.get_object('username_entry').set_sensitive(not active)
|
||||
self.xml.get_object('password_entry').set_sensitive(not active)
|
||||
self.xml.get_object('save_password_checkbutton').set_sensitive(not active)
|
||||
self.xml.get_object('save_password_checkbutton').set_sensitive(
|
||||
not active)
|
||||
|
||||
def show_finish_page(self):
|
||||
self.cancel_button.hide()
|
||||
|
@ -3476,9 +3477,9 @@ class AccountCreationWizardWindow:
|
|||
else:
|
||||
finish_text = '<big><b>%s</b></big>\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 menu item under the Edit'
|
||||
' menu from the main window.'))
|
||||
_('You can set advanced account options by pressing the '
|
||||
'Advanced button, or later by choosing the Accounts menu item '
|
||||
'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)
|
||||
|
@ -3509,7 +3510,8 @@ class AccountCreationWizardWindow:
|
|||
|
||||
elif cur_page == 1:
|
||||
# We are adding an existing account
|
||||
anonymous = self.xml.get_object('anonymous_checkbutton1').get_active()
|
||||
anonymous = self.xml.get_object('anonymous_checkbutton1').\
|
||||
get_active()
|
||||
username = self.xml.get_object('username_entry').get_text().decode(
|
||||
'utf-8').strip()
|
||||
if not username and not anonymous:
|
||||
|
@ -3518,8 +3520,8 @@ class AccountCreationWizardWindow:
|
|||
'You must provide a username to configure this account.')
|
||||
dialogs.ErrorDialog(pritext, sectext)
|
||||
return
|
||||
server = self.xml.get_object('server_comboboxentry').child.get_text().\
|
||||
decode('utf-8').strip()
|
||||
server = self.xml.get_object('server_comboboxentry').child.\
|
||||
get_text().decode('utf-8').strip()
|
||||
savepass = self.xml.get_object('save_password_checkbutton').\
|
||||
get_active()
|
||||
password = self.xml.get_object('password_entry').get_text().decode(
|
||||
|
@ -3548,8 +3550,8 @@ class AccountCreationWizardWindow:
|
|||
self.show_finish_page()
|
||||
elif cur_page == 2:
|
||||
# We are creating a new account
|
||||
server = self.xml.get_object('server_comboboxentry1').child.get_text()\
|
||||
.decode('utf-8')
|
||||
server = self.xml.get_object('server_comboboxentry1').child.\
|
||||
get_text().decode('utf-8')
|
||||
|
||||
if not server:
|
||||
dialogs.ErrorDialog(_('Invalid server'),
|
||||
|
@ -3610,7 +3612,8 @@ class AccountCreationWizardWindow:
|
|||
f.close()
|
||||
if self.ssl_cert in certs:
|
||||
dialogs.ErrorDialog(_('Certificate Already in File'),
|
||||
_('This certificate is already in file %s, so it\'s not added again.') % gajim.MY_CACERTS)
|
||||
_('This certificate is already in file %s, so it\'s '
|
||||
'not added again.') % gajim.MY_CACERTS)
|
||||
else:
|
||||
f = open(gajim.MY_CACERTS, 'a')
|
||||
f.write(hostname + '\n')
|
||||
|
@ -3627,7 +3630,8 @@ class AccountCreationWizardWindow:
|
|||
gajim.connections[self.account].send_new_account_infos(form,
|
||||
self.is_form)
|
||||
self.xml.get_object('form_vbox').remove(self.data_form_widget)
|
||||
self.xml.get_object('progressbar_label').set_markup('<b>Account is being created</b>\n\nPlease wait...')
|
||||
self.xml.get_object('progressbar_label').set_markup(
|
||||
'<b>Account is being created</b>\n\nPlease wait...')
|
||||
self.notebook.set_current_page(5) # show creating page
|
||||
self.back_button.hide()
|
||||
self.forward_button.hide()
|
||||
|
@ -3652,7 +3656,8 @@ class AccountCreationWizardWindow:
|
|||
ManageProxiesWindow()
|
||||
|
||||
def on_custom_host_port_checkbutton_toggled(self, widget):
|
||||
self.xml.get_object('custom_host_hbox').set_sensitive(widget.get_active())
|
||||
self.xml.get_object('custom_host_hbox').set_sensitive(widget.\
|
||||
get_active())
|
||||
|
||||
def update_progressbar(self):
|
||||
self.progressbar.pulse()
|
||||
|
@ -3683,13 +3688,16 @@ class AccountCreationWizardWindow:
|
|||
if ssl_msg:
|
||||
# An SSL warning occured, show it
|
||||
hostname = gajim.connections[self.account].new_account_info['hostname']
|
||||
self.xml.get_object('ssl_label').set_markup(_('<b>Security Warning</b>'
|
||||
'\n\nThe authenticity of the %(hostname)s SSL certificate could be '
|
||||
'invalid.\nSSL Error: %(error)s\n'
|
||||
self.xml.get_object('ssl_label').set_markup(_(
|
||||
'<b>Security Warning</b>'
|
||||
'\n\nThe authenticity of the %(hostname)s SSL certificate could'
|
||||
' be invalid.\nSSL Error: %(error)s\n'
|
||||
'Do you still want to connect to this server?') % {
|
||||
'hostname': hostname, 'error': ssl_msg})
|
||||
if ssl_err in (18, 27):
|
||||
text = _('Add this certificate to the list of trusted certificates.\nSHA1 fingerprint of the certificate:\n%s') % ssl_fingerprint
|
||||
text = _('Add this certificate to the list of trusted '
|
||||
'certificates.\nSHA1 fingerprint of the certificate:\n%s') \
|
||||
% ssl_fingerprint
|
||||
self.xml.get_object('ssl_checkbutton').set_label(text)
|
||||
else:
|
||||
self.xml.get_object('ssl_checkbutton').set_no_show_all(True)
|
||||
|
@ -3752,8 +3760,8 @@ class AccountCreationWizardWindow:
|
|||
gajim.config.del_per('accounts', self.account)
|
||||
img = self.xml.get_object('finish_image')
|
||||
img.set_from_stock(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG)
|
||||
finish_text = '<big><b>%s</b></big>\n\n%s' % (_('An error occurred during '
|
||||
'account creation'), reason)
|
||||
finish_text = '<big><b>%s</b></big>\n\n%s' % (_(
|
||||
'An error occurred during account creation'), reason)
|
||||
self.finish_label.set_markup(finish_text)
|
||||
self.notebook.set_current_page(6) # show finish page
|
||||
|
||||
|
@ -3765,8 +3773,7 @@ class AccountCreationWizardWindow:
|
|||
gajim.interface.instances['accounts'].window.present()
|
||||
else:
|
||||
gajim.interface.instances['accounts'] = AccountsWindow()
|
||||
gajim.interface.instances['accounts'].select_account(
|
||||
self.account)
|
||||
gajim.interface.instances['accounts'].select_account(self.account)
|
||||
self.window.destroy()
|
||||
|
||||
def on_finish_button_clicked(self, widget):
|
||||
|
@ -3868,7 +3875,8 @@ class AccountCreationWizardWindow:
|
|||
if 'accounts' in gajim.interface.instances:
|
||||
gajim.interface.instances['accounts'].init_accounts()
|
||||
# refresh roster
|
||||
if len(gajim.connections) >= 2: # Do not merge accounts if only one exists
|
||||
if len(gajim.connections) >= 2:
|
||||
# Do not merge accounts if only one exists
|
||||
gajim.interface.roster.regroup = gajim.config.get('mergeaccounts')
|
||||
else:
|
||||
gajim.interface.roster.regroup = False
|
||||
|
|
Loading…
Reference in New Issue