Commit ccd9500b authored by Miguel Angel Ajo's avatar Miguel Angel Ajo

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

parent 5fc382df
......@@ -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
wxFileName templatePath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) +
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 );
......
......@@ -97,6 +97,7 @@
wxStandardPaths::GetExecutableDir()/../share/template/
wxStandardPaths::GetUserDataDir()/templates/
wxGetEnv(wxT("KICAD_TEMPLATES"))
wxGetEnv(wxT("KICAD"))/template/
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment