From be839aca295fd0d9b7ece151bf50e08059035380 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 2 Apr 2015 13:31:29 +0200 Subject: [PATCH] Fixed Footprint Library Wizard for builds with GIthub plugin disabled. --- pcbnew/dialogs/wizard_add_fplib.cpp | 46 ++++++++++++++++------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/pcbnew/dialogs/wizard_add_fplib.cpp b/pcbnew/dialogs/wizard_add_fplib.cpp index 1df5284ccb..3ce21fbbf6 100644 --- a/pcbnew/dialogs/wizard_add_fplib.cpp +++ b/pcbnew/dialogs/wizard_add_fplib.cpp @@ -378,9 +378,12 @@ void WIZARD_FPLIB_TABLE::OnPageChanged( wxWizardEvent& aEvent ) SetBitmap( KiBitmap( wizard_add_fplib_icon_xpm ) ); enableNext( true ); +#ifdef BUILD_GITHUB_PLUGIN if( GetCurrentPage() == m_githubListDlg ) setupGithubList(); - else if( GetCurrentPage() == m_fileSelectDlg ) + else +#endif + if( GetCurrentPage() == m_fileSelectDlg ) setupFileSelect(); else if( GetCurrentPage() == m_reviewDlg ) setupReview(); @@ -481,6 +484,7 @@ void WIZARD_FPLIB_TABLE::OnChangeSearch( wxCommandEvent& aEvent ) void WIZARD_FPLIB_TABLE::OnWizardFinished( wxWizardEvent& aEvent ) { +#ifdef BUILD_GITHUB_PLUGIN // Shall we download a localy copy of the libraries if( GetLibSource() == GITHUB && m_downloadGithub->GetValue() ) { @@ -511,11 +515,11 @@ void WIZARD_FPLIB_TABLE::OnWizardFinished( wxWizardEvent& aEvent ) wxString path = it->GetAbsolutePath(); path.Replace( GetGithubURL(), getDownloadDir() ); it->setPath( path ); - std::cout << "replaced path " << it->GetAbsolutePath() << std::endl; it->setPluginType( IO_MGR::KICAD ); } } } +#endif } @@ -637,6 +641,25 @@ bool WIZARD_FPLIB_TABLE::downloadGithubLibsFromList( wxArrayString& aUrlList, 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 */ @@ -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() { // Disable the button until something is selected