''

def selection_changed(self, selection, deselection):

    model = self.table.model()
    index = self.table.currentIndex()
    row = index.row()
    (order, names, active) = (self.order, self.names, self.active)
    state = model.row(row)[1]
    name = model.row(row)[0]
    if (name not in names):
        if (row != (-1)):
            old_name = order[row]
            order[row] = name
            names[names.index(old_name)] = name
            if (old_name in active):
                active[active.index(old_name)] = name
    if state:
        if (name not in active):
            active.append(name)
    elif (name in active):
        active.remove(name)
    self.active = active
    self.button_move_up.setDisabled(False)
    self.button_move_down.setDisabled(False)
    if (row == 0):
        self.button_move_up.setDisabled(True)
    if (row == (len(names) - 1)):
        self.button_move_down.setDisabled(True)
    if (len(names) == 0):
        self.button_move_up.setDisabled(True)
        self.button_move_down.setDisabled(True)
