Convert the Quit confirmation dialog to GUI2

This commit is contained in:
Ignacio R. Morelle 2010-11-05 22:21:13 +00:00
parent 3de7d1c87c
commit c614f67f08

View file

@ -24,6 +24,8 @@
#include "game_end_exceptions.hpp"
#include "game_preferences.hpp"
#include "gettext.hpp"
#include "gui/dialogs/message.hpp"
#include "gui/widgets/window.hpp"
#include "filesystem.hpp"
#include "log.hpp"
#include "preferences_display.hpp"
@ -715,8 +717,8 @@ void key_event(display& disp, const SDL_KeyboardEvent& event, command_executor*
{
if(event.keysym.sym == SDLK_ESCAPE && disp.in_game()) {
LOG_G << "escape pressed..showing quit\n";
const int res = gui::dialog(disp,_("Quit"),_("Do you really want to quit?"),gui::YES_NO).show();
if(res == 0) {
const int res = gui2::show_message(disp.video(), _("Quit"), _("Do you really want to quit?"), gui2::tmessage::yes_no_buttons);
if(res != gui2::twindow::CANCEL) {
throw end_level_exception(QUIT);
} else {
return;
@ -1014,8 +1016,8 @@ void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* ex
case HOTKEY_QUIT_GAME: {
if(disp.in_game()) {
DBG_G << "is in game -- showing quit message\n";
const int res = gui::dialog(disp,_("Quit"),_("Do you really want to quit?"),gui::YES_NO).show();
if(res == 0) {
const int res = gui2::show_message(disp.video(), _("Quit"), _("Do you really want to quit?"), gui2::tmessage::yes_no_buttons);
if(res != gui2::twindow::CANCEL) {
throw end_level_exception(QUIT);
}
}