'Handles the plugin activation/deactivation.
:param cell: the cell that generated the signal.
:param path: the path that clicked the user.
When a child gets activated/deactivated, the father is also refreshed
to show if it\'s full/partially/not activated.
If the father gets activated/deactivated, all the children follow the
same fate.'

def activate_plugin(self, cell, path):

    treerow = self.treestore[path]
    plugin_fam = treerow[0]
    banned_fams = ('crawl', 'evasion')
    newvalue = (not treerow[1])
    treerow[1] = newvalue
    treerow[2] = False
    if (':' not in path):
        user_response = gtk.RESPONSE_YES
        if ((plugin_fam in banned_fams) and (treerow[1] == True)):
            if (plugin_fam == 'crawl'):
                msg = _('Enabling    all    crawl    plugins    will    result    in    a    scan    process    of    several    hours,    and    sometimes    days.    Are    you    sure    that    you    want    to    do    enable    ALL    crawl    plugins?')
            else:
                msg = _('Using    any    of    the    evasion    plugins    is    highly    discouraged    in    our    current    version.    Are    you    sure    that    you    want    to    enable    ALL    of    them?')
            user_response = self._askUser(msg)
            if (user_response != gtk.RESPONSE_YES):
                treerow[1] = False
        if ((user_response == gtk.RESPONSE_YES) or (plugin_fam not in banned_fams)):
            for childtreerow in self._get_children(path):
                childtreerow[1] = newvalue
    else:
        pathfather = path.split(':')[0]
        father = self.treestore[pathfather]
        plugin_fam = father[0]
        if ((plugin_fam == 'evasion') and (treerow[1] == True)):
            msg = _('Using    any    of    the    evasion    plugins    is    highly    discouraged    in    our    current    version.    Are    you    sure    that    you    want    to    enable    this    plugin?')
            if (self._askUser(msg) != gtk.RESPONSE_YES):
                treerow[1] = False
        vals = []
        for treerow in self._get_children(pathfather):
            vals.append(treerow[1])
        if all(vals):
            father[1] = True
            father[2] = False
        elif (not any(vals)):
            father[1] = False
            father[2] = False
        else:
            father[2] = True
    self.mainwin.profiles.profile_changed()
