diff options
| author | Glenn Rice <glennricster@gmail.com> | 2011-07-15 14:49:34 +0000 |
|---|---|---|
| committer | Glenn Rice <glennricster@gmail.com> | 2011-07-15 14:49:34 +0000 |
| commit | a5a45992ad1b842e6b605850574a2be6655cdd1c (patch) | |
| tree | d8ad4056338cbb265d59743736f6d664632d565d /Source/Core/Common | |
| parent | a154df1e7c257683663101820c4bc477db4a6984 (diff) | |
Add a new type of message box (CRITICAL style) which can not be disabled. Then use that message box to display shader compilation errors in the OpenGL backend to maintain consistency with the behaviour of the DirectX backends.
Also fix the wxMessageAlert called from non-gui threads in the WXGTK build to use the passed caption.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7678 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/MsgHandler.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/Common/Src/MsgHandler.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Source/Core/Common/Src/MsgHandler.cpp b/Source/Core/Common/Src/MsgHandler.cpp index 9f980fedd2..3f68e1d29a 100644 --- a/Source/Core/Common/Src/MsgHandler.cpp +++ b/Source/Core/Common/Src/MsgHandler.cpp @@ -58,12 +58,14 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...) static std::string info_caption; static std::string warn_caption; static std::string ques_caption; + static std::string crit_caption; if (!info_caption.length()) { info_caption = str_translator(_trans("Information")); ques_caption = str_translator(_trans("Question")); warn_caption = str_translator(_trans("Warning")); + crit_caption = str_translator(_trans("Critical")); } switch(Style) @@ -77,6 +79,9 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...) case WARNING: caption = warn_caption; break; + case CRITICAL: + caption = crit_caption; + break; } va_list args; @@ -87,7 +92,7 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...) ERROR_LOG(MASTER_LOG, "%s: %s", caption.c_str(), buffer); // Don't ignore questions, especially AskYesNo, PanicYesNo could be ignored - if (msg_handler && (AlertEnabled || Style == QUESTION)) + if (msg_handler && (AlertEnabled || Style == QUESTION || Style == CRITICAL)) return msg_handler(caption.c_str(), buffer, yes_no, Style); return true; diff --git a/Source/Core/Common/Src/MsgHandler.h b/Source/Core/Common/Src/MsgHandler.h index 0598a8b791..10635b4988 100644 --- a/Source/Core/Common/Src/MsgHandler.h +++ b/Source/Core/Common/Src/MsgHandler.h @@ -26,6 +26,7 @@ enum MSG_TYPE INFORMATION, QUESTION, WARNING, + CRITICAL }; typedef bool (*MsgAlertHandler)(const char* caption, const char* text, @@ -58,11 +59,13 @@ void SetEnableAlert(bool enable); #define PanicAlert(format, ...) MsgAlert(false, WARNING, format, ##__VA_ARGS__) #define PanicYesNo(format, ...) MsgAlert(true, WARNING, format, ##__VA_ARGS__) #define AskYesNo(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__) + #define CriticalAlert(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__) // Use these macros (that do the same thing) if the message should be translated. #define SuccessAlertT(format, ...) MsgAlert(false, INFORMATION, format, ##__VA_ARGS__) #define PanicAlertT(format, ...) MsgAlert(false, WARNING, format, ##__VA_ARGS__) #define PanicYesNoT(format, ...) MsgAlert(true, WARNING, format, ##__VA_ARGS__) #define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__) + #define CriticalAlertT(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__) #endif #else // GEKKO |
