* Fix linux location for system project templates

This commit is contained in:
Brian Sidebotham 2014-02-07 18:17:58 +00:00
parent 544f987fa0
commit 775ce3993c
1 changed files with 13 additions and 2 deletions

View File

@ -88,10 +88,21 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString aPrjFullFileName,
templatePath = envStr + wxT( "template" ) + sep; templatePath = envStr + wxT( "template" ) + sep;
} }
else else
{
// The standard path should be in the share directory for kicad. As
// it is normal on Windows to only have the share directory and not
// the kicad sub-directory we fall back to that if the directory
// doesn't exist
templatePath = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() ) +
sep + wxT( ".." ) + sep + wxT( "share" ) + sep + wxT( "kicad" ) +
sep + wxT( "template" ) + sep;
if( !wxDirExists( templatePath.GetFullPath() ) )
{ {
templatePath = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() ) + 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 );