From 37c31196f42795bfaf7e06588bd379aface0cfb7 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 29 May 2021 10:23:11 +0200 Subject: [PATCH] Eeschema, importFile: build the HTML report messages before displaying the dialog. Fixes #8507 https://gitlab.com/kicad/code/kicad/issues/8507 --- common/dialogs/wx_html_report_box.h | 12 ++++++++++++ eeschema/files-io.cpp | 3 +++ 2 files changed, 15 insertions(+) diff --git a/common/dialogs/wx_html_report_box.h b/common/dialogs/wx_html_report_box.h index 9ba84f9e33..fd3c1d240e 100644 --- a/common/dialogs/wx_html_report_box.h +++ b/common/dialogs/wx_html_report_box.h @@ -43,9 +43,21 @@ public: void SetUnits( EDA_UNITS aUnits ) { m_units = aUnits; } EDA_UNITS GetUnits() const override { return m_units; } + /** + * In immediate mode, messages are flushed as they are added. + * Required for progress-related reports, but can be very slow for larger reports. + */ void SetImmediateMode() { m_immediateMode = true; } + /** + * Build the HTML messages page. + * Call it if the immediate mode is not actived to be able to display them + */ void Flush(); + + /** + * Delete the stored messages + */ void Clear(); private: diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index f5d963a356..f9b28a7344 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -1118,7 +1118,10 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType ) Schematic().SetRoot( pi->Load( aFileName, &Schematic() ) ); if( reporter->m_Reporter->HasMessage() ) + { + reporter->m_Reporter->Flush(); // Build HTML messages reporter->ShowModal(); + } pi->SetReporter( &WXLOG_REPORTER::GetInstance() ); delete reporter;