Pcbnew: avoid useless validation dialog about modifications when closing pcbnew or opening a file, when the initial board is empty.
Some changes (enable/disable a layer) set the dirty bit even for empty boards. So when closing pcbnew, the dialog asking for saving the board was shown, even when no board loaded.
This commit is contained in:
parent
5ef715f3d3
commit
9ea360f168
|
@ -428,7 +428,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
|||
return false;
|
||||
}
|
||||
|
||||
if( GetScreen()->IsModify() )
|
||||
if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
|
||||
{
|
||||
int response = YesNoCancelDialog( this, _(
|
||||
"The current board has been modified. Do you wish to save the changes?" ),
|
||||
|
|
|
@ -647,7 +647,7 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
{
|
||||
m_canvas->SetAbortRequest( true );
|
||||
|
||||
if( GetScreen()->IsModify() )
|
||||
if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
|
||||
{
|
||||
wxString msg = wxString::Format( _(
|
||||
"Save the changes in\n"
|
||||
|
|
Loading…
Reference in New Issue