MCPcopy Create free account
hub / github.com/audacity/audacity / DelayedHandlerAction

Method DelayedHandlerAction

libraries/lib-exceptions/AudacityException.cpp:82–116  ·  view source on GitHub ↗

This is meant to be invoked via wxEvtHandler::CallAfter

Source from the content-addressed store, hash-verified

80
81// This is meant to be invoked via wxEvtHandler::CallAfter
82void 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}

Callers

nothing calls this directly

Calls 6

ErrorHelpUrlFunction · 0.85
ShowMessageBoxFunction · 0.85
DefaultCaptionFunction · 0.85
ShowErrorDialogFunction · 0.85
IsEmptyMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected