Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
e5740af0
Commit
e5740af0
authored
Apr 10, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.9 wx rat race
parent
297a54fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
prjconfig.cpp
kicad/prjconfig.cpp
+19
-16
No files found.
kicad/prjconfig.cpp
View file @
e5740af0
...
@@ -60,6 +60,7 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString aPrjFullFileName, boo
...
@@ -60,6 +60,7 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString aPrjFullFileName, boo
{
{
wxString
filename
;
wxString
filename
;
wxFileName
newProjectName
=
aPrjFullFileName
;
wxFileName
newProjectName
=
aPrjFullFileName
;
wxChar
sep
[
2
]
=
{
SEP
(),
0
};
// nul terminated separator wxChar string.
ClearMsg
();
ClearMsg
();
...
@@ -72,39 +73,41 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString aPrjFullFileName, boo
...
@@ -72,39 +73,41 @@ 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
;
wxFileName
templatePath
;
wxString
envStr
;
wxGetEnv
(
wxT
(
"KICAD"
),
&
envStr
);
// Add a new tab for system templates
// Add a new tab for system templates
if
(
::
wxGetEnv
(
wxT
(
"KICAD"
),
NULL
)
)
if
(
!
envStr
.
empty
(
)
)
{
{
wxString
kicadEnv
;
// user may or may not have including terminating separator.
wxGetEnv
(
wxT
(
"KICAD"
),
&
kicadEnv
);
if
(
!
envStr
.
EndsWith
(
sep
)
)
envStr
+=
sep
;
templatePath
=
kicadEnv
+
SEP
()
+
wxT
(
"template"
)
+
SEP
()
;
templatePath
=
envStr
+
wxT
(
"template"
)
+
sep
;
}
}
else
else
{
{
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
);
// Add a new tab for user templates
// Add a new tab for user templates
wxFileName
userPath
=
wxStandardPaths
::
Get
().
GetDocumentsDir
()
+
wxFileName
userPath
=
wxStandardPaths
::
Get
().
GetDocumentsDir
()
+
SEP
()
+
wxT
(
"kicad"
)
+
SEP
()
+
wxT
(
"template"
)
+
SEP
()
;
sep
+
wxT
(
"kicad"
)
+
sep
+
wxT
(
"template"
)
+
sep
;
ps
->
AddPage
(
_
(
"User Templates"
),
userPath
);
ps
->
AddPage
(
_
(
"User Templates"
),
userPath
);
// Check to see if a custom template location is available and setup a
new selection tab
// Check to see if a custom template location is available and setup a
//
if there is
//
new selection tab if there is.
wxString
envStr
;
envStr
.
clear
()
;
wxGetEnv
(
wxT
(
"KICAD_PTEMPLATES"
),
&
envStr
);
wxGetEnv
(
wxT
(
"KICAD_PTEMPLATES"
),
&
envStr
);
if
(
envStr
)
if
(
!
envStr
.
empty
()
)
{
{
wxChar
sep
=
SEP
();
if
(
!
envStr
.
EndsWith
(
sep
)
)
if
(
!
envStr
.
EndsWith
(
&
sep
)
)
envStr
+=
sep
;
envStr
+=
sep
;
wxFileName
envPath
=
envStr
;
wxFileName
envPath
=
envStr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment