Difficulty in adding data in the comment section

Bug #1225927 reported by Cyrille Delmer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Supertree Toolkit
Confirmed
Medium
Jon Hill

Bug Description

When data is input in comment section, one must be very carafull that one click next on a section that holds data. Otherwise, the data just added in the comment section is not saved. Not sure if its fixable

Jon Hill (jon-hill)
Changed in supertree-toolkit:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Jon Hill (jon-hill)
milestone: none → beta
Revision history for this message
Jon Hill (jon-hill) wrote :

This is a bit odd. I can replicate this easily. The store function is meant to kick in and store the comment as soon as the comment block loses focus (which includes clicking on another application). I can see the function getting called, but the comment is empty when a inactive portion of the tree was the click that lost the comment box focus.

Relevant code is in commentWidget.py

  def store(self):
    """
    Store data in the node comment.
    """

    comment_tree = self.comment_tree
    print comment_tree
    if comment_tree is None or not self.interacted:
      print "returning"
      return

    data_buffer_bounds = self.textView.get_buffer().get_bounds()
    new_comment = self.textView.get_buffer().get_text(data_buffer_bounds[0], data_buffer_bounds[1])

    if new_comment != comment_tree.data:
      print new_comment
      if new_comment == "":
        comment_tree.data = None
        comment_tree.active = False
      else:
        comment_tree.set_data(new_comment)
        comment_tree.active = True
        self.emit("on-store")
    return

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.