Slight improvement to schematic editor title bar.

Also improves some other clients of PathHumanReadable(), such as the
set page number dialog.
This commit is contained in:
Jeff Young 2022-12-12 11:00:18 +00:00
parent 346530a5b1
commit f75d18c7c8
5 changed files with 16 additions and 7 deletions

View File

@ -277,7 +277,7 @@ void HIERARCHY_NAVIG_PANEL::onRightClick( wxTreeEvent& aEvent )
if( GetPopupMenuSelectionFromUser( ctxMenu ) == 1 )
{
wxString msg;
wxString sheetPath = itemData->m_SheetPath.PathHumanReadable( false );
wxString sheetPath = itemData->m_SheetPath.PathHumanReadable( false, true );
wxString pageNumber = itemData->m_SheetPath.GetPageNumber();
msg.Printf( _( "Enter page number for sheet path %s" ),

View File

@ -1402,7 +1402,11 @@ void SCH_EDIT_FRAME::UpdateTitle()
title = wxT( "*" );
title += fn.GetName();
title += wxString::Format( wxT( " [%s]" ), GetCurrentSheet().PathHumanReadable( false ) );
wxString sheetPath = GetCurrentSheet().PathHumanReadable( false, true );
if( sheetPath != title )
title += wxString::Format( wxT( " [%s]" ), sheetPath );
if( readOnly )
title += wxS( " " ) + _( "[Read Only]" );

View File

@ -787,7 +787,7 @@ void SCH_SHEET::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_I
SCH_SHEET_PATH path = schframe->GetCurrentSheet();
path.push_back( this );
aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable( false ) );
aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable( false, true ) );
}
aList.emplace_back( _( "File Name" ), m_fields[ SHEETFILENAME ].GetText() );

View File

@ -288,7 +288,8 @@ KIID_PATH SCH_SHEET_PATH::Path() const
}
wxString SCH_SHEET_PATH::PathHumanReadable( bool aUseShortRootName ) const
wxString SCH_SHEET_PATH::PathHumanReadable( bool aUseShortRootName,
bool aStripTrailingSeparator ) const
{
wxString s;
@ -312,6 +313,9 @@ wxString SCH_SHEET_PATH::PathHumanReadable( bool aUseShortRootName ) const
for( unsigned i = 1; i < size(); i++ )
s << at( i )->GetFields()[SHEETNAME].GetShownText() << wxS( "/" );
if( aStripTrailingSeparator && s.EndsWith( "/" ) )
s = s.Left( s.length() - 1 );
return s;
}

View File

@ -287,7 +287,8 @@ public:
* The "normal" path instead uses the #KIID objects in the path that do not change
* even when editing sheet parameters.
*/
wxString PathHumanReadable( bool aUseShortRootName = true ) const;
wxString PathHumanReadable( bool aUseShortRootName = true,
bool aStripTrailingSeparator = false ) const;
/**
* Update all the symbol references for this sheet path.