diff --git a/src/AudacityException.cpp b/src/AudacityException.cpp index 14cd571fe..b7849b343 100644 --- a/src/AudacityException.cpp +++ b/src/AudacityException.cpp @@ -15,6 +15,7 @@ #include #include "widgets/AudacityMessageBox.h" +#include "widgets/ErrorDialog.h" AudacityException::~AudacityException() { @@ -40,6 +41,7 @@ MessageBoxException::MessageBoxException( const MessageBoxException& that ) { caption = that.caption; moved = that.moved; + helpUrl = that.helpUrl; that.moved = true; } @@ -69,12 +71,25 @@ void MessageBoxException::DelayedHandlerAction() // displays its message. We assume that multiple messages have a // common cause such as exhaustion of disk space so that the others // give the user no useful added information. + if ( wxAtomicDec( sOutstandingMessages ) == 0 ) - ::AudacityMessageBox( - ErrorMessage(), - (caption.empty() ? AudacityMessageBoxCaptionStr() : caption), - wxICON_ERROR - ); + if (helpUrl.IsEmpty()) + { + ::AudacityMessageBox( + ErrorMessage(), + (caption.empty() ? AudacityMessageBoxCaptionStr() : caption), + wxICON_ERROR + ); + } + else + { + ShowErrorDialog( + nullptr, + (caption.empty() ? AudacityMessageBoxCaptionStr() : caption), + ErrorMessage(), + helpUrl); + } + moved = true; } } diff --git a/src/AudacityException.h b/src/AudacityException.h index 0b1a8f5fe..0ed1227bb 100644 --- a/src/AudacityException.h +++ b/src/AudacityException.h @@ -68,6 +68,8 @@ protected: private: TranslatableString caption; //!< Stored caption mutable bool moved { false }; //!< Whether @c *this has been the source of a copy +protected: + mutable wxString helpUrl{ "" }; }; //! A MessageBoxException that shows a given, unvarying string. @@ -76,11 +78,14 @@ class SimpleMessageBoxException /* not final */ : public MessageBoxException public: explicit SimpleMessageBoxException( const TranslatableString &message_, //