diff options
author | Max Horn | 2007-06-30 12:43:53 +0000 |
---|---|---|
committer | Max Horn | 2007-06-30 12:43:53 +0000 |
commit | c7fa7baf1f424d6e003473879d8d015067817fe7 (patch) | |
tree | a30e2ce1e1e249467ae8bb42df7344661c6e288a /backends/events/default/default-events.cpp | |
parent | 45aea284d1673f56fa45d796af6da647630ccb2b (diff) | |
download | scummvm-rg350-c7fa7baf1f424d6e003473879d8d015067817fe7.tar.gz scummvm-rg350-c7fa7baf1f424d6e003473879d8d015067817fe7.tar.bz2 scummvm-rg350-c7fa7baf1f424d6e003473879d8d015067817fe7.zip |
Added global support for the (so far undocumented) confirm_exit config key
svn-id: r27788
Diffstat (limited to 'backends/events/default/default-events.cpp')
-rw-r--r-- | backends/events/default/default-events.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index ad21b09070..14f4249b42 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -26,8 +26,10 @@ #if !defined(DISABLE_DEFAULT_EVENTMANAGER) #include "common/stdafx.h" +#include "common/config-manager.h" #include "common/system.h" #include "backends/events/default/default-events.h" +#include "gui/message.h" DefaultEventManager::DefaultEventManager(OSystem *boss) : _boss(boss), @@ -93,7 +95,15 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { break; case Common::EVENT_QUIT: - _shouldQuit = true; + if (ConfMan.getBool("confirm_exit")) { + GUI::MessageDialog alert("Do you really want to quit?", "Yes", "No"); + if (alert.runModal() == GUI::kMessageOK) + _shouldQuit = true; + else + result = false; + + } else + _shouldQuit = true; break; default: |