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