From f98ddbe33d64e8ad9005ea15a4cefdd507efd2ef Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 25 Sep 2015 15:41:14 -0400 Subject: [PATCH] Missed file update from previous commit. --- gerbview/gerbview_frame.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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;