From d319cd4b890fd9c76a7ef1ba9cf572d9d7ce0833 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sat, 22 Jun 2024 20:35:23 +0300 Subject: [PATCH] Improve error message when trying to Open non-KiCad schematic files. See https://gitlab.com/kicad/code/kicad/-/issues/18241 --- eeschema/files-io.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 2f79b92c52..dacd572ea4 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -181,7 +181,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in CreateScreens(); } - SCH_IO_MGR::SCH_FILE_T schFileType = SCH_IO_MGR::GuessPluginTypeFromSchPath( fullFileName ); + SCH_IO_MGR::SCH_FILE_T schFileType = SCH_IO_MGR::GuessPluginTypeFromSchPath( fullFileName, KICTL_KICAD_ONLY ); if( schFileType == SCH_IO_MGR::SCH_LEGACY ) { @@ -231,7 +231,10 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in if( schFileType == SCH_IO_MGR::SCH_FILE_T::SCH_FILE_UNKNOWN ) { - msg.Printf( _( "Unsupported schematic file '%s'." ), fullFileName ); + msg.Printf( _( "'%s' is not a KiCad schematic file.\nUse File -> Import for " + "non-KiCad schematic files." ), + fullFileName ); + progressReporter.Hide(); DisplayErrorMessage( this, msg ); }