Remember the last directory in FPLib Wizard.

Fixes: lp:1577965
* https://bugs.launchpad.net/kicad/+bug/1577965
This commit is contained in:
Jeff Young 2018-05-10 09:59:59 +01:00
parent e339007d22
commit 933ff189ad
1 changed files with 6 additions and 3 deletions

View File

@ -54,7 +54,7 @@
// a key to store the default Kicad Github libs URL
#define KICAD_FPLIBS_URL_KEY wxT( "kicad_fplib_url" )
#define KICAD_FPLIBS_LAST_DOWNLOAD_DIR wxT( "kicad_fplib_last_download_dir" )
#define KICAD_FPLIBS_LAST_DIR wxT( "kicad_fplib_last_download_dir" )
// Filters for the file picker
static const int FILTER_COUNT = 4;
@ -303,7 +303,7 @@ WIZARD_FPLIB_TABLE::WIZARD_FPLIB_TABLE( wxWindow* aParent ) :
wxConfigBase* cfg = Pgm().CommonSettings();
cfg->Read( KICAD_FPLIBS_URL_KEY, &githubUrl );
cfg->Read( KICAD_FPLIBS_LAST_DOWNLOAD_DIR, &m_lastGithubDownloadDirectory );
cfg->Read( KICAD_FPLIBS_LAST_DIR, &m_lastGithubDownloadDirectory );
if( !m_lastGithubDownloadDirectory.IsEmpty() )
@ -541,7 +541,7 @@ void WIZARD_FPLIB_TABLE::OnBrowseButtonClick( wxCommandEvent& aEvent )
setDownloadDir( path );
wxConfigBase* cfg = Pgm().CommonSettings();
cfg->Write( KICAD_FPLIBS_LAST_DOWNLOAD_DIR, path );
cfg->Write( KICAD_FPLIBS_LAST_DIR, path );
updateGithubControls();
}
@ -575,6 +575,9 @@ bool WIZARD_FPLIB_TABLE::checkFiles() const
return false;
}
wxConfigBase* cfg = Pgm().CommonSettings();
cfg->Write( KICAD_FPLIBS_LAST_DIR, candidates[0] );
return true;
}