'Show files with differences and launch difftool'

def __init__(self, parent, a=None, b=None, expr=None, title=None, hide_expr=False, focus_tree=False):

    standard.Dialog.__init__(self, parent=parent)
    self.a = a
    self.b = b
    self.diff_expr = expr
    if (title is None):
        title = N_(u'git-cola    diff')
    self.setWindowTitle(title)
    self.setWindowModality(Qt.WindowModal)
    self.expr = completion.GitRefLineEdit(parent=self)
    if (expr is not None):
        self.expr.setText(expr)
    if ((expr is None) or hide_expr):
        self.expr.hide()
    self.tree = filetree.FileTree(parent=self)
    self.diff_button = qtutils.create_button(text=N_(u'Compare'), icon=icons.diff(), enabled=False, default=True)
    self.diff_button.setShortcut(hotkeys.DIFF)
    self.diff_all_button = qtutils.create_button(text=N_(u'Compare    All'), icon=icons.diff())
    self.edit_button = qtutils.edit_button()
    self.edit_button.setShortcut(hotkeys.EDIT)
    self.close_button = qtutils.close_button()
    self.button_layout = qtutils.hbox(defs.no_margin, defs.spacing, self.close_button, qtutils.STRETCH, self.edit_button, self.diff_all_button, self.diff_button)
    self.main_layout = qtutils.vbox(defs.margin, defs.spacing, self.expr, self.tree, self.button_layout)
    self.setLayout(self.main_layout)
    self.tree.itemSelectionChanged.connect(self.tree_selection_changed)
    self.tree.itemDoubleClicked.connect(self.tree_double_clicked)
    self.tree.up.connect(self.focus_input)
    self.expr.textChanged.connect(self.text_changed)
    self.expr.activated.connect(self.focus_tree)
    self.expr.down.connect(self.focus_tree)
    self.expr.enter.connect(self.focus_tree)
    qtutils.connect_button(self.diff_button, self.diff)
    qtutils.connect_button(self.diff_all_button, (lambda : self.diff(dir_diff=True)))
    qtutils.connect_button(self.edit_button, self.edit)
    qtutils.connect_button(self.close_button, self.close)
    qtutils.add_action(self, u'Focus    Input', self.focus_input, hotkeys.FOCUS)
    qtutils.add_action(self, u'Diff    All', (lambda : self.diff(dir_diff=True)), hotkeys.CTRL_ENTER, hotkeys.CTRL_RETURN)
    qtutils.add_close_action(self)
    self.init_state(None, self.resize_widget, parent)
    self.refresh()
    if focus_tree:
        self.focus_tree()
