Handle STEP export properly on MacOS when launched from standalone pcbnew.

This commit is contained in:
Adam Wolf 2018-06-12 21:35:42 -05:00 committed by Wayne Stambaugh
parent a99eeb44d3
commit 94891b75f9
2 changed files with 17 additions and 1 deletions

View File

@ -249,6 +249,17 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
double yOrg = 0.0;
wxFileName appK2S( wxStandardPaths::Get().GetExecutablePath() );
#ifdef __WXMAC__
// On macOS, we have standalone applications inside the main bundle, so we handle that here:
if( appK2S.GetPath().find( _("/Contents/Applications/pcbnew.app/Contents/MacOS") ) != wxNOT_FOUND )
{
appK2S.AppendDir( _(".."));
appK2S.AppendDir( _(".."));
appK2S.AppendDir( _(".."));
appK2S.AppendDir( _(".."));
appK2S.AppendDir( _("MacOS"));
}
#endif
appK2S.SetName( "kicad2step" );
wxString cmdK2S = "\"";

View File

@ -518,7 +518,12 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
// disable Export STEP item if kicad2step does not exist
wxString strK2S = Pgm().GetExecutablePath();
#ifdef __WXMAC__
strK2S += "Contents/MacOS/";
if (strK2S.find( _("pcbnew.app") ) != wxNOT_FOUND )
{
// On macOS, we have standalone applications inside the main bundle, so we handle that here:
strK2S += "../../";
}
strK2S += "Contents/MacOS/";
#endif
wxFileName appK2S( strK2S, "kicad2step" );