Fixed Footprint Library Wizard for builds with GIthub plugin disabled.
This commit is contained in:
parent
bbbb84e6c2
commit
be839aca29
|
@ -378,9 +378,12 @@ void WIZARD_FPLIB_TABLE::OnPageChanged( wxWizardEvent& aEvent )
|
||||||
SetBitmap( KiBitmap( wizard_add_fplib_icon_xpm ) );
|
SetBitmap( KiBitmap( wizard_add_fplib_icon_xpm ) );
|
||||||
enableNext( true );
|
enableNext( true );
|
||||||
|
|
||||||
|
#ifdef BUILD_GITHUB_PLUGIN
|
||||||
if( GetCurrentPage() == m_githubListDlg )
|
if( GetCurrentPage() == m_githubListDlg )
|
||||||
setupGithubList();
|
setupGithubList();
|
||||||
else if( GetCurrentPage() == m_fileSelectDlg )
|
else
|
||||||
|
#endif
|
||||||
|
if( GetCurrentPage() == m_fileSelectDlg )
|
||||||
setupFileSelect();
|
setupFileSelect();
|
||||||
else if( GetCurrentPage() == m_reviewDlg )
|
else if( GetCurrentPage() == m_reviewDlg )
|
||||||
setupReview();
|
setupReview();
|
||||||
|
@ -481,6 +484,7 @@ void WIZARD_FPLIB_TABLE::OnChangeSearch( wxCommandEvent& aEvent )
|
||||||
|
|
||||||
void WIZARD_FPLIB_TABLE::OnWizardFinished( wxWizardEvent& aEvent )
|
void WIZARD_FPLIB_TABLE::OnWizardFinished( wxWizardEvent& aEvent )
|
||||||
{
|
{
|
||||||
|
#ifdef BUILD_GITHUB_PLUGIN
|
||||||
// Shall we download a localy copy of the libraries
|
// Shall we download a localy copy of the libraries
|
||||||
if( GetLibSource() == GITHUB && m_downloadGithub->GetValue() )
|
if( GetLibSource() == GITHUB && m_downloadGithub->GetValue() )
|
||||||
{
|
{
|
||||||
|
@ -511,11 +515,11 @@ void WIZARD_FPLIB_TABLE::OnWizardFinished( wxWizardEvent& aEvent )
|
||||||
wxString path = it->GetAbsolutePath();
|
wxString path = it->GetAbsolutePath();
|
||||||
path.Replace( GetGithubURL(), getDownloadDir() );
|
path.Replace( GetGithubURL(), getDownloadDir() );
|
||||||
it->setPath( path );
|
it->setPath( path );
|
||||||
std::cout << "replaced path " << it->GetAbsolutePath() << std::endl;
|
|
||||||
it->setPluginType( IO_MGR::KICAD );
|
it->setPluginType( IO_MGR::KICAD );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -637,6 +641,25 @@ bool WIZARD_FPLIB_TABLE::downloadGithubLibsFromList( wxArrayString& aUrlList,
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WIZARD_FPLIB_TABLE::setupGithubList()
|
||||||
|
{
|
||||||
|
// Enable 'Next' only if there is at least one library selected
|
||||||
|
wxArrayInt checkedIndices;
|
||||||
|
m_checkListGH->GetCheckedItems( checkedIndices );
|
||||||
|
enableNext( checkedIndices.GetCount() > 0 );
|
||||||
|
|
||||||
|
// Update only if necessary
|
||||||
|
if( m_githubLibs.GetCount() == 0 )
|
||||||
|
getLibsListGithub( m_githubLibs );
|
||||||
|
|
||||||
|
m_searchCtrlGH->Clear();
|
||||||
|
|
||||||
|
// Clear the review list so it will be reloaded
|
||||||
|
m_libraries.clear();
|
||||||
|
m_listCtrlReview->DeleteAllItems();
|
||||||
|
}
|
||||||
#endif /* BUILD_GITHUB_PLUGIN */
|
#endif /* BUILD_GITHUB_PLUGIN */
|
||||||
|
|
||||||
|
|
||||||
|
@ -733,25 +756,6 @@ void WIZARD_FPLIB_TABLE::setupDialogOrder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WIZARD_FPLIB_TABLE::setupGithubList()
|
|
||||||
{
|
|
||||||
// Enable 'Next' only if there is at least one library selected
|
|
||||||
wxArrayInt checkedIndices;
|
|
||||||
m_checkListGH->GetCheckedItems( checkedIndices );
|
|
||||||
enableNext( checkedIndices.GetCount() > 0 );
|
|
||||||
|
|
||||||
// Update only if necessary
|
|
||||||
if( m_githubLibs.GetCount() == 0 )
|
|
||||||
getLibsListGithub( m_githubLibs );
|
|
||||||
|
|
||||||
m_searchCtrlGH->Clear();
|
|
||||||
|
|
||||||
// Clear the review list so it will be reloaded
|
|
||||||
m_libraries.clear();
|
|
||||||
m_listCtrlReview->DeleteAllItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void WIZARD_FPLIB_TABLE::setupFileSelect()
|
void WIZARD_FPLIB_TABLE::setupFileSelect()
|
||||||
{
|
{
|
||||||
// Disable the button until something is selected
|
// Disable the button until something is selected
|
||||||
|
|
Loading…
Reference in New Issue