diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 30047b41e9..c8c5279407 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -192,7 +193,16 @@ void GERBVIEW_FRAME::OnCloseWindow( wxCloseEvent& Event ) bool GERBVIEW_FRAME::OpenProjectFiles( const std::vector& aFileSet, int aCtl ) { - const unsigned limit = std::min( unsigned( aFileSet.size() ), unsigned( GERBER_DRAWLAYERS_COUNT ) ); + // The current project path is also a valid command parameter. Check if a single path + // was passed to GerbView and use it as the initial MRU path. + if( aFileSet.size() == 1 && !wxFileExists( aFileSet[0] ) && wxDirExists( aFileSet[0] ) ) + { + m_mruPath = aFileSet[0]; + return true; + } + + const unsigned limit = std::min( unsigned( aFileSet.size() ), + unsigned( GERBER_DRAWLAYERS_COUNT ) ); int layer = 0;