1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Fix \n shenanigans in command output.

This commit is contained in:
James Crook
2018-02-11 09:00:23 +00:00
committed by Paul Licameli
parent 65c160212e
commit 510f68e9ad
4 changed files with 25 additions and 25 deletions

View File

@@ -149,7 +149,8 @@ bool ApplyAndSendResponse::Apply()
bool bResult = mCommand->Apply(*( mCtx.get()));
return bResult; }
);
wxString response = GetName();
wxString response = wxT( "\n" );
response += GetName();
// These three strings are deliberately not localised.
// They are used in script responses and always happen in English.
response += wxT(" finished: ");

View File

@@ -218,17 +218,25 @@ class ResponseQueueTarget final : public CommandMessageTarget
{
private:
ResponseQueue &mResponseQueue;
wxString mBuffer;
public:
ResponseQueueTarget(ResponseQueue &responseQueue)
: mResponseQueue(responseQueue)
: mResponseQueue(responseQueue),
mBuffer( wxEmptyString )
{ }
virtual ~ResponseQueueTarget()
{
if( mBuffer.StartsWith("\n" ) )
mBuffer = mBuffer.Mid( 1 );
mResponseQueue.AddResponse( mBuffer );
mResponseQueue.AddResponse(wxString(wxT("\n")));
}
void Update(const wxString &message) override
{
mResponseQueue.AddResponse(message);
mBuffer += message;
#if 0
mResponseQueue.AddResponse(message);
#endif
}
};