Regularize content of item descriptions.

1) Use sentence capitalisation
2) Show text of text items

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21582
This commit is contained in:
Jeff Young 2025-08-29 11:10:09 +01:00
parent 7115f9e716
commit 8a60893249
9 changed files with 17 additions and 19 deletions

View File

@ -333,10 +333,9 @@ bool DS_DRAW_ITEM_POLYPOLYGONS::HitTest( const BOX2I& aRect, bool aContained, in
} }
wxString DS_DRAW_ITEM_POLYPOLYGONS::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, wxString DS_DRAW_ITEM_POLYPOLYGONS::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
bool aFull ) const
{ {
return _( "Imported Shape" ); return _( "Imported shape" );
} }
@ -435,10 +434,9 @@ bool DS_DRAW_ITEM_RECT::HitTest( const BOX2I& aRect, bool aContained, int aAccur
wxString DS_DRAW_ITEM_RECT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString DS_DRAW_ITEM_RECT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
return wxString::Format( return wxString::Format( _( "Rectangle, width %s height %s" ),
_( "Rectangle, width %s height %s" ), aUnitsProvider->MessageTextFromValue( std::abs( GetStart().x - GetEnd().x ) ),
aUnitsProvider->MessageTextFromValue( std::abs( GetStart().x - GetEnd().x ) ), aUnitsProvider->MessageTextFromValue( std::abs( GetStart().y - GetEnd().y ) ) );
aUnitsProvider->MessageTextFromValue( std::abs( GetStart().y - GetEnd().y ) ) );
} }
@ -527,7 +525,7 @@ wxString DS_DRAW_ITEM_BITMAP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider
wxString DS_DRAW_ITEM_PAGE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString DS_DRAW_ITEM_PAGE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
return _( "Page Limits" ); return _( "Page limits" );
} }

View File

@ -143,8 +143,7 @@ INSPECT_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData,
wxString EDA_ITEM::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString EDA_ITEM::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
wxFAIL_MSG( wxT( "GetItemDescription() was not overridden for schematic item type " ) + wxFAIL_MSG( wxT( "GetItemDescription() was not overridden for schematic item type " ) + GetClass() );
GetClass() );
return wxString( wxT( "Undefined item description for " ) + GetClass() ); return wxString( wxT( "Undefined item description for " ) + GetClass() );
} }

View File

@ -416,13 +416,13 @@ bool SCH_BUS_ENTRY_BASE::HasConnectivityChanges( const SCH_ITEM* aItem,
wxString SCH_BUS_WIRE_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString SCH_BUS_WIRE_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
return wxString( _( "Bus to Wire Entry" ) ); return wxString( _( "Bus to wire entry" ) );
} }
wxString SCH_BUS_BUS_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString SCH_BUS_BUS_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
return wxString( _( "Bus to Bus Entry" ) ); return wxString( _( "Bus to bus entry" ) );
} }

View File

@ -359,7 +359,8 @@ void SCH_TEXTBOX::DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const
wxString SCH_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString SCH_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
return wxString::Format( _( "Text Box" ) ); return wxString::Format( _( "Text box '%s'" ),
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ) );
} }

View File

@ -459,7 +459,7 @@ INSPECT_RESULT PCB_TABLE::Visit( INSPECTOR aInspector, void* aTestData,
wxString PCB_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString PCB_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
return wxString::Format( _( "%d Column Table" ), m_colCount ); return wxString::Format( _( "%d column table" ), m_colCount );
} }

View File

@ -55,7 +55,7 @@ void PCB_TABLECELL::swapData( BOARD_ITEM* aImage )
wxString PCB_TABLECELL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString PCB_TABLECELL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
return wxString::Format( _( "Table Cell %s" ), GetAddr() ); return wxString::Format( _( "Table cell %s" ), GetAddr() );
} }

View File

@ -593,7 +593,7 @@ bool PCB_TEXTBOX::HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) cons
wxString PCB_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const wxString PCB_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{ {
return wxString::Format( _( "PCB Text Box '%s' on %s" ), return wxString::Format( _( "PCB text box '%s' on %s" ),
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ), aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ),
GetLayerName() ); GetLayerName() );
} }

View File

@ -170,8 +170,8 @@ wxString PCB_VIA::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull
switch( GetViaType() ) switch( GetViaType() )
{ {
case VIATYPE::BLIND_BURIED: formatStr = _( "Blind/Buried Via %s on %s" ); break; case VIATYPE::BLIND_BURIED: formatStr = _( "Blind/buried via %s on %s" ); break;
case VIATYPE::MICROVIA: formatStr = _( "Micro Via %s on %s" ); break; case VIATYPE::MICROVIA: formatStr = _( "Micro via %s on %s" ); break;
default: formatStr = _( "Via %s on %s" ); break; default: formatStr = _( "Via %s on %s" ); break;
} }

View File

@ -1190,7 +1190,7 @@ wxString ZONE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull )
} }
else else
{ {
return wxString::Format( _( "Rule Area '%s' %s" ), return wxString::Format( _( "Rule area '%s' %s" ),
GetZoneName(), GetZoneName(),
layerDesc ); layerDesc );
} }