comparison src/browser/sat_browser/blog.py @ 832:ded96b54ee02

browser (blog): set focus to the bubble of a just added comment entry
author souliane <souliane@mailoo.org>
date Sat, 09 Jan 2016 13:44:48 +0100
parents f8a7a046ff9c
children 2d15b484ca33
comparison
equal deleted inserted replaced
831:25931797db20 832:ded96b54ee02
333 if self._current_comment is None: 333 if self._current_comment is None:
334 if not self.item.comments_service or not self.item.comments_node: 334 if not self.item.comments_service or not self.item.comments_node:
335 log.warning("Invalid service and node for comments, can't create a comment") 335 log.warning("Invalid service and node for comments, can't create a comment")
336 self._current_comment = self.addEntry(editable=True, service=self.item.comments_service, node=self.item.comments_node, edit_entry=True) 336 self._current_comment = self.addEntry(editable=True, service=self.item.comments_service, node=self.item.comments_node, edit_entry=True)
337 self.blog.setSelectedEntry(self._current_comment, True) 337 self.blog.setSelectedEntry(self._current_comment, True)
338 self._current_comment.bubble.setFocus(True) # FIXME: should be done elsewhere (automatically)?
338 339
339 def _changeMode(self, original_content, text): 340 def _changeMode(self, original_content, text):
340 self.mode = C.ENTRY_MODE_RICH if self.mode == C.ENTRY_MODE_TEXT else C.ENTRY_MODE_TEXT 341 self.mode = C.ENTRY_MODE_RICH if self.mode == C.ENTRY_MODE_TEXT else C.ENTRY_MODE_TEXT
341 if self.mode in ENTRY_RICH and not text: 342 if self.mode in ENTRY_RICH and not text:
342 text = ' ' # something different than empty string is needed to initialize the rich text editor 343 text = ' ' # something different than empty string is needed to initialize the rich text editor