Kicad manager, Gerbview: When running Gerbview from Kicad manger, set the Gerbview CWD to the current project directory.

Therefore, when trying to open Gerber files, the default directory is now thecurrent project directory.
(fix Bug #1380088 )
This commit is contained in:
jean-pierre charras 2014-10-28 20:29:44 +01:00
parent a061eeb176
commit 045f7f0d4d
1 changed files with 7 additions and 1 deletions

View File

@ -437,12 +437,18 @@ void KICAD_MANAGER_FRAME::OnRunCvpcb( wxCommandEvent& event )
frame->Raise();
}
#include <wx/filefn.h>
void KICAD_MANAGER_FRAME::OnRunGerbview( wxCommandEvent& event )
{
// Gerbview is called without any file to open, because we do not know
// the list and the name of files to open (if any...).
// however we run it in the path of the project
wxFileName fn( GetProjectFileName() );
wxString cwd = wxGetCwd();
wxSetWorkingDirectory( fn.GetPathWithSep() );
Execute( this, GERBVIEW_EXE, wxEmptyString );
wxSetWorkingDirectory( cwd );
}