BOM Export: remember filename per project

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17704
(cherry picked from commit 9c058503d9)
This commit is contained in:
Mike Williams 2024-04-11 15:05:17 -04:00 committed by Jeff Young
parent 6aee6f857e
commit 1f88d33c81
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();
@ -1338,12 +1338,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;