Implements a quit confirmation dialog. More...
#include <quit_confirmation.hpp>
Public Member Functions | |
quit_confirmation (const std::function< bool()> &prompt=&quit_confirmation::default_prompt) | |
~quit_confirmation () | |
Static Public Member Functions | |
static bool | quit () |
Shows the quit confirmation if needed. More... | |
static void | quit_to_title () |
static void | quit_to_desktop () |
static bool | show_prompt (const std::string &message) |
static bool | default_prompt () |
Private Member Functions | |
quit_confirmation (const quit_confirmation &) | |
const quit_confirmation & | operator= (const quit_confirmation &) |
Private Attributes | |
std::function< bool()> | prompt_ |
Static Private Attributes | |
static std::vector < quit_confirmation * > | blockers_ = std::vector<quit_confirmation*>() |
static bool | open_ = false |
Implements a quit confirmation dialog.
Any object of this type will prevent the game from quitting immediately. Instead, a confirmation dialog will pop up when attempting to close.
Definition at line 31 of file quit_confirmation.hpp.
|
inlineexplicit |
Definition at line 34 of file quit_confirmation.hpp.
References blockers_.
|
inline |
Definition at line 37 of file quit_confirmation.hpp.
References blockers_.
|
private |
|
static |
Definition at line 60 of file quit_confirmation.cpp.
References _(), and show_prompt().
|
private |
|
static |
Shows the quit confirmation if needed.
CVideo::quit | If the user chooses to quit or no prompt was displayed. |
Definition at line 27 of file quit_confirmation.cpp.
References blockers_, and open_.
Referenced by editor::editor_controller::execute_command(), playmp_controller::linger(), quit_to_desktop(), and quit_to_title().
|
static |
Definition at line 49 of file quit_confirmation.cpp.
References quit().
Referenced by editor::editor_controller::execute_command(), hotkey::command_executor::execute_command(), and events::pump().
|
static |
Definition at line 44 of file quit_confirmation.cpp.
References quit(), and throw_quit_game_exception().
Referenced by hotkey::command_executor::execute_command(), and gui2::tsynced_choice_wait::pre_show().
|
static |
Definition at line 54 of file quit_confirmation.cpp.
References _(), gui2::twindow::CANCEL, CVideo::get_singleton(), gui2::show_message(), and gui2::tmessage::yes_no_buttons.
Referenced by default_prompt(), and editor::editor_controller::quit_confirm().
|
staticprivate |
Definition at line 56 of file quit_confirmation.hpp.
Referenced by quit(), quit_confirmation(), and ~quit_confirmation().
|
staticprivate |
Definition at line 57 of file quit_confirmation.hpp.
Referenced by quit().
|
private |
Definition at line 59 of file quit_confirmation.hpp.