Project templates now can find the system templates from KICAD environment variable

This commit is contained in:
Miguel Angel Ajo 2013-03-10 02:35:24 +01:00
parent 5fc382df85
commit ccd9500bfb
2 changed files with 13 additions and 1 deletions

View File

@ -69,9 +69,20 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString aPrjFullFileName, boo
{
DIALOG_TEMPLATE_SELECTOR* ps = new DIALOG_TEMPLATE_SELECTOR( this );
wxFileName templatePath;
// Add a new tab for system templates
if( ::wxGetEnv( wxT( "KICAD" ), NULL ) )
{
wxString kicadEnv;
wxGetEnv( wxT( "KICAD"), &kicadEnv );
templatePath = kicadEnv + SEP() + wxT("template")+SEP();
}
else
{
wxFileName templatePath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) +
SEP() + wxT( ".." ) + SEP() + wxT( "share" ) + SEP() + wxT( "template" ) + SEP();
}
ps->AddPage( _( "System Templates" ), templatePath );

View File

@ -97,6 +97,7 @@
wxStandardPaths::GetExecutableDir()/../share/template/
wxStandardPaths::GetUserDataDir()/templates/
wxGetEnv(wxT("KICAD_TEMPLATES"))
wxGetEnv(wxT("KICAD"))/template/
*/