# HG changeset patch # User souliane # Date 1392301979 -3600 # Node ID 2b5503392fbdd2c2fb37c0100e1b3fb8663eedd9 # Parent b95099a1d11bba0c8d7017446e4830eff58971b7 browser_side: small fixes for RichTextEditor diff -r b95099a1d11b -r 2b5503392fbd browser_side/dialog.py --- a/browser_side/dialog.py Thu Feb 13 12:53:07 2014 +0100 +++ b/browser_side/dialog.py Thu Feb 13 15:32:59 2014 +0100 @@ -255,7 +255,8 @@ button_panel.addStyleName("marginAuto") self.confirm_button = Button("OK", self.onConfirm) button_panel.add(self.confirm_button) - button_panel.add(Button("Cancel", self.onCancel)) + self.cancel_button = Button("Cancel", self.onCancel) + button_panel.add(self.cancel_button) content.add(button_panel) self.setHTML(title) self.setWidget(content) diff -r b95099a1d11b -r 2b5503392fbd browser_side/richtext.py --- a/browser_side/richtext.py Thu Feb 13 12:53:07 2014 +0100 +++ b/browser_side/richtext.py Thu Feb 13 15:32:59 2014 +0100 @@ -256,11 +256,12 @@ confirmation. When edit is False and abort is True, abortion is actually done. @param sync: set to True to cancel the edition after the content has been saved somewhere else """ - self.refresh(edit) - BaseTextEditor.edit(self, edit, abort, sync) + if not (edit and abort): + self.refresh(edit) # not when we are asking for a confirmation + BaseTextEditor.edit(self, edit, abort, sync) # after the UI has been refreshed if (edit and abort): - return - self.setWysiwyg(False, init=True) # /!\ it affects self.getContent + return # self.avortEdition is called by BaseTextEditor.edit + self.setWysiwyg(False, init=True) # after BaseTextEditor (it affects self.getContent) if sync: return # the following must NOT be done at each UI refresh! @@ -290,7 +291,7 @@ if 'title' in content and content['title']: text = '

%s

%s' % (content['title'], content['text']) self.display.setContent({'text': text}) - self.display.edit(False) + self.display.edit(False) def setFocus(self, focus): self.textarea.setFocus(focus) @@ -301,6 +302,7 @@ if answer: self.edit(False, True) _dialog = ConfirmDialog(confirm_cb, text="Do you really want to %s?" % ("cancel your changes" if self.update_msg else "cancel this message")) + _dialog.cancel_button.setText(_("No")) _dialog.show()