'Override delete_event signal to show a confirmation dialog first.'

def do_delete_event(self, event=None, status=None, parent=None):

    if (parent is None):
        parent = self
    if (self.statusbar.conflict_button_label_int > 0):
        response = self.show_conflicts_warning()
        if (response == Gtk.ResponseType.NO):
            return True
        else:
            return False
    dialog = Gtk.MessageDialog(transient_for=parent, modal=True, buttons=Gtk.ButtonsType.YES_NO)
    dialog.set_keep_above(True)
    dialog.set_modal(True)
    dialog.props.text = 'Are    you    sure    you    want    to    quit    Faraday?'
    response = dialog.run()
    dialog.destroy()
    if (response == Gtk.ResponseType.YES):
        return False
    else:
        return True
