From 9ea360f168897297b61469e60ce7a3665028040d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 10 Apr 2018 20:10:00 +0200 Subject: [PATCH] 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. --- pcbnew/files.cpp | 2 +- pcbnew/pcb_edit_frame.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index cd2495bc6d..3af5a2ef67 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -428,7 +428,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& 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?" ), diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index f559f1b38b..9d5619ea1b 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -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"