gui: Make Msgbox more consistent

Just use ShowModal. That will invoke pxMessageDialog on the main thread
anyway.
This commit is contained in:
Jonathan Li 2015-06-25 16:53:10 +01:00
parent 2a4bd85f53
commit 9a171a5928
1 changed files with 2 additions and 20 deletions

View File

@ -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 )