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
Show 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
(
GetBoard
()
->
m_Drawings
||
GetBoard
()
->
m_Modules
||
GetBoard
()
->
m_Track
||
GetBoard
()
->
m_Zone
)
if
(
aQuery
&&
GetScreen
()
->
IsModify
()
&&
!
GetBoard
()
->
IsEmpty
()
)
{
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,15 +77,12 @@ bool FOOTPRINT_EDIT_FRAME::Clear_Pcb( bool aQuery )
if
(
GetBoard
()
==
NULL
)
return
false
;
if
(
aQuery
&&
GetScreen
()
->
IsModify
()
)
{
if
(
GetBoard
()
->
m_Modules
)
if
(
aQuery
&&
GetScreen
()
->
IsModify
()
&&
!
GetBoard
()
->
IsEmpty
()
)
{
if
(
!
IsOK
(
this
,
_
(
"Current Footprint will be lost and this operation cannot be undone. Continue ?"
)
)
)
return
false
;
}
}
// Clear undo and redo lists
GetScreen
()
->
ClearUndoRedoList
();
...
...
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,19 +317,26 @@ 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
);
if
(
module
==
NULL
)
// i.e. if create module command aborted
break
;
Clear_Pcb
(
false
);
GetScreen
()
->
ClearUndoRedoList
();
SetCurItem
(
NULL
);
SetCrossHairPosition
(
wxPoint
(
0
,
0
)
);
...
...
@@ -347,7 +352,11 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
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