Include markdown files in project view.

Fixes https://gitlab.com/kicad/code/kicad/issues/12178
This commit is contained in:
Jeff Young 2022-09-10 21:11:03 +01:00
parent eb70934457
commit a9877ab117
5 changed files with 7 additions and 1 deletions

View File

@ -171,6 +171,7 @@ const std::string WorkbookFileExtension( "wbk" );
const std::string PngFileExtension( "png" );
const std::string JpegFileExtension( "jpg" );
const std::string TextFileExtension( "txt" );
const std::string MarkdownFileExtension( "md" );
const std::string CsvFileExtension( "csv" );

View File

@ -161,6 +161,7 @@ extern const std::string WorkbookFileExtension;
extern const std::string PngFileExtension;
extern const std::string JpegFileExtension;
extern const std::string TextFileExtension;
extern const std::string MarkdownFileExtension;
extern const std::string CsvFileExtension;

View File

@ -233,6 +233,7 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame )
case TREE_FILE_TYPE::NET:
case TREE_FILE_TYPE::TXT:
case TREE_FILE_TYPE::MD:
case TREE_FILE_TYPE::REPORT:
toolMgr->RunAction( KICAD_MANAGER_ACTIONS::openTextEditor, true, &fullFileName );
break;

View File

@ -82,7 +82,8 @@ static const wxChar* s_allowedExtensionsToList[] = {
wxT( "^.*\\.cir$" ), // Spice netlist file
wxT( "^.*\\.lib$" ), // Legacy schematic library file
wxT( "^.*\\.kicad_sym$" ), // S-expr symbol libraries
wxT( "^.*\\.txt$" ),
wxT( "^.*\\.txt$" ), // Text files
wxT( "^.*\\.md$" ), // Markdown files
wxT( "^.*\\.pho$" ), // Gerber file (Old Kicad extension)
wxT( "^.*\\.gbr$" ), // Gerber file
wxT( "^.*\\.gbrjob$" ), // Gerber job file
@ -269,6 +270,7 @@ wxString PROJECT_TREE_PANE::GetFileExt( TREE_FILE_TYPE type )
case TREE_FILE_TYPE::HTML: return HtmlFileExtension;
case TREE_FILE_TYPE::PDF: return PdfFileExtension;
case TREE_FILE_TYPE::TXT: return TextFileExtension;
case TREE_FILE_TYPE::MD: return MarkdownFileExtension;
case TREE_FILE_TYPE::NET: return NetlistFileExtension;
case TREE_FILE_TYPE::CMP_LINK: return FootprintAssignmentFileExtension;
case TREE_FILE_TYPE::REPORT: return ReportFileExtension;

View File

@ -44,6 +44,7 @@ enum class TREE_FILE_TYPE
HTML, // HTML file (.htm, *.html)
PDF, // PDF file (.pdf)
TXT, // ascii text file (.txt)
MD, // markdown file (.md)
NET, // netlist file (.net)
UNKNOWN,
DIRECTORY,