Make drawing sheet loading slightly smarter
This commit is contained in:
parent
f6f2284851
commit
d4bb1cbc63
|
@ -806,13 +806,20 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
|
|||
shortFileName = fileName;
|
||||
}
|
||||
|
||||
SetWksFileName( shortFileName );
|
||||
DS_DATA_MODEL* ws = new DS_DATA_MODEL;
|
||||
|
||||
if( m_drawingSheet == NULL )
|
||||
m_drawingSheet = new DS_DATA_MODEL;
|
||||
if( ws->LoadDrawingSheet( fileName ) )
|
||||
{
|
||||
if( m_drawingSheet != nullptr )
|
||||
{
|
||||
delete m_drawingSheet;
|
||||
}
|
||||
|
||||
m_drawingSheet->LoadDrawingSheet( fileName );
|
||||
m_drawingSheet = ws;
|
||||
|
||||
GetPageLayoutInfoFromDialog();
|
||||
UpdatePageLayoutExample();
|
||||
SetWksFileName( shortFileName );
|
||||
|
||||
GetPageLayoutInfoFromDialog();
|
||||
UpdatePageLayoutExample();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,10 @@ bool SCH_EDIT_FRAME::LoadProjectSettings()
|
|||
wxString filename = DS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_PageLayoutDescrFileName,
|
||||
Prj().GetProjectPath() );
|
||||
|
||||
DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename );
|
||||
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename ) )
|
||||
{
|
||||
ShowInfoBarError( _( "Error loading drawing sheet" ), true );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,10 @@ bool PCB_EDIT_FRAME::LoadProjectSettings()
|
|||
wxString filename = DS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_PageLayoutDescrFileName,
|
||||
Prj().GetProjectPath() );
|
||||
|
||||
DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename );
|
||||
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename ) )
|
||||
{
|
||||
ShowInfoBarError( _( "Error loading drawing sheet" ), true );
|
||||
}
|
||||
|
||||
// Load render settings that aren't stored in PCB_DISPLAY_OPTIONS
|
||||
|
||||
|
|
Loading…
Reference in New Issue