'Enable/disable actions.'

def update_actions(self):

    selection = self.selected_paths()
    selected = bool(selection)
    staged = bool(self.selected_staged_paths(selection=selection))
    modified = bool(self.selected_modified_paths(selection=selection))
    unstaged = bool(self.selected_unstaged_paths(selection=selection))
    tracked = bool(self.selected_tracked_paths(selection=selection))
    revertable = (staged or modified)
    self.action_editor.setEnabled(selected)
    self.action_history.setEnabled(selected)
    if (not utils.is_win32()):
        self.action_default_app.setEnabled(selected)
        self.action_parent_dir.setEnabled(selected)
        self.action_terminal.setEnabled(selected)
    self.action_stage.setEnabled((staged or unstaged))
    self.action_untrack.setEnabled(tracked)
    self.action_difftool.setEnabled((staged or modified))
    self.action_difftool_predecessor.setEnabled(tracked)
    self.action_revert_unstaged.setEnabled(revertable)
    self.action_revert_uncommitted.setEnabled(revertable)
