BOM Export: remember filename per project

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17704
This commit is contained in:
Mike Williams 2024-04-11 15:05:17 -04:00
parent d0fe2e06aa
commit 9c058503d9
3 changed files with 8 additions and 2 deletions

View File

@ -305,7 +305,7 @@ DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE( SCH_EDIT_FRAME* parent )
case SCOPE::SCOPE_SHEET_RECURSIVE: m_radioRecursive->SetValue( true ); break;
}
m_outputFileName->SetValue( cfg->m_FieldEditorPanel.export_filename );
m_outputFileName->SetValue( m_schSettings.m_BomExportFileName );
Center();
@ -1337,12 +1337,13 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnClose( wxCloseEvent& aEvent )
// Save all our settings since we're really closing
savePresetsToSchematic();
m_schSettings.m_BomExportFileName = m_outputFileName->GetValue();
EESCHEMA_SETTINGS* cfg = m_parent->eeconfig();
cfg->m_FieldEditorPanel.width = GetSize().x;
cfg->m_FieldEditorPanel.height = GetSize().y;
cfg->m_FieldEditorPanel.page = m_nbPages->GetSelection();
cfg->m_FieldEditorPanel.export_filename = m_outputFileName->GetValue();
if( m_radioHighlight->GetValue() )
cfg->m_FieldEditorPanel.selection_mode = 0;

View File

@ -196,6 +196,9 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
m_TemplateFieldNames.AddTemplateFieldNames( cfg->m_Drawing.field_names );
}, {} ) );
m_params.emplace_back( new PARAM<wxString>( "bom_export_filename",
&m_BomExportFileName, "" ) );
m_params.emplace_back( new PARAM<BOM_PRESET>( "bom_settings",
&m_BomSettings, BOM_PRESET::GroupedByValue() ) );
m_params.emplace_back( new PARAM_LIST<BOM_PRESET>( "bom_presets",

View File

@ -105,6 +105,8 @@ public:
TEMPLATES m_TemplateFieldNames;
wxString m_BomExportFileName;
/// List of stored BOM presets
BOM_PRESET m_BomSettings;
std::vector<BOM_PRESET> m_BomPresets;