diff --git a/pcbnew/dialogs/dialog_export_step_process.cpp b/pcbnew/dialogs/dialog_export_step_process.cpp index aa26e93631..62a9c3d9da 100644 --- a/pcbnew/dialogs/dialog_export_step_process.cpp +++ b/pcbnew/dialogs/dialog_export_step_process.cpp @@ -152,6 +152,15 @@ void STDSTREAM_THREAD::DrainInput() } +bool DIALOG_EXPORT_STEP_LOG::TransferDataToWindow() +{ + // Ensure we start with a clean log window message + m_textCtrlLog->Clear(); + m_textCtrlLog->AppendText( m_startMessage ); + return true; +} + + void DIALOG_EXPORT_STEP_LOG::appendMessage( const wxString& aMessage ) { m_textCtrlLog->AppendText( aMessage ); @@ -229,6 +238,9 @@ void DIALOG_EXPORT_STEP_LOG::onClose( wxCloseEvent& aEvent ) m_process->Detach(); } + // Clear log window message, storing the log data in config has no interest. + m_textCtrlLog->Clear(); + aEvent.Skip(); } @@ -238,7 +250,7 @@ DIALOG_EXPORT_STEP_LOG::~DIALOG_EXPORT_STEP_LOG() } -DIALOG_EXPORT_STEP_LOG::DIALOG_EXPORT_STEP_LOG( wxWindow* aParent, wxString aStepCmd ) : +DIALOG_EXPORT_STEP_LOG::DIALOG_EXPORT_STEP_LOG( wxWindow* aParent, const wxString& aStepCmd ) : DIALOG_EXPORT_STEP_PROCESS_BASE( aParent ) { m_sdbSizerOK->Enable( false ); @@ -254,16 +266,18 @@ DIALOG_EXPORT_STEP_LOG::DIALOG_EXPORT_STEP_LOG( wxWindow* aParent, wxString aSte // Print the command line used to run kicad-cli. // it can be useful if kicad-cli as a problem. - m_textCtrlLog->AppendText( _( "Command line:\n" ) ); - m_textCtrlLog->AppendText( aStepCmd ); - m_textCtrlLog->AppendText( wxT( "\n\n" ) ); + // However it cannot be printed in the Ctor, but only in TransferDataToWindow(), + // after DIALOG_SHIM initializations + m_startMessage.Append( _( "Command line:\n" ) ); + m_startMessage.Append( aStepCmd ); + m_startMessage.Append( wxT( "\n\n" ) ); m_stdioThread = new STDSTREAM_THREAD( this, m_process, m_msgQueue ); m_stdioThread->Run(); if( !m_stdioThread->IsRunning() ) { - m_textCtrlLog->AppendText( "Unable to launch stdstream thread.\n" ); + m_startMessage.Append( "Unable to launch stdstream thread.\n" ); delete m_stdioThread; return; } diff --git a/pcbnew/dialogs/dialog_export_step_process.h b/pcbnew/dialogs/dialog_export_step_process.h index de79f54243..4e9b16c41e 100644 --- a/pcbnew/dialogs/dialog_export_step_process.h +++ b/pcbnew/dialogs/dialog_export_step_process.h @@ -40,7 +40,7 @@ public: SENTINEL ///< Just a dummy entry for end of list }; - DIALOG_EXPORT_STEP_LOG( wxWindow* aParent, wxString aStepCmd ); + DIALOG_EXPORT_STEP_LOG( wxWindow* aParent, const wxString& aStepCmd ); ~DIALOG_EXPORT_STEP_LOG() override; private: @@ -48,8 +48,10 @@ private: void onProcessTerminate( wxProcessEvent& aEvent ); void onThreadInput( wxThreadEvent& ); void onClose( wxCloseEvent& event ); + bool TransferDataToWindow() override; wxProcess* m_process; wxThread* m_stdioThread; wxMessageQueue m_msgQueue; + wxString m_startMessage; }; \ No newline at end of file diff --git a/pcbnew/dialogs/dialog_export_step_process_base.fbp b/pcbnew/dialogs/dialog_export_step_process_base.fbp index f2be8e2861..c1a899d4f4 100644 --- a/pcbnew/dialogs/dialog_export_step_process_base.fbp +++ b/pcbnew/dialogs/dialog_export_step_process_base.fbp @@ -1,214 +1,219 @@ - + - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_export_step_process_base - 1000 - none - - - 1 - dialog_export_step_process - - . - - 1 - 1 - 1 - 1 - UI - 0 - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT + + + C++ + + 1 + connect + none + + + 0 + 1 + res + UTF-8 + dialog_export_step_process_base + 1000 + 1 + 1 + UI + dialog_export_step_process + . + 0 + source_name + 1 + 0 + source_name + + + 1 + 1 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 0 + 1 + impl_virtual + + + + 0 + wxID_ANY + + -1,-1 + DIALOG_EXPORT_STEP_PROCESS_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + 3D Export + + 0 + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + - + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left + 0 1 - impl_virtual - + 1 + 0 0 wxID_ANY + + 0 - -1,-1 - DIALOG_EXPORT_STEP_PROCESS_BASE + 0 + + 0 + 450,250 + 1 + m_textCtrlLog + 1 + + + protected + 1 - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - 3D Export + Resizable + 1 + + wxTE_MULTILINE|wxTE_READONLY + ; ; forward_declare + 0 - 0 + + wxFILTER_NONE + wxDefaultValidator + + - - - bMainSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - 450,250 - 1 - m_textCtrlLog - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_MULTILINE|wxTE_READONLY - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_activityGauge - 1 - - - protected - 1 - - 100 - Resizable - 1 - - wxGA_HORIZONTAL - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer - protected - OnButtonPlot - - - + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_activityGauge + 1 + + + protected + 1 + + 100 + Resizable + 1 + + wxGA_HORIZONTAL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + OnButtonPlot + + + +