'Override selectionChanged to update available actions.'

def selectionChanged(self, old, new):

    result = QtWidgets.QTreeView.selectionChanged(self, old, new)
    if (not self.restoring_selection):
        self.update_actions()
        self.update_diff()
    return result
