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
87e5b6b8
Commit
87e5b6b8
authored
Dec 16, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: allows pcbnew to open a .kicad_pcb or a .brd file, from the command line.
parent
4352edda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
pcbnew.cpp
pcbnew/pcbnew.cpp
+12
-10
No files found.
pcbnew/pcbnew.cpp
View file @
87e5b6b8
...
...
@@ -105,11 +105,13 @@ bool EDA_APP::OnInit()
{
wxFileName
fn
;
PCB_EDIT_FRAME
*
frame
=
NULL
;
wxString
msg
;
#ifdef KICAD_SCRIPTING
if
(
!
pcbnewInitPythonScripting
()
)
{
return
false
;
wxMessageBox
(
wxT
(
"pcbnewInitPythonScripting() fails"
)
);
return
false
;
}
#endif
...
...
@@ -129,12 +131,13 @@ bool EDA_APP::OnInit()
{
fn
=
argv
[
1
];
if
(
fn
.
GetExt
()
!=
PcbFileExtension
)
if
(
fn
.
GetExt
()
!=
PcbFileExtension
&&
fn
.
GetExt
()
!=
LegacyPcbFileExtension
)
{
wxLogDebug
(
wxT
(
"Pcbnew file <%s> has the wrong extension.
\
msg
.
Printf
(
_
(
"Pcbnew file <%s> has a wrong extension.
\n
\
Changing extension to .%s."
),
GetChars
(
fn
.
GetFullPath
()
),
GetChars
(
PcbFileExtension
)
);
fn
.
SetExt
(
PcbFileExtension
);
wxMessageBox
(
msg
);
}
if
(
fn
.
IsOk
()
&&
fn
.
DirExists
()
)
...
...
@@ -177,7 +180,7 @@ Changing extension to .%s." ), GetChars( fn.GetFullPath() ),
* However, because legacy board files are named *.brd,
* and new files are named *.kicad_pcb,
* for all previous projects ( before 2012, december 14 ),
* becuse KiCad manager ask to load a .kicad_pcb file
* bec
a
use KiCad manager ask to load a .kicad_pcb file
* if this file does not exist, it is certainly useful
* to test if a legacy file is existing,
* under the same name, and therefore if the user want to load it
...
...
@@ -196,10 +199,9 @@ Changing extension to .%s." ), GetChars( fn.GetFullPath() ),
fn_legacy
.
SetExt
(
LegacyPcbFileExtension
);
if
(
fn_legacy
.
FileExists
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"File <%s> does not exist.
\n
"
"However a legacy file <%s> exists.
\n
Do you want to load it?
\n
"
"It will be saved under the new file format"
),
msg
.
Printf
(
_
(
"File <%s> does not exist.
\n
\
However a legacy file <%s> exists.
\n
Do you want to load it?
\n
\
It will be saved under the new file format"
),
GetChars
(
fn
.
GetFullPath
()
),
GetChars
(
fn_legacy
.
GetFullPath
()
)
);
if
(
IsOK
(
frame
,
msg
)
)
...
...
@@ -217,13 +219,13 @@ Changing extension to .%s." ), GetChars( fn.GetFullPath() ),
if
(
!
file_exists
)
{
// File does not exists: prepare an empty board
wxSetWorkingDirectory
(
fn
.
GetPath
()
);
if
(
!
fn
.
GetPath
().
IsEmpty
()
)
wxSetWorkingDirectory
(
fn
.
GetPath
()
);
frame
->
GetBoard
()
->
SetFileName
(
fn
.
GetFullPath
(
wxPATH_UNIX
)
);
frame
->
UpdateTitle
();
frame
->
UpdateFileHistory
(
frame
->
GetBoard
()
->
GetFileName
()
);
frame
->
OnModify
();
// Ready to save the new empty board
wxString
msg
;
msg
.
Printf
(
_
(
"File <%s> does not exist.
\n
This is normal for a new project"
),
GetChars
(
frame
->
GetBoard
()
->
GetFileName
()
)
);
wxMessageBox
(
msg
);
...
...
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