:mod:`dip.shell.tools.quit`
===========================
.. module:: dip.shell.tools.quit

This module contains the default implementation of a :term:`tool` that
handles a user's ability to quit the application.


:class:`QuitTool`
-----------------
.. class:: QuitTool

    Base class: :class:`~dip.model.Model`

    The QuitTool is the default implementation of a :term:`tool`
    that handles the user's ability to quit the application.

    .. attribute:: id = 'dip.shell.tools.quit'

        The tool's identifier.

    .. attribute:: quit_action = QuitAction()

        The action.

    .. attribute:: user_quit_preamble = Str('You may not want to quit because of the following reasons.')

        The text used as the preamble to the multiple list of reasons.

    .. attribute:: user_quit_question = Str('Do you still want to quit?')

        The text used as the question asking if the user really wants to quit.

    .. attribute:: user_quit_title = Str()

        The text used as the title of any user dialogs.

    .. attribute:: user_quit_view = Instance(Dialog)

        The factory used to create the dialog when presenting multiple reasons to
        the user.  The corresponding model will contain a 'preamble' string, a
        'reason' and a 'question' string.  The view must create an implementation
        of :class:`~dip.ui.IOptionList` bound to the 'reason'.

    .. method:: QuitTool.query_multiple_reasons(reasons)

        Ask the user about a number of reasons not quit.
        
        :param reasons:
            is the list of reasons not to quit.
        :return:
            ``True`` if the user wants to quit.

    .. method:: QuitTool.query_single_reason(reason)

        Ask the user about a single reason to not quit.
        
        :param reason:
            is the reason not to quit.
        :return:
            ``True`` if the user wants to quit.
