diff --git a/Source/Core/Common/Src/MsgHandler.cpp b/Source/Core/Common/Src/MsgHandler.cpp index fdb8ad97b2..61888a8c6f 100644 --- a/Source/Core/Common/Src/MsgHandler.cpp +++ b/Source/Core/Common/Src/MsgHandler.cpp @@ -68,18 +68,16 @@ bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, . // ŻŻŻŻŻŻŻŻŻ bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int Style) { - #ifdef _WIN32 - if (yes_no) - // Return true for IDYES - return IDYES == MessageBox(0, "Why is there no icon", caption, - MB_ICONQUESTION | MB_YESNO); - else { - MessageBox(0, text, caption, MB_ICONWARNING); - return true; - } - #else - printf("%s\n", text); - return true; - #endif +#ifdef _WIN32 + int STYLE = MB_ICONINFORMATION; + if(Style == QUESTION) STYLE = MB_ICONQUESTION; + if(Style == WARNING) STYLE = MB_ICONWARNING; + + return IDYES == MessageBox(0, text, caption, STYLE | (yes_no ? MB_YESNO : MB_OK)); + +#else + printf("%s\n", text); + return true; +#endif } diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 6549747e8f..8a0e0a8a04 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -111,9 +111,9 @@ bool DolphinApp::OnInit() #endif // Register message box handler - #if defined(HAVE_WX) && HAVE_WX +#if ! defined(_WIN32) && defined(HAVE_WX) && HAVE_WX RegisterMsgAlertHandler(&wxMsgAlert); - #endif +#endif // ------------------------------------------ @@ -311,27 +311,14 @@ void DolphinApp::OnEndSession() } /////////////////////////////////////// Main window created - -///////////////////////////////////////////////////////////// -/* We declare this here instead of in Common/MsgHandler.cpp because we want to keep Common - free of wxWidget functions */ -// ŻŻŻŻŻŻŻŻŻ +#if defined HAVE_WX && HAVE_WX bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int Style) { - #ifdef _WIN32 - /* In Windows we use a MessageBox isntead of a wxMessageBox to don't block - the debug window */ - int STYLE = MB_ICONINFORMATION; - if(Style == QUESTION) STYLE = MB_ICONQUESTION; - if(Style == WARNING) STYLE = MB_ICONWARNING; - - return IDYES == MessageBox(0, text, caption, STYLE | (yes_no ? MB_YESNO : MB_OK)); - #else - return wxYES == wxMessageBox(wxString::FromAscii(text), - wxString::FromAscii(caption), - (yes_no)?wxYES_NO:wxOK); - #endif + return wxYES == wxMessageBox(wxString::FromAscii(text), + wxString::FromAscii(caption), + (yes_no)?wxYES_NO:wxOK); } +#endif //////////////////////////////////