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:
jean-pierre charras 2018-04-10 20:10:00 +02:00
parent 5ef715f3d3
commit 9ea360f168
2 changed files with 2 additions and 2 deletions

View File

@ -428,7 +428,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
return false; return false;
} }
if( GetScreen()->IsModify() ) if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
{ {
int response = YesNoCancelDialog( this, _( int response = YesNoCancelDialog( this, _(
"The current board has been modified. Do you wish to save the changes?" ), "The current board has been modified. Do you wish to save the changes?" ),

View File

@ -647,7 +647,7 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{ {
m_canvas->SetAbortRequest( true ); m_canvas->SetAbortRequest( true );
if( GetScreen()->IsModify() ) if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
{ {
wxString msg = wxString::Format( _( wxString msg = wxString::Format( _(
"Save the changes in\n" "Save the changes in\n"