Ensure the demos folder exists before adding the menu item

This commit is contained in:
Marek Roszko 2021-07-26 18:12:49 -04:00
parent 8467fe5405
commit ea73da8a27
1 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,7 @@
#include <bitmaps.h>
#include <filehistory.h>
#include <menus_helpers.h>
#include <paths.h>
#include <tool/action_manager.h>
#include <tool/action_toolbar.h>
#include <tool/tool_manager.h>
@ -36,6 +37,7 @@
#include "pgm_kicad.h"
#include "kicad_id.h"
#include <widgets/wx_menubar.h>
#include <wx/dir.h>
void KICAD_MANAGER_FRAME::ReCreateMenuBar()
@ -69,7 +71,12 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
fileMenu->Add( KICAD_MANAGER_ACTIONS::newProject );
fileMenu->Add( KICAD_MANAGER_ACTIONS::newFromTemplate );
fileMenu->Add( KICAD_MANAGER_ACTIONS::openDemoProject );
if( wxDir::Exists( PATHS::GetStockDemosPath() ) )
{
fileMenu->Add( KICAD_MANAGER_ACTIONS::openDemoProject );
}
fileMenu->Add( KICAD_MANAGER_ACTIONS::openProject );
wxMenuItem* item = fileMenu->Add( openRecentMenu );