Display unit name in symbol context menu
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18285
(Cherry-picked from cc81ccf79a
)
This commit is contained in:
parent
03c71b22d5
commit
9b49fc5a0d
|
@ -101,10 +101,14 @@ private:
|
||||||
|
|
||||||
for( int ii = 0; ii < symbol->GetLibSymbolRef()->GetUnitCount(); ii++ )
|
for( int ii = 0; ii < symbol->GetLibSymbolRef()->GetUnitCount(); ii++ )
|
||||||
{
|
{
|
||||||
wxString num_unit;
|
wxString unit_text;
|
||||||
num_unit.Printf( _( "Unit %s" ), symbol->SubReference( ii + 1, false ) );
|
|
||||||
|
|
||||||
wxMenuItem* item = Append( ID_POPUP_SCH_SELECT_UNIT1 + ii, num_unit, wxEmptyString,
|
if( symbol->GetLibSymbolRef()->HasUnitDisplayName( ii + 1 ) )
|
||||||
|
unit_text = symbol->GetLibSymbolRef()->GetUnitDisplayName( ii + 1 );
|
||||||
|
else
|
||||||
|
unit_text.Printf( _( "Unit %s" ), symbol->SubReference( ii + 1, false ) );
|
||||||
|
|
||||||
|
wxMenuItem* item = Append( ID_POPUP_SCH_SELECT_UNIT1 + ii, unit_text, wxEmptyString,
|
||||||
wxITEM_CHECK );
|
wxITEM_CHECK );
|
||||||
|
|
||||||
if( unit == ii + 1 )
|
if( unit == ii + 1 )
|
||||||
|
|
Loading…
Reference in New Issue