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
218cb8e7
Commit
218cb8e7
authored
Jun 01, 2014
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: fix Bug #1325311 ("New Board" warning refusal broken)
parent
59dfc053
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
53 deletions
+52
-53
files.cpp
pcbnew/files.cpp
+2
-1
initpcb.cpp
pcbnew/initpcb.cpp
+9
-19
modedit.cpp
pcbnew/modedit.cpp
+41
-33
No files found.
pcbnew/files.cpp
View file @
218cb8e7
...
...
@@ -170,7 +170,8 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
case
ID_NEW_BOARD
:
{
Clear_Pcb
(
true
);
if
(
!
Clear_Pcb
(
true
)
)
break
;
// Clear footprint library table for the new board.
Prj
().
PcbFootprintLibs
()
->
Clear
();
...
...
pcbnew/initpcb.cpp
View file @
218cb8e7
...
...
@@ -3,10 +3,6 @@
*/
#include <fctsys.h>
#include <class_drawpanel.h>
#include <class_draw_panel_gal.h>
#include <view/view.h>
#include <pcb_painter.h>
#include <confirm.h>
#include <wxPcbStruct.h>
...
...
@@ -21,19 +17,16 @@ bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery )
if
(
GetBoard
()
==
NULL
)
return
false
;
if
(
aQuery
)
if
(
aQuery
&&
GetScreen
()
->
IsModify
()
&&
!
GetBoard
()
->
IsEmpty
()
)
{
if
(
GetBoard
()
->
m_Drawings
||
GetBoard
()
->
m_Modules
||
GetBoard
()
->
m_Track
||
GetBoard
()
->
m_Zone
)
{
if
(
!
IsOK
(
this
,
_
(
"Current Board will be lost and this operation cannot be undone. Continue ?"
)
)
)
return
false
;
}
if
(
!
IsOK
(
this
,
_
(
"Current Board will be lost and this operation cannot be undone. Continue ?"
)
)
)
return
false
;
}
// Clear undo and redo lists because we want a full deletion
GetScreen
()
->
ClearUndoRedoList
();
GetScreen
()
->
ClrModify
();
// Items visibility flags will be set becuse a new board will be created.
// Grid and ratsnest can be left to their previous state
...
...
@@ -84,14 +77,11 @@ bool FOOTPRINT_EDIT_FRAME::Clear_Pcb( bool aQuery )
if
(
GetBoard
()
==
NULL
)
return
false
;
if
(
aQuery
&&
GetScreen
()
->
IsModify
()
)
if
(
aQuery
&&
GetScreen
()
->
IsModify
()
&&
!
GetBoard
()
->
IsEmpty
()
)
{
if
(
GetBoard
()
->
m_Modules
)
{
if
(
!
IsOK
(
this
,
_
(
"Current Footprint will be lost and this operation cannot be undone. Continue ?"
)
)
)
return
false
;
}
if
(
!
IsOK
(
this
,
_
(
"Current Footprint will be lost and this operation cannot be undone. Continue ?"
)
)
)
return
false
;
}
// Clear undo and redo lists
...
...
pcbnew/modedit.cpp
View file @
218cb8e7
...
...
@@ -264,6 +264,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_OPEN_MODULE_VIEWER
:
{
FOOTPRINT_VIEWER_FRAME
*
viewer
=
(
FOOTPRINT_VIEWER_FRAME
*
)
Kiway
().
Player
(
FRAME_PCB_MODULE_VIEWER
,
false
);
if
(
!
viewer
)
{
viewer
=
(
FOOTPRINT_VIEWER_FRAME
*
)
Kiway
().
Player
(
FRAME_PCB_MODULE_VIEWER
,
true
);
...
...
@@ -272,11 +273,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
}
else
{
/*
if( viewer->IsIconized() )
viewer->Iconize( false );
*/
viewer
->
Raise
();
// Raising the window does not set the focus on Linux. This should work on
...
...
@@ -293,7 +289,9 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_MODEDIT_NEW_MODULE
:
{
Clear_Pcb
(
true
);
if
(
!
Clear_Pcb
(
true
)
)
break
;
GetScreen
()
->
ClearUndoRedoList
();
SetCurItem
(
NULL
);
SetCrossHairPosition
(
wxPoint
(
0
,
0
)
);
...
...
@@ -319,35 +317,46 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_MODEDIT_NEW_MODULE_FROM_WIZARD
:
{
if
(
GetScreen
()
->
IsModify
()
&&
!
GetBoard
()
->
IsEmpty
()
)
{
if
(
!
IsOK
(
this
,
_
(
"Current Footprint will be lost and this operation cannot be undone. Continue ?"
)
)
)
break
;
}
FOOTPRINT_WIZARD_FRAME
*
wizard
=
(
FOOTPRINT_WIZARD_FRAME
*
)
Kiway
().
Player
(
FRAME_PCB_FOOTPRINT_WIZARD_MODAL
,
true
);
wizard
->
Zoom_Automatique
(
false
);
if
(
wizard
->
ShowModal
()
)
if
(
wizard
->
ShowModal
(
NULL
,
this
)
)
{
// Creates the new footprint from python script wizard
MODULE
*
module
=
wizard
->
GetBuiltFootprint
();
if
(
module
)
// i.e. if create module command not aborted
{
Clear_Pcb
(
true
);
GetScreen
()
->
ClearUndoRedoList
();
SetCurItem
(
NULL
);
SetCrossHairPosition
(
wxPoint
(
0
,
0
)
);
// Add the new object to board
module
->
SetParent
(
(
EDA_ITEM
*
)
GetBoard
()
);
GetBoard
()
->
m_Modules
.
Append
(
module
);
// Initialize data relative to nets and netclasses (for a new
// module the defaults are used)
// This is mandatory to handle and draw pads
GetBoard
()
->
BuildListOfNets
();
redraw
=
true
;
module
->
SetPosition
(
wxPoint
(
0
,
0
)
);
module
->
ClearFlags
();
}
if
(
module
==
NULL
)
// i.e. if create module command aborted
break
;
Clear_Pcb
(
false
);
GetScreen
()
->
ClearUndoRedoList
();
SetCurItem
(
NULL
);
SetCrossHairPosition
(
wxPoint
(
0
,
0
)
);
// Add the new object to board
module
->
SetParent
(
(
EDA_ITEM
*
)
GetBoard
()
);
GetBoard
()
->
m_Modules
.
Append
(
module
);
// Initialize data relative to nets and netclasses (for a new
// module the defaults are used)
// This is mandatory to handle and draw pads
GetBoard
()
->
BuildListOfNets
();
redraw
=
true
;
module
->
SetPosition
(
wxPoint
(
0
,
0
)
);
module
->
ClearFlags
();
Zoom_Automatique
(
false
);
if
(
m_Draw3DFrame
)
m_Draw3DFrame
->
NewDisplay
();
}
wizard
->
Destroy
();
...
...
@@ -492,9 +501,9 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_MODEDIT_LOAD_MODULE
:
wxLogDebug
(
wxT
(
"Loading module from library "
)
+
getLibPath
()
);
GetScreen
()
->
ClearUndoRedoList
();
SetCurItem
(
NULL
)
;
Clear_Pcb
(
true
);
if
(
!
Clear_Pcb
(
true
)
)
break
;
SetCrossHairPosition
(
wxPoint
(
0
,
0
)
);
LoadModuleFromLibrary
(
getLibNickName
(),
Prj
().
PcbFootprintLibs
(),
true
);
...
...
@@ -520,11 +529,10 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
val
->
SetType
(
TEXTE_MODULE
::
TEXT_is_VALUE
);
// just in case ...
if
(
val
->
GetLength
()
==
0
)
val
->
SetText
(
L"Val**"
);
val
->
SetText
(
wxT
(
"Val**"
)
);
}
}
GetScreen
()
->
ClrModify
();
Zoom_Automatique
(
false
);
if
(
m_Draw3DFrame
)
...
...
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