'Creates a simple dialog with an error message to inform the user
some kind of problem has happened and the connection was lost.'

def lost_db_connection(self, explanatory_message=None, handle_connection_lost=None, connect_to_a_different_couch=None):

    if self.lost_connection_dialog_raised:
        return False
    def do_nothing_on_key_stroke(event, key):
        'Do    nothing    except    return    True'
        return True
    self.lost_connection_dialog_raised = True
    if (explanatory_message and isinstance(explanatory_message, basestring)):
        explanation = ('\n    The    specific    error    was:    ' + explanatory_message)
    else:
        explanation = ''
    dialog = Gtk.MessageDialog(self.window, 0, Gtk.MessageType.ERROR, Gtk.ButtonsType.NONE, ("The    client    can't    connect    to    Faraday    Server.    You    can    try    to    reconnect    to    the    last    URL    you    set    up,    change    it    or    exit    Faraday    until    you    fix    the    problem.    \nFor    more    information    about    Faraday    Server    please    refer    to    the    Faraday    Github    Wiki.    \n    " + explanation))
    dialog.set_deletable(False)
    dialog.set_modal(True)
    dialog.connect('key_press_event', do_nothing_on_key_stroke)
    retry_button = dialog.add_button('Retry    connection?', 42)
    retry_button.connect('clicked', handle_connection_lost, dialog)
    change_couch_url = dialog.add_button('Change    server    IP?', 43)
    change_couch_url.connect('clicked', connect_to_a_different_couch, dialog)
    cancel_button = dialog.add_button('Exit    Faraday', 0)
    cancel_button.connect('clicked', self.on_quit)
    response = dialog.run()
    if (response == Gtk.ResponseType.DELETE_EVENT):
        GObject.idle_add(self.exit_faraday_without_confirm)
