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;
|
double yOrg = 0.0;
|
||||||
|
|
||||||
wxFileName appK2S( wxStandardPaths::Get().GetExecutablePath() );
|
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" );
|
appK2S.SetName( "kicad2step" );
|
||||||
|
|
||||||
wxString cmdK2S = "\"";
|
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
|
// disable Export STEP item if kicad2step does not exist
|
||||||
wxString strK2S = Pgm().GetExecutablePath();
|
wxString strK2S = Pgm().GetExecutablePath();
|
||||||
#ifdef __WXMAC__
|
#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
|
#endif
|
||||||
wxFileName appK2S( strK2S, "kicad2step" );
|
wxFileName appK2S( strK2S, "kicad2step" );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue