From 8a608932495515105f0288df8c0457e401139904 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 29 Aug 2025 11:10:09 +0100 Subject: [PATCH] Regularize content of item descriptions. 1) Use sentence capitalisation 2) Show text of text items Fixes https://gitlab.com/kicad/code/kicad/-/issues/21582 --- common/drawing_sheet/ds_draw_item.cpp | 14 ++++++-------- common/eda_item.cpp | 3 +-- eeschema/sch_bus_entry.cpp | 4 ++-- eeschema/sch_textbox.cpp | 3 ++- pcbnew/pcb_table.cpp | 2 +- pcbnew/pcb_tablecell.cpp | 2 +- pcbnew/pcb_textbox.cpp | 2 +- pcbnew/pcb_track.cpp | 4 ++-- pcbnew/zone.cpp | 2 +- 9 files changed, 17 insertions(+), 19 deletions(-) diff --git a/common/drawing_sheet/ds_draw_item.cpp b/common/drawing_sheet/ds_draw_item.cpp index 0937f522d6..da60b5a66a 100644 --- a/common/drawing_sheet/ds_draw_item.cpp +++ b/common/drawing_sheet/ds_draw_item.cpp @@ -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, - bool aFull ) const +wxString DS_DRAW_ITEM_POLYPOLYGONS::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, 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 { - return wxString::Format( - _( "Rectangle, width %s height %s" ), - aUnitsProvider->MessageTextFromValue( std::abs( GetStart().x - GetEnd().x ) ), - aUnitsProvider->MessageTextFromValue( std::abs( GetStart().y - GetEnd().y ) ) ); + return wxString::Format( _( "Rectangle, width %s height %s" ), + aUnitsProvider->MessageTextFromValue( std::abs( GetStart().x - GetEnd().x ) ), + 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 { - return _( "Page Limits" ); + return _( "Page limits" ); } diff --git a/common/eda_item.cpp b/common/eda_item.cpp index 46fb5eaa75..23392af1d2 100644 --- a/common/eda_item.cpp +++ b/common/eda_item.cpp @@ -143,8 +143,7 @@ INSPECT_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData, wxString EDA_ITEM::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const { - wxFAIL_MSG( wxT( "GetItemDescription() was not overridden for schematic item type " ) + - GetClass() ); + wxFAIL_MSG( wxT( "GetItemDescription() was not overridden for schematic item type " ) + GetClass() ); return wxString( wxT( "Undefined item description for " ) + GetClass() ); } diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index 29457eb3f9..78c1a2a2a2 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -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 { - return wxString( _( "Bus to Wire Entry" ) ); + return wxString( _( "Bus to wire entry" ) ); } wxString SCH_BUS_BUS_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const { - return wxString( _( "Bus to Bus Entry" ) ); + return wxString( _( "Bus to bus entry" ) ); } diff --git a/eeschema/sch_textbox.cpp b/eeschema/sch_textbox.cpp index 82457a2698..891d450578 100644 --- a/eeschema/sch_textbox.cpp +++ b/eeschema/sch_textbox.cpp @@ -359,7 +359,8 @@ void SCH_TEXTBOX::DoHypertextAction( EDA_DRAW_FRAME* aFrame ) 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() ) ); } diff --git a/pcbnew/pcb_table.cpp b/pcbnew/pcb_table.cpp index 26534e7895..45cd930adb 100644 --- a/pcbnew/pcb_table.cpp +++ b/pcbnew/pcb_table.cpp @@ -459,7 +459,7 @@ INSPECT_RESULT PCB_TABLE::Visit( INSPECTOR aInspector, void* aTestData, 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 ); } diff --git a/pcbnew/pcb_tablecell.cpp b/pcbnew/pcb_tablecell.cpp index 1f4055df4f..22d2f7227b 100644 --- a/pcbnew/pcb_tablecell.cpp +++ b/pcbnew/pcb_tablecell.cpp @@ -55,7 +55,7 @@ void PCB_TABLECELL::swapData( BOARD_ITEM* aImage ) wxString PCB_TABLECELL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const { - return wxString::Format( _( "Table Cell %s" ), GetAddr() ); + return wxString::Format( _( "Table cell %s" ), GetAddr() ); } diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index 0319f27ae8..20e860990b 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -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 { - return wxString::Format( _( "PCB Text Box '%s' on %s" ), + return wxString::Format( _( "PCB text box '%s' on %s" ), aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ), GetLayerName() ); } diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index a7fe860474..5569b3f875 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -170,8 +170,8 @@ wxString PCB_VIA::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull switch( GetViaType() ) { - case VIATYPE::BLIND_BURIED: formatStr = _( "Blind/Buried Via %s on %s" ); break; - case VIATYPE::MICROVIA: formatStr = _( "Micro 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; default: formatStr = _( "Via %s on %s" ); break; } diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index 3db309f437..1ee46b8953 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -1190,7 +1190,7 @@ wxString ZONE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) } else { - return wxString::Format( _( "Rule Area '%s' %s" ), + return wxString::Format( _( "Rule area '%s' %s" ), GetZoneName(), layerDesc ); }