From bf62dfa7de874aca68502f0b2b9462034586029a Mon Sep 17 00:00:00 2001 From: auria Date: Thu, 17 Jan 2013 22:43:18 +0000 Subject: [PATCH] Add warning when trying to open a dialog while the previous one is still visible git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12381 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/guiengine/modaldialog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/guiengine/modaldialog.cpp b/src/guiengine/modaldialog.cpp index 91c786ae7..1c7c77d3c 100644 --- a/src/guiengine/modaldialog.cpp +++ b/src/guiengine/modaldialog.cpp @@ -23,6 +23,7 @@ #include "guiengine/widget.hpp" #include "input/input_manager.hpp" #include "io/file_manager.hpp" +#include "utils/log.hpp" #include @@ -119,7 +120,11 @@ void ModalDialog::doInit(const float percentWidth, const float percentHeight) assert(false); } - if (modalWindow != NULL) delete modalWindow; + if (modalWindow != NULL) + { + delete modalWindow; + Log::warn("GUIEngine", "Showing a modal dialog while the previous one is still open. Destroying the previous dialog."); + } modalWindow = this; m_irrlicht_window = GUIEngine::getGUIEnv()->addWindow(m_area, true /* modal */);