7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 13:30:11 +00:00

Restore previous screen and sheet filename when canceling a failed load.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19881

(cherry picked from commit 4ed1954b4b)
This commit is contained in:
Wayne Stambaugh 2025-02-08 14:01:57 -05:00
parent b7b28e555e
commit 09f54c6b94

View File

@ -347,6 +347,8 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataFromWindow()
{
if( clearFileName )
currentScreen->SetFileName( wxEmptyString );
else
m_fields->at( SHEETFILENAME ).SetText( oldFilename );
return false;
}
@ -567,6 +569,7 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
if( useScreen || loadFromFile ) // Load from existing file.
{
clearAnnotation = true;
oldScreen = m_sheet->GetScreen();
if( !IsOK( this, wxString::Format( _( "Change '%s' link from '%s' to '%s'?" ),
newAbsoluteFilename,