This is meant to be invoked via wxEvtHandler::CallAfter
| 80 | |
| 81 | // This is meant to be invoked via wxEvtHandler::CallAfter |
| 82 | void MessageBoxException::DelayedHandlerAction() |
| 83 | { |
| 84 | if (!moved) { |
| 85 | // This test prevents accumulation of multiple messages between idle |
| 86 | // times of the main even loop. Only the last queued exception |
| 87 | // displays its message. We assume that multiple messages have a |
| 88 | // common cause such as exhaustion of disk space so that the others |
| 89 | // give the user no useful added information. |
| 90 | |
| 91 | using namespace BasicUI; |
| 92 | if ( wxAtomicDec( sOutstandingMessages ) == 0 ) { |
| 93 | if (exceptionType != ExceptionType::Internal |
| 94 | && ErrorHelpUrl().IsEmpty()) { |
| 95 | // We show BadEnvironment and BadUserAction in a similar way |
| 96 | ShowMessageBox( |
| 97 | ErrorMessage(), |
| 98 | MessageBoxOptions{} |
| 99 | .Caption(caption.empty() ? DefaultCaption() : caption) |
| 100 | .IconStyle(Icon::Error) ); |
| 101 | } |
| 102 | else { |
| 103 | using namespace BasicUI; |
| 104 | auto type = exceptionType == ExceptionType::Internal |
| 105 | ? ErrorDialogType::ModalErrorReport : ErrorDialogType::ModalError; |
| 106 | ShowErrorDialog( {}, |
| 107 | (caption.empty() ? DefaultCaption() : caption), |
| 108 | ErrorMessage(), |
| 109 | ErrorHelpUrl(), |
| 110 | ErrorDialogOptions{ type } ); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | moved = true; |
| 115 | } |
| 116 | } |
nothing calls this directly
no test coverage detected