fp library wizard: remember last local download directory & refresh download progress dialog.
This commit is contained in:
parent
bdf1d1335b
commit
c55e729117
|
@ -50,6 +50,7 @@
|
||||||
|
|
||||||
// a key to store the default Kicad Github libs URL
|
// a key to store the default Kicad Github libs URL
|
||||||
#define KICAD_FPLIBS_URL_KEY wxT( "kicad_fplib_url" )
|
#define KICAD_FPLIBS_URL_KEY wxT( "kicad_fplib_url" )
|
||||||
|
#define KICAD_FPLIBS_LAST_DOWNLOAD_DIR wxT( "kicad_fplib_last_download_dir" )
|
||||||
|
|
||||||
// Filters for the file picker
|
// Filters for the file picker
|
||||||
static const int FILTER_COUNT = 4;
|
static const int FILTER_COUNT = 4;
|
||||||
|
@ -303,8 +304,19 @@ WIZARD_FPLIB_TABLE::WIZARD_FPLIB_TABLE( wxWindow* aParent ) :
|
||||||
|
|
||||||
// Restore the Github url
|
// Restore the Github url
|
||||||
wxString githubUrl;
|
wxString githubUrl;
|
||||||
|
|
||||||
wxConfigBase* cfg = Pgm().CommonSettings();
|
wxConfigBase* cfg = Pgm().CommonSettings();
|
||||||
cfg->Read( KICAD_FPLIBS_URL_KEY, &githubUrl );
|
cfg->Read( KICAD_FPLIBS_URL_KEY, &githubUrl );
|
||||||
|
cfg->Read( KICAD_FPLIBS_LAST_DOWNLOAD_DIR, &m_lastGithubDownloadDirectory );
|
||||||
|
|
||||||
|
|
||||||
|
if( !m_lastGithubDownloadDirectory.IsEmpty() )
|
||||||
|
{
|
||||||
|
setDownloadDir( m_lastGithubDownloadDirectory );
|
||||||
|
m_filePicker->SetPath( m_lastGithubDownloadDirectory );
|
||||||
|
} else {
|
||||||
|
m_lastGithubDownloadDirectory = default_path;
|
||||||
|
}
|
||||||
|
|
||||||
if( githubUrl.IsEmpty() )
|
if( githubUrl.IsEmpty() )
|
||||||
githubUrl = wxT( "https://github.com/KiCad" );
|
githubUrl = wxT( "https://github.com/KiCad" );
|
||||||
|
@ -531,6 +543,10 @@ void WIZARD_FPLIB_TABLE::OnBrowseButtonClick( wxCommandEvent& aEvent )
|
||||||
if( !path.IsEmpty() && wxDirExists( path ) )
|
if( !path.IsEmpty() && wxDirExists( path ) )
|
||||||
{
|
{
|
||||||
setDownloadDir( path );
|
setDownloadDir( path );
|
||||||
|
|
||||||
|
wxConfigBase* cfg = Pgm().CommonSettings();
|
||||||
|
cfg->Write( KICAD_FPLIBS_LAST_DOWNLOAD_DIR, path );
|
||||||
|
|
||||||
updateGithubControls();
|
updateGithubControls();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -613,6 +629,8 @@ bool WIZARD_FPLIB_TABLE::downloadGithubLibsFromList( wxArrayString& aUrlList,
|
||||||
wxMkdir( libdst_name );
|
wxMkdir( libdst_name );
|
||||||
|
|
||||||
pdlg.Update( ii, libsrc_name );
|
pdlg.Update( ii, libsrc_name );
|
||||||
|
pdlg.Refresh();
|
||||||
|
pdlg.Update();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -273,4 +273,7 @@ protected:
|
||||||
// determine what's the real cause of the event. Therefore here we store the number of the
|
// determine what's the real cause of the event. Therefore here we store the number of the
|
||||||
// selected file type filter.
|
// selected file type filter.
|
||||||
int m_selectedFilter;
|
int m_selectedFilter;
|
||||||
|
|
||||||
|
// path to the most recently used download directory from Github.
|
||||||
|
wxString m_lastGithubDownloadDirectory;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue