Project templates now can find the system templates from KICAD environment variable
This commit is contained in:
parent
5fc382df85
commit
ccd9500bfb
|
@ -69,9 +69,20 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString aPrjFullFileName, boo
|
||||||
{
|
{
|
||||||
DIALOG_TEMPLATE_SELECTOR* ps = new DIALOG_TEMPLATE_SELECTOR( this );
|
DIALOG_TEMPLATE_SELECTOR* ps = new DIALOG_TEMPLATE_SELECTOR( this );
|
||||||
|
|
||||||
|
wxFileName templatePath;
|
||||||
|
|
||||||
// Add a new tab for system templates
|
// 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()) +
|
wxFileName templatePath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) +
|
||||||
SEP() + wxT( ".." ) + SEP() + wxT( "share" ) + SEP() + wxT( "template" ) + SEP();
|
SEP() + wxT( ".." ) + SEP() + wxT( "share" ) + SEP() + wxT( "template" ) + SEP();
|
||||||
|
}
|
||||||
|
|
||||||
ps->AddPage( _( "System Templates" ), templatePath );
|
ps->AddPage( _( "System Templates" ), templatePath );
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,7 @@
|
||||||
wxStandardPaths::GetExecutableDir()/../share/template/
|
wxStandardPaths::GetExecutableDir()/../share/template/
|
||||||
wxStandardPaths::GetUserDataDir()/templates/
|
wxStandardPaths::GetUserDataDir()/templates/
|
||||||
wxGetEnv(wxT("KICAD_TEMPLATES"))
|
wxGetEnv(wxT("KICAD_TEMPLATES"))
|
||||||
|
wxGetEnv(wxT("KICAD"))/template/
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue