From ba49bd038641c687440d421ed8acf16b7d2568b4 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 26 Mar 2018 00:51:16 +0100 Subject: [PATCH] Allow XLS netlist exporters to specify a file extension. Fixes: lp:1591779 * https://bugs.launchpad.net/kicad/+bug/1591779 --- eeschema/dialogs/dialog_netlist.cpp | 11 ++++++++++- eeschema/plugins/CMakeLists.txt | 2 +- ...orm_pads-pcb.xsl => netlist_form_pads-pcb.asc.xsl} | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) rename eeschema/plugins/xsl_scripts/{netlist_form_pads-pcb.xsl => netlist_form_pads-pcb.asc.xsl} (96%) diff --git a/eeschema/dialogs/dialog_netlist.cpp b/eeschema/dialogs/dialog_netlist.cpp index 13b87ed39c..9b80190180 100644 --- a/eeschema/dialogs/dialog_netlist.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -55,7 +55,7 @@ #include #include - +#include #define CUSTOMPANEL_COUNTMAX 8 // Max number of netlist plugins @@ -580,8 +580,17 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) break; default: // custom, NET_TYPE_CUSTOM1 and greater + { + wxString command = currPage->m_CommandStringCtrl->GetValue(); + wxRegEx extRE( wxT( ".*\\.([[:alnum:]][[:alnum:]][[:alnum:]][[:alnum:]]?)\\.xslt?\".*" ) ); + + if( extRE.Matches( command ) ) + fileExt = extRE.GetMatch( command, 1 ); + title.Printf( _( "%s Export" ), currPage->m_TitleStringCtrl->GetValue().GetData() ); } + break; + } fn.SetExt( fileExt ); diff --git a/eeschema/plugins/CMakeLists.txt b/eeschema/plugins/CMakeLists.txt index 5cf34d8771..f6b235d9b3 100644 --- a/eeschema/plugins/CMakeLists.txt +++ b/eeschema/plugins/CMakeLists.txt @@ -9,7 +9,7 @@ set( XSL_SCRIPTS_LIST xsl_scripts/netlist_form_cadstar-RINF.xsl xsl_scripts/netlist_form_cadstar.xsl xsl_scripts/netlist_form_OrcadPcb2.xsl - xsl_scripts/netlist_form_pads-pcb.xsl + xsl_scripts/netlist_form_pads-pcb.asc.xsl xsl_scripts/bom_with_title_block_2_csv.xsl ) diff --git a/eeschema/plugins/xsl_scripts/netlist_form_pads-pcb.xsl b/eeschema/plugins/xsl_scripts/netlist_form_pads-pcb.asc.xsl similarity index 96% rename from eeschema/plugins/xsl_scripts/netlist_form_pads-pcb.xsl rename to eeschema/plugins/xsl_scripts/netlist_form_pads-pcb.asc.xsl index 355072c530..425275bfd9 100644 --- a/eeschema/plugins/xsl_scripts/netlist_form_pads-pcb.xsl +++ b/eeschema/plugins/xsl_scripts/netlist_form_pads-pcb.asc.xsl @@ -15,7 +15,7 @@ - *PADS-PCB*&nl;*PART*&nl; + !PADS-POWERPCB-V2.0-MILS!&nl;*PART*&nl; &nl;*NET*&nl;