Prefer MRU path to LastImportExportPath for importing footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15102
This commit is contained in:
parent
0652267d00
commit
b294530716
|
@ -73,7 +73,7 @@ public:
|
|||
|
||||
int m_LibWidth;
|
||||
|
||||
wxString m_LastImportExportPath;
|
||||
wxString m_LastExportPath;
|
||||
|
||||
wxString m_FootprintTextShownColumns;
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
|
|||
m_Use45Limit( true ),
|
||||
m_ArcEditMode( ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS ),
|
||||
m_LibWidth( 250 ),
|
||||
m_LastImportExportPath(),
|
||||
m_LastExportPath(),
|
||||
m_FootprintTextShownColumns()
|
||||
{
|
||||
m_MagneticItems.pads = MAGNETIC_OPTIONS::CAPTURE_ALWAYS;
|
||||
|
@ -72,7 +72,7 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
|
|||
&m_AuiPanels.appearance_panel_tab, 0, 0, 2 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "system.last_import_export_path",
|
||||
&m_LastImportExportPath, "" ) );
|
||||
&m_LastExportPath, "" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "window.footprint_text_shown_columns",
|
||||
&m_FootprintTextShownColumns, "0 1 2 3 4 5 6" ) );
|
||||
|
|
|
@ -234,18 +234,13 @@ FOOTPRINT* try_load_footprint( const wxFileName& aFileName, IO_MGR::PCB_FILE_T a
|
|||
|
||||
FOOTPRINT* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
|
||||
{
|
||||
wxString lastOpenedPathForLoading = m_mruPath;
|
||||
FOOTPRINT_EDITOR_SETTINGS* cfg = GetSettings();
|
||||
|
||||
if( !cfg->m_LastImportExportPath.empty() )
|
||||
lastOpenedPathForLoading = cfg->m_LastImportExportPath;
|
||||
|
||||
wxFileName fn;
|
||||
FOOTPRINT_EDITOR_SETTINGS* cfg = GetSettings();
|
||||
wxFileName fn;
|
||||
|
||||
if( aName != wxT("") )
|
||||
fn = aName;
|
||||
else
|
||||
fn = getFootprintFilenameFromUser( this, lastOpenedPathForLoading );
|
||||
fn = getFootprintFilenameFromUser( this, m_mruPath );
|
||||
|
||||
if( !fn.IsOk() )
|
||||
return nullptr;
|
||||
|
@ -259,7 +254,7 @@ FOOTPRINT* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
m_mruPath = cfg->m_LastImportExportPath = fn.GetPath();
|
||||
m_mruPath = fn.GetPath();
|
||||
|
||||
wxString footprintName;
|
||||
IO_MGR::PCB_FILE_T fileType = detect_file_type( fp, fn.GetFullPath(), &footprintName );
|
||||
|
@ -330,8 +325,8 @@ void FOOTPRINT_EDIT_FRAME::ExportFootprint( FOOTPRINT* aFootprint )
|
|||
|
||||
fn.SetExt( KiCadFootprintFileExtension );
|
||||
|
||||
if( !cfg->m_LastImportExportPath.empty() )
|
||||
fn.SetPath( cfg->m_LastImportExportPath );
|
||||
if( !cfg->m_LastExportPath.empty() )
|
||||
fn.SetPath( cfg->m_LastExportPath );
|
||||
else
|
||||
fn.SetPath( m_mruPath );
|
||||
|
||||
|
@ -342,7 +337,7 @@ void FOOTPRINT_EDIT_FRAME::ExportFootprint( FOOTPRINT* aFootprint )
|
|||
return;
|
||||
|
||||
fn = dlg.GetPath();
|
||||
cfg->m_LastImportExportPath = fn.GetPath();
|
||||
cfg->m_LastExportPath = fn.GetPath();
|
||||
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue