comparison browser_side/richtext.py @ 319:462a0a8894e3

browser_side: display the good text for microblog button regarding the context: "Send message" or "Update"
author souliane <souliane@mailoo.org>
date Fri, 03 Jan 2014 16:06:00 +0100
parents 05e264e96a1c
children 0b7934e75e76
comparison
equal deleted inserted replaced
318:c12c9a1acf2f 319:462a0a8894e3
92 self.command.addStyleName("marginAuto") 92 self.command.addStyleName("marginAuto")
93 self.command.add(Button("Cancel", listener=self.cancelWithoutSaving)) 93 self.command.add(Button("Cancel", listener=self.cancelWithoutSaving))
94 if not self.no_sync_unibox: 94 if not self.no_sync_unibox:
95 self.command.add(Button("Back to quick box", listener=self.closeAndSave)) 95 self.command.add(Button("Back to quick box", listener=self.closeAndSave))
96 self.command.add(Button("Update" if self.update_msg else "Send message", 96 self.command.add(Button("Update" if self.update_msg else "Send message",
97 listener=self.__close if self.update_msg else self.sendMessage)) 97 listener=self.__close if (self.update_msg or self.no_recipient) else self.sendMessage))
98 self.getFlexCellFormatter().setColSpan(offset1 + offset2 + 1, 0, 2) 98 self.getFlexCellFormatter().setColSpan(offset1 + offset2 + 1, 0, 2)
99 self.setWidget(offset1 + offset2 + 1, 0, self.command) 99 self.setWidget(offset1 + offset2 + 1, 0, self.command)
100 100
101 @classmethod 101 @classmethod
102 def getOrCreate(cls, host, parent=None, onCloseCallback=None): 102 def getOrCreate(cls, host, parent=None, onCloseCallback=None):
254 self.host.getOrCreateLiberviaWidget(_class, target) 254 self.host.getOrCreateLiberviaWidget(_class, target)
255 return True 255 return True
256 256
257 def cancelWithoutSaving(self): 257 def cancelWithoutSaving(self):
258 """Ask for confirmation before closing the dialog.""" 258 """Ask for confirmation before closing the dialog."""
259 if self.update_msg and self.textarea.getText() == self.original_text: 259 if self.textarea.getText() == self.original_text:
260 self.__close(CANCEL) 260 self.__close(CANCEL)
261 return 261 return
262 262
263 def confirm_cb(answer): 263 def confirm_cb(answer):
264 if answer: 264 if answer: