Pcbnew: fix a (minor) lock file issue: the lock was too early set. If the file was (for some reason) not actually loaded, it was locked. Now, the file is locked only if it is actually loaded.
This commit is contained in:
parent
72794f1416
commit
daf09ed9fe
|
@ -408,8 +408,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_file_checker.reset( lockFile.release() );
|
|
||||||
|
|
||||||
if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
|
if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
|
||||||
{
|
{
|
||||||
if( !HandleUnsavedChanges( this, _( "The current PCB has been modified. Save changes?" ),
|
if( !HandleUnsavedChanges( this, _( "The current PCB has been modified. Save changes?" ),
|
||||||
|
@ -419,6 +417,9 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Release the lock file, until the new file is actually loaded
|
||||||
|
m_file_checker.reset( nullptr );
|
||||||
|
|
||||||
wxFileName pro = fullFileName;
|
wxFileName pro = fullFileName;
|
||||||
pro.SetExt( ProjectFileExtension );
|
pro.SetExt( ProjectFileExtension );
|
||||||
|
|
||||||
|
@ -503,6 +504,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 6.0 TODO: some settings didn't make it into the board file in 5.1 so as not to
|
// 6.0 TODO: some settings didn't make it into the board file in 5.1 so as not to
|
||||||
// change the file format. For 5.1 we must copy them across from the config-initialized
|
// change the file format. For 5.1 we must copy them across from the config-initialized
|
||||||
// board.
|
// board.
|
||||||
|
@ -552,6 +554,9 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
GetBoard()->SetFileName( fname );
|
GetBoard()->SetFileName( fname );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lock the file newly opened:
|
||||||
|
m_file_checker.reset( lockFile.release() );
|
||||||
|
|
||||||
if( !converted )
|
if( !converted )
|
||||||
UpdateFileHistory( GetBoard()->GetFileName() );
|
UpdateFileHistory( GetBoard()->GetFileName() );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue