Browse Source

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

pull/17/head
Adam Wolf 7 years ago
committed by Wayne Stambaugh
parent
commit
94891b75f9
  1. 11
      pcbnew/dialogs/dialog_export_step.cpp
  2. 7
      pcbnew/pcb_edit_frame.cpp

11
pcbnew/dialogs/dialog_export_step.cpp

@ -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 = "\"";

7
pcbnew/pcb_edit_frame.cpp

@ -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…
Cancel
Save