mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 16:50:26 +02:00
Define SimpleMessageBoxException
This commit is contained in:
parent
d1cbac4181
commit
8e2e4a53b8
@ -50,6 +50,21 @@ MessageBoxException::~MessageBoxException()
|
||||
wxAtomicDec( sOutstandingMessages );
|
||||
}
|
||||
|
||||
SimpleMessageBoxException::~SimpleMessageBoxException()
|
||||
{
|
||||
}
|
||||
|
||||
wxString SimpleMessageBoxException::ErrorMessage() const
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
std::unique_ptr< AudacityException > SimpleMessageBoxException::Move()
|
||||
{
|
||||
return std::unique_ptr< AudacityException >
|
||||
{ safenew SimpleMessageBoxException{ std::move( *this ) } };
|
||||
}
|
||||
|
||||
// This is meant to be invoked via wxEvtHandler::CallAfter
|
||||
void MessageBoxException::DelayedHandlerAction()
|
||||
{
|
||||
|
@ -69,6 +69,30 @@ private:
|
||||
mutable bool moved { false };
|
||||
};
|
||||
|
||||
// MessageBoxException that shows a given, unvarying string.
|
||||
class SimpleMessageBoxException /* not final */ : public MessageBoxException
|
||||
{
|
||||
public:
|
||||
explicit SimpleMessageBoxException( const wxString &message_,
|
||||
const wxString &caption = wxString{} )
|
||||
: MessageBoxException{ caption }
|
||||
, message{ message_ }
|
||||
{}
|
||||
~SimpleMessageBoxException() override;
|
||||
|
||||
SimpleMessageBoxException( const SimpleMessageBoxException& ) = default;
|
||||
SimpleMessageBoxException &operator = (
|
||||
SimpleMessageBoxException && ) PROHIBITED;
|
||||
|
||||
std::unique_ptr< AudacityException > Move() override;
|
||||
|
||||
// Format a default, internationalized error message for this exception.
|
||||
virtual wxString ErrorMessage() const override;
|
||||
|
||||
private:
|
||||
wxString message;
|
||||
};
|
||||
|
||||
struct DefaultDelayedHandlerAction
|
||||
{
|
||||
void operator () (AudacityException *pException) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user