# HG changeset patch # User souliane # Date 1388761560 -3600 # Node ID 462a0a8894e3f4e9a547c0ed2fa1b778d6ec9e47 # Parent c12c9a1acf2f4bf222fa56601b3cd7116eba498d browser_side: display the good text for microblog button regarding the context: "Send message" or "Update" diff -r c12c9a1acf2f -r 462a0a8894e3 browser_side/panels.py --- a/browser_side/panels.py Fri Jan 03 14:19:01 2014 +0100 +++ b/browser_side/panels.py Fri Jan 03 16:06:00 2014 +0100 @@ -537,7 +537,9 @@ def cb(result): self._updateContent(result == richtext.CANCEL) - options = ('no_recipient', 'no_sync_unibox', 'no_style', 'update_msg', 'no_close') + options = ['no_recipient', 'no_sync_unibox', 'no_style', 'no_close'] + if not self.empty: + options.append('update_msg') editor = richtext.RichTextEditor(self._blog_panel.host, self.panel, cb, options=options) editor.setWidth('100%') self.editbox = editor.textarea diff -r c12c9a1acf2f -r 462a0a8894e3 browser_side/richtext.py --- a/browser_side/richtext.py Fri Jan 03 14:19:01 2014 +0100 +++ b/browser_side/richtext.py Fri Jan 03 16:06:00 2014 +0100 @@ -94,7 +94,7 @@ if not self.no_sync_unibox: self.command.add(Button("Back to quick box", listener=self.closeAndSave)) self.command.add(Button("Update" if self.update_msg else "Send message", - listener=self.__close if self.update_msg else self.sendMessage)) + listener=self.__close if (self.update_msg or self.no_recipient) else self.sendMessage)) self.getFlexCellFormatter().setColSpan(offset1 + offset2 + 1, 0, 2) self.setWidget(offset1 + offset2 + 1, 0, self.command) @@ -256,7 +256,7 @@ def cancelWithoutSaving(self): """Ask for confirmation before closing the dialog.""" - if self.update_msg and self.textarea.getText() == self.original_text: + if self.textarea.getText() == self.original_text: self.__close(CANCEL) return