GTG

Comment 1 for bug 498572

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

Hi kevin, the add_tag() seems to be an internal function used to manage the tags list. The correct way to add tag in a task is the plugin_api.insert_tag(), which is:

 def insert_tag(self, tag):
        """Inserts a tag into the current task (in the textview).

        Note: this method only works with the onTaskOpened method.

        @param tag: The tag's name (without the '@').
        """
        itera = self.textview.get_insert()
        if itera.starts_line() :
            self.textview.insert_text("@" + tag,itera)
        else :
            self.textview.insert_text(" @" + tag,itera)
        self.textview.grab_focus()

I noticed that the add_tag () method creates confusion, that is why I opened bug #493835