'Fire up neccesary actions when selection on the main tree changes'

def on_main_tree_selection(self, tree_selection):

    (model, tree_iter) = tree_selection.get_selected()
    if (tree_iter is None):
        return False
    object_info = model[tree_iter]
    iter_depth = model.iter_depth(tree_iter)
    object_type = {0: 'Host', 1: 'Interface', 2: 'Service'}[iter_depth]
    if (object_type == 'Host'):
        self.set_vuln_model(self.create_vuln_model(self.host))
    elif ((object_type == 'Interface') or (object_type == 'Service')):
        self.clear(self.specific_info)
        self.change_label_in_frame(self.specific_info_frame, object_type)
        prop_names = self.get_properties_names(object_type)
        self.show_info_in_box(object_info, prop_names, self.specific_info)
        actual_object = self.get_object(object_info, object_type)
        if (not actual_object):
            return None
        vuln_model = self.create_vuln_model(actual_object)
        self.set_vuln_model(vuln_model)
