From 86906b05e0a11f49202cac8759c84958b8a44898 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 20 Apr 2018 12:17:16 +0200 Subject: [PATCH] Fix 3D shape & footprint download wizards freeze on OSX Fixes: lp:1758095 * https://bugs.launchpad.net/kicad/+bug/1758095 --- pcbnew/dialogs/wizard_3DShape_Libs_downloader.cpp | 7 ++++--- pcbnew/dialogs/wizard_3DShape_Libs_downloader.h | 4 ++-- pcbnew/dialogs/wizard_add_fplib.cpp | 8 +++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pcbnew/dialogs/wizard_3DShape_Libs_downloader.cpp b/pcbnew/dialogs/wizard_3DShape_Libs_downloader.cpp index 2306777287..31b5e9f3fd 100644 --- a/pcbnew/dialogs/wizard_3DShape_Libs_downloader.cpp +++ b/pcbnew/dialogs/wizard_3DShape_Libs_downloader.cpp @@ -287,7 +287,7 @@ void WIZARD_3DSHAPE_LIBS_DOWNLOADER::OnWizardFinished( wxWizardEvent& aEvent ) if( !downloadGithubLibsFromList( m_libraries, &error ) ) { - DisplayError( GetParent(), error ); + DisplayError( this, error ); } } @@ -356,9 +356,10 @@ bool WIZARD_3DSHAPE_LIBS_DOWNLOADER::downloadGithubLibsFromList( wxArrayString& // Display a progress bar to show the download state // The title is updated for each downloaded library. // the state will be updated by downloadOneLib() for each file. + // for OSX do not enable wPD_APP_MODAL, keep wxPD_AUTO_HIDE wxProgressDialog pdlg( _( "Downloading 3D libraries" ), wxEmptyString, aUrlList.GetCount(), this, - wxPD_CAN_ABORT | wxPD_APP_MODAL | wxPD_AUTO_HIDE ); + wxPD_CAN_ABORT | wxPD_AUTO_HIDE ); // Built the full server name string: wxURI repo( GetGithubURL() ); @@ -404,7 +405,7 @@ bool WIZARD_3DSHAPE_LIBS_DOWNLOADER::downloadGithubLibsFromList( wxArrayString& bool WIZARD_3DSHAPE_LIBS_DOWNLOADER::downloadOneLib( const wxString& aLibURL, - const wxString& aLocalLibName, wxProgressDialog * aIndicator, + const wxString& aLocalLibName, wxProgressDialog* aIndicator, wxString* aErrorMessage ) { wxArrayString fileslist; diff --git a/pcbnew/dialogs/wizard_3DShape_Libs_downloader.h b/pcbnew/dialogs/wizard_3DShape_Libs_downloader.h index 5bb6723bcc..58a1e44fd7 100644 --- a/pcbnew/dialogs/wizard_3DShape_Libs_downloader.h +++ b/pcbnew/dialogs/wizard_3DShape_Libs_downloader.h @@ -77,8 +77,8 @@ public: void OnWizardFinished( wxWizardEvent& aEvent ) override; void OnBrowseButtonClick( wxCommandEvent& aEvent ) override; void OnCheckSaveCopy( wxCommandEvent& aEvent ); - void OnDefault3DPathButtonClick( wxCommandEvent& event ) override; - void OnGridLibReviewSize( wxSizeEvent& event ) override; + void OnDefault3DPathButtonClick( wxCommandEvent& event ) override; + void OnGridLibReviewSize( wxSizeEvent& event ) override; void OnLocalFolderChange( wxCommandEvent& event ) override; protected: diff --git a/pcbnew/dialogs/wizard_add_fplib.cpp b/pcbnew/dialogs/wizard_add_fplib.cpp index b34822f0f9..75b7481677 100644 --- a/pcbnew/dialogs/wizard_add_fplib.cpp +++ b/pcbnew/dialogs/wizard_add_fplib.cpp @@ -606,7 +606,9 @@ bool WIZARD_FPLIB_TABLE::downloadGithubLibsFromList( wxArrayString& aUrlList, wxString* aErrorMessage ) { // Display a progress bar to show the downlaod state - wxProgressDialog pdlg( _( "Downloading libraries" ), wxEmptyString, aUrlList.GetCount() ); + // for OSX do not enable wPD_APP_MODAL, keep wxPD_AUTO_HIDE + wxProgressDialog pdlg( _( "Downloading libraries" ), wxEmptyString, aUrlList.GetCount(), + this, wxPD_CAN_ABORT | wxPD_AUTO_HIDE ); // Download libs: for( unsigned ii = 0; ii < aUrlList.GetCount(); ii++ ) @@ -789,9 +791,9 @@ void WIZARD_FPLIB_TABLE::setupReview() int libTotalCount = m_libraries.size(); int libCount = 0; bool validate = true; + // for OSX do not enable wPD_APP_MODAL, keep wxPD_AUTO_HIDE wxProgressDialog progressDlg( _( "Please wait..." ), _( "Validating libraries" ), - libTotalCount, this, - wxPD_APP_MODAL | wxPD_CAN_ABORT | wxPD_AUTO_HIDE ); + libTotalCount, this, wxPD_CAN_ABORT | wxPD_AUTO_HIDE ); m_dvLibName->SetWidth( 280 );