diff --git a/common/eda_item.cpp b/common/eda_item.cpp index 4cffc14d81..57a54a04e3 100644 --- a/common/eda_item.cpp +++ b/common/eda_item.cpp @@ -303,6 +303,15 @@ std::ostream& EDA_ITEM::NestedSpace( int nestLevel, std::ostream& os ) #endif +wxString EDA_ITEM::GetTypeDesc() +{ + //@see EDA_ITEM_DESC for definition of ENUM_MAP + wxString typeDescr = ENUM_MAP::Instance().ToString( Type() ); + + return wxGetTranslation( typeDescr ); +} + + static struct EDA_ITEM_DESC { EDA_ITEM_DESC() diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp index 34d57e4607..dc4e9b67db 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -90,9 +90,7 @@ void PROPERTIES_PANEL::update( const SELECTION& aSelection ) } else { - // TODO: Plain-language descriptive noun function in EDA_ITEM classes - // TODO: Need to override this in PCB editor vs. schematic - m_caption->SetLabel( aSelection.Front()->GetClass() ); + m_caption->SetLabel( aSelection.Front()->GetTypeDesc() ); } PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); diff --git a/include/eda_item.h b/include/eda_item.h index 75f7926ca3..8128d03318 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -350,6 +350,12 @@ public: */ virtual wxString GetClass() const = 0; + /** + * Return a translated description of the type for this EDA_ITEM for display in user facing + * messages. + */ + wxString GetTypeDesc(); + /** * Return the text to display to be used in the selection clarification context menu * when multiple items are found at the current cursor position.