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:
parent
346530a5b1
commit
f75d18c7c8
|
@ -277,12 +277,12 @@ 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" ),
|
||||
( sheetPath.Length() > 20 ) ? wxS( " \n" ) + sheetPath + wxT( ": " )
|
||||
: sheetPath + wxT( ": " ) );
|
||||
( sheetPath.Length() > 20 ) ? wxS( " \n" ) + sheetPath + wxT( ": " )
|
||||
: sheetPath + wxT( ": " ) );
|
||||
|
||||
wxTextEntryDialog dlg( m_frame, msg, _( "Edit Sheet Page Number" ), pageNumber );
|
||||
|
||||
|
|
|
@ -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]" );
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue