Ensure the demos folder exists before adding the menu item
This commit is contained in:
parent
8467fe5405
commit
ea73da8a27
|
@ -27,6 +27,7 @@
|
||||||
#include <bitmaps.h>
|
#include <bitmaps.h>
|
||||||
#include <filehistory.h>
|
#include <filehistory.h>
|
||||||
#include <menus_helpers.h>
|
#include <menus_helpers.h>
|
||||||
|
#include <paths.h>
|
||||||
#include <tool/action_manager.h>
|
#include <tool/action_manager.h>
|
||||||
#include <tool/action_toolbar.h>
|
#include <tool/action_toolbar.h>
|
||||||
#include <tool/tool_manager.h>
|
#include <tool/tool_manager.h>
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
#include "pgm_kicad.h"
|
#include "pgm_kicad.h"
|
||||||
#include "kicad_id.h"
|
#include "kicad_id.h"
|
||||||
#include <widgets/wx_menubar.h>
|
#include <widgets/wx_menubar.h>
|
||||||
|
#include <wx/dir.h>
|
||||||
|
|
||||||
|
|
||||||
void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
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::newProject );
|
||||||
fileMenu->Add( KICAD_MANAGER_ACTIONS::newFromTemplate );
|
fileMenu->Add( KICAD_MANAGER_ACTIONS::newFromTemplate );
|
||||||
|
|
||||||
|
if( wxDir::Exists( PATHS::GetStockDemosPath() ) )
|
||||||
|
{
|
||||||
fileMenu->Add( KICAD_MANAGER_ACTIONS::openDemoProject );
|
fileMenu->Add( KICAD_MANAGER_ACTIONS::openDemoProject );
|
||||||
|
}
|
||||||
|
|
||||||
fileMenu->Add( KICAD_MANAGER_ACTIONS::openProject );
|
fileMenu->Add( KICAD_MANAGER_ACTIONS::openProject );
|
||||||
|
|
||||||
wxMenuItem* item = fileMenu->Add( openRecentMenu );
|
wxMenuItem* item = fileMenu->Add( openRecentMenu );
|
||||||
|
|
Loading…
Reference in New Issue