Make some strings translatable in adhoc commands, Warn user when session id changes in the middle of a session. fixes #3432
This commit is contained in:
parent
494ae444b6
commit
ecfde88bac
|
@ -110,7 +110,7 @@ class CommandWindow:
|
||||||
return self.stage_adhoc_commands_window_delete_event(self.window)
|
return self.stage_adhoc_commands_window_delete_event(self.window)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
print "Object has been deleted."
|
print 'Object has been deleted.'
|
||||||
|
|
||||||
# stage 1: waiting for command list
|
# stage 1: waiting for command list
|
||||||
def stage1(self):
|
def stage1(self):
|
||||||
|
@ -248,8 +248,8 @@ class CommandWindow:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
dialog = dialogs.HigDialog(self.window, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL,
|
dialog = dialogs.HigDialog(self.window, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL,
|
||||||
gtk.BUTTONS_YES_NO, 'Cancel confirmation',
|
gtk.BUTTONS_YES_NO, _('Cancel confirmation'),
|
||||||
'You are in process of executing command. Do you really want to cancel it?')
|
_('You are in process of executing command. Do you really want to cancel it?'))
|
||||||
dialog.popup()
|
dialog.popup()
|
||||||
if dialog.get_response()==gtk.RESPONSE_YES:
|
if dialog.get_response()==gtk.RESPONSE_YES:
|
||||||
self.send_cancel()
|
self.send_cancel()
|
||||||
|
@ -291,7 +291,11 @@ class CommandWindow:
|
||||||
self.remove_pulsing()
|
self.remove_pulsing()
|
||||||
self.sending_form_progressbar.hide()
|
self.sending_form_progressbar.hide()
|
||||||
|
|
||||||
self.sessionid = command.getAttr('sessionid')
|
if not self.sessionid:
|
||||||
|
self.sessionid = command.getAttr('sessionid')
|
||||||
|
elif self.sessionid != command.getAttr('sessionid'):
|
||||||
|
self.stage5(error=_('Service changed the session identifier.'),
|
||||||
|
senderror=True)
|
||||||
|
|
||||||
self.form_status = command.getAttr('status')
|
self.form_status = command.getAttr('status')
|
||||||
|
|
||||||
|
@ -303,12 +307,11 @@ class CommandWindow:
|
||||||
try:
|
try:
|
||||||
self.data_form_widget.data_form=self.dataform
|
self.data_form_widget.data_form=self.dataform
|
||||||
except dataforms.Error:
|
except dataforms.Error:
|
||||||
# FIXME: translate
|
self.stage5(error=_('Service sent malformed data'), senderror=True)
|
||||||
self.stage5(error='Service sent malformed data', senderror=True)
|
|
||||||
return
|
return
|
||||||
self.data_form_widget.show()
|
self.data_form_widget.show()
|
||||||
if self.data_form_widget.title:
|
if self.data_form_widget.title:
|
||||||
self.window.set_title("%s - Ad-hoc Commands - Gajim" % \
|
self.window.set_title('%s - Ad-hoc Commands - Gajim' % \
|
||||||
self.data_form_widget.title)
|
self.data_form_widget.title)
|
||||||
else:
|
else:
|
||||||
self.data_form_widget.hide()
|
self.data_form_widget.hide()
|
||||||
|
@ -385,7 +388,7 @@ class CommandWindow:
|
||||||
error = errordesc.decode('utf-8')
|
error = errordesc.decode('utf-8')
|
||||||
del errorname, errordesc
|
del errorname, errordesc
|
||||||
except KeyError: # when stanza doesn't have error description
|
except KeyError: # when stanza doesn't have error description
|
||||||
error = 'Service returned an error.'
|
error = _('Service returned an error.')
|
||||||
elif error:
|
elif error:
|
||||||
# we've got error message
|
# we've got error message
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue