Schematic: correctly resolve SHEETNAME for root sheet

This commit is contained in:
Mike Williams 2023-11-27 13:44:49 -05:00
parent d1aa49e1c9
commit 58cc0e2d1e
3 changed files with 5 additions and 5 deletions

View File

@ -260,6 +260,9 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
{
wxBusyCursor busy;
Schematic().SetRoot( pi->LoadSchematicFile( fullFileName, &Schematic() ) );
// Make ${SHEETNAME} work on the root sheet until we properly support
// naming the root sheet
Schematic().Root().SetName( _( "Root" ) );
}
if( !pi->GetError().IsEmpty() )

View File

@ -180,10 +180,7 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
// Open the plotter and do the first page
setupPlotPagePDF( plotter, screen, aPlotSettings );
if( sheetList.size() > 1 )
plotter->StartPlot( sheetList[i].GetPageNumber(), _( "Root" ) );
else
plotter->StartPlot( sheetList[i].GetPageNumber(), sheetName );
plotter->StartPlot( sheetList[i].GetPageNumber(), sheetName );
}
catch( const IO_ERROR& e )
{

View File

@ -317,7 +317,7 @@ wxString HIERARCHY_PANE::getRootString()
SCH_SHEET_PATH rootPath;
rootPath.push_back( rootSheet );
return formatPageString ( _( "Root" ), rootPath.GetPageNumber() );
return formatPageString( rootSheet->GetShownName( false ), rootPath.GetPageNumber() );
}