MRU path for simulation model libraries.
Fixes https://gitlab.com/kicad/code/kicad/issues/13581
This commit is contained in:
parent
da1707d5ba
commit
27109bfc8a
|
@ -1060,14 +1060,19 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathTextKillFocus( wxFocusEve
|
|||
template <typename T_symbol, typename T_field>
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onBrowseButtonClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
wxFileDialog dlg( this, _( "Browse Models" ), Prj().GetProjectPath() );
|
||||
static wxString s_mruPath;
|
||||
|
||||
wxString path = s_mruPath.IsEmpty() ? Prj().GetProjectPath() : s_mruPath;
|
||||
wxFileDialog dlg( this, _( "Browse Models" ), path );
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
|
||||
wxString path = dlg.GetPath();
|
||||
path = dlg.GetPath();
|
||||
wxFileName fn( path );
|
||||
|
||||
s_mruPath = fn.GetPath();
|
||||
|
||||
if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( wxS( ".." ) ) )
|
||||
path = fn.GetFullPath();
|
||||
|
||||
|
|
|
@ -60,8 +60,10 @@ void SYMBOL_EDIT_FRAME::ImportSymbol()
|
|||
wxFileName fn = dlg.GetPath();
|
||||
|
||||
if( fn.GetExt().IsEmpty() )
|
||||
fn.SetExt( (dlg.GetFilterIndex() == 0) ?
|
||||
KiCadSymbolLibFileExtension : LegacySymbolLibFileExtension );
|
||||
{
|
||||
fn.SetExt( (dlg.GetFilterIndex() == 0) ? KiCadSymbolLibFileExtension
|
||||
: LegacySymbolLibFileExtension );
|
||||
}
|
||||
|
||||
m_mruPath = fn.GetPath();
|
||||
|
||||
|
|
Loading…
Reference in New Issue