From 9a171a5928fea6cba7119df1adc70a648912fc9d Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Thu, 25 Jun 2015 16:53:10 +0100 Subject: [PATCH] gui: Make Msgbox more consistent Just use ShowModal. That will invoke pxMessageDialog on the main thread anyway. --- pcsx2/gui/MessageBoxes.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/pcsx2/gui/MessageBoxes.cpp b/pcsx2/gui/MessageBoxes.cpp index 5b34674f26..b7e77e4caf 100644 --- a/pcsx2/gui/MessageBoxes.cpp +++ b/pcsx2/gui/MessageBoxes.cpp @@ -181,30 +181,12 @@ namespace Msgbox // true if OK, false if cancel. bool OkCancel( const wxString& text, const wxString& caption, int icon ) { - MsgButtons buttons( MsgButtons().OKCancel() ); - - if( wxThread::IsMain() ) - { - return wxID_OK == pxMessageDialog( caption, text, buttons ); - } - else - { - return wxID_OK == ShowModal( caption, text, buttons ); - } + return ShowModal(caption, text, MsgButtons().OKCancel()) == wxID_OK; } bool YesNo( const wxString& text, const wxString& caption, int icon ) { - MsgButtons buttons( MsgButtons().YesNo() ); - - if( wxThread::IsMain() ) - { - return wxID_YES == pxMessageDialog( caption, text, buttons ); - } - else - { - return wxID_YES == ShowModal( caption, text, buttons ); - } + return ShowModal(caption, text, MsgButtons().YesNo()) == wxID_YES; } int Assertion( const wxString& text, const wxString& stacktrace )