Handle STEP export properly on MacOS when launched from standalone pcbnew.
This commit is contained in:
parent
a99eeb44d3
commit
94891b75f9
|
@ -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 = "\"";
|
||||
|
|
|
@ -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" );
|
||||
|
||||
|
|
Loading…
Reference in New Issue