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
13ddd1b4
Commit
13ddd1b4
authored
May 30, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: Better dialog when starting pcbnew in a new project, when the .brd file does not exists
parent
79139b65
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
8 deletions
+39
-8
wxPcbStruct.h
include/wxPcbStruct.h
+4
-3
files.cpp
pcbnew/files.cpp
+13
-1
pcbnew.cpp
pcbnew/pcbnew.cpp
+22
-4
No files found.
include/wxPcbStruct.h
View file @
13ddd1b4
...
@@ -496,18 +496,19 @@ public:
...
@@ -496,18 +496,19 @@ public:
void
OnFileHistory
(
wxCommandEvent
&
event
);
void
OnFileHistory
(
wxCommandEvent
&
event
);
void
Files_io
(
wxCommandEvent
&
event
);
void
Files_io
(
wxCommandEvent
&
event
);
/**
/**
Function LoadOnePcbFile
* Load a Kicad board (.brd) file.
* Load a Kicad board (.brd) file.
*
*
* @param aFileName - File name including path. If empty, a file dialog will
* @param aFileName - File name including path. If empty, a file dialog will
* be displayed.
* be displayed.
* @param aAppend - Append board file aFileName to the currently loaded file if true.
* @param aAppend - Append board file aFileName to the currently loaded file if true.
* Default = false.
* @param aForceFileDialog - Display the file open dialog even if aFullFileName is
* @param aForceFileDialog - Display the file open dialog even if aFullFileName is
* valid if true.
* valid if true
; Default = false
.
*
*
* @return False if file load fails or is cancelled by the user, otherwise true.
* @return False if file load fails or is cancelled by the user, otherwise true.
*/
*/
bool
LoadOnePcbFile
(
const
wxString
&
aFileName
,
bool
aAppend
,
bool
LoadOnePcbFile
(
const
wxString
&
aFileName
,
bool
aAppend
=
false
,
bool
aForceFileDialog
=
false
);
bool
aForceFileDialog
=
false
);
...
...
pcbnew/files.cpp
View file @
13ddd1b4
...
@@ -27,7 +27,7 @@ void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event )
...
@@ -27,7 +27,7 @@ void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event )
{
{
DrawPanel
->
UnManageCursor
(
0
,
wxCURSOR_ARROW
);
DrawPanel
->
UnManageCursor
(
0
,
wxCURSOR_ARROW
);
::
wxSetWorkingDirectory
(
::
wxPathOnly
(
fn
)
);
::
wxSetWorkingDirectory
(
::
wxPathOnly
(
fn
)
);
LoadOnePcbFile
(
fn
,
false
);
LoadOnePcbFile
(
fn
);
ReCreateAuxiliaryToolbar
();
ReCreateAuxiliaryToolbar
();
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
}
}
...
@@ -114,6 +114,18 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
...
@@ -114,6 +114,18 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
}
}
/** Function WinEDA_PcbFrame::LoadOnePcbFile
* Load a Kicad board (.brd) file.
*
* @param aFileName - File name including path. If empty, a file dialog will
* be displayed.
* @param aAppend - Append board file aFileName to the currently loaded file if true.
* Default = false.
* @param aForceFileDialog - Display the file open dialog even if aFullFileName is
* valid if true; Default = false.
*
* @return False if file load fails or is cancelled by the user, otherwise true.
*/
bool
WinEDA_PcbFrame
::
LoadOnePcbFile
(
const
wxString
&
aFileName
,
bool
Append
,
bool
WinEDA_PcbFrame
::
LoadOnePcbFile
(
const
wxString
&
aFileName
,
bool
Append
,
bool
aForceFileDialog
)
bool
aForceFileDialog
)
{
{
...
...
pcbnew/pcbnew.cpp
View file @
13ddd1b4
...
@@ -154,13 +154,31 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
...
@@ -154,13 +154,31 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
/* Load file specified in the command line. */
/* Load file specified in the command line. */
if
(
fn
.
IsOk
()
)
if
(
fn
.
IsOk
()
)
{
{
frame
->
LoadOnePcbFile
(
fn
.
GetFullPath
(),
FALSE
);
/* Note the first time Pcbnew is called after creating a new project
* the board file may not exists
// update the layer names in the listbox
* So we load settings only
frame
->
ReCreateLayerBox
(
NULL
);
*/
if
(
fn
.
FileExists
()
)
frame
->
LoadOnePcbFile
(
fn
.
GetFullPath
()
);
else
{
// File does not exists: prepare an empty board
wxSetWorkingDirectory
(
fn
.
GetPath
()
);
frame
->
GetScreen
()
->
m_FileName
=
fn
.
GetFullPath
();
frame
->
GetScreen
()
->
m_FileName
.
Replace
(
WIN_STRING_DIR_SEP
,
UNIX_STRING_DIR_SEP
);
frame
->
SetTitle
(
frame
->
GetScreen
()
->
m_FileName
);
frame
->
SetLastProject
(
frame
->
GetScreen
()
->
m_FileName
);
frame
->
OnModify
();
// Ready to save the new empty board
wxString
msg
;
msg
.
Printf
(
_
(
"File <%s> not existing
\n
This is normal for a new project"
),
GetChars
(
frame
->
GetScreen
()
->
m_FileName
)
);
wxMessageBox
(
msg
);
}
}
}
frame
->
LoadProjectSettings
(
fn
.
GetFullPath
()
);
frame
->
LoadProjectSettings
(
fn
.
GetFullPath
()
);
// update the layer names in the listbox
frame
->
ReCreateLayerBox
(
NULL
);
/* For an obscure reason the focus is lost after loading a board file
/* For an obscure reason the focus is lost after loading a board file
* when starting (i.e. only at this point)
* when starting (i.e. only at this point)
...
...
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