Harmonize more APIs.
This commit is contained in:
parent
968ca7c5c3
commit
494001ed4c
|
@ -79,7 +79,7 @@ public:
|
|||
return aItem && aItem->Type() == LIB_FIELD_T;
|
||||
}
|
||||
|
||||
wxString GetTypeName() const override
|
||||
wxString GetFriendlyName() const override
|
||||
{
|
||||
return _( "Field" );
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_IT
|
|||
{
|
||||
wxString msg;
|
||||
|
||||
aList.emplace_back( _( "Type" ), GetTypeName() );
|
||||
aList.emplace_back( _( "Type" ), GetFriendlyName() );
|
||||
|
||||
if( const SYMBOL* parent = GetParentSymbol() )
|
||||
{
|
||||
|
|
|
@ -98,12 +98,6 @@ public:
|
|||
ERC = 0x04
|
||||
};
|
||||
|
||||
/**
|
||||
* Provide a user-consumable name of the object type. Perform localization when
|
||||
* called so that run-time language selection works.
|
||||
*/
|
||||
virtual wxString GetTypeName() const = 0;
|
||||
|
||||
static inline bool ClassOf( const EDA_ITEM* aItem )
|
||||
{
|
||||
if( !aItem )
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
return aItem && aItem->Type() == LIB_PIN_T;
|
||||
}
|
||||
|
||||
wxString GetTypeName() const override
|
||||
wxString GetFriendlyName() const override
|
||||
{
|
||||
return _( "Pin" );
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
return aItem && aItem->Type() == LIB_SHAPE_T;
|
||||
}
|
||||
|
||||
wxString GetTypeName() const override
|
||||
wxString GetFriendlyName() const override
|
||||
{
|
||||
return ShowShape();
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
return aItem && aItem->Type() == LIB_TEXT_T;
|
||||
}
|
||||
|
||||
wxString GetTypeName() const override
|
||||
wxString GetFriendlyName() const override
|
||||
{
|
||||
return _( "Text" );
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ protected:
|
|||
HANDLER_RESULT<ResponseType>( HandlerType::* aHandler )( RequestType&,
|
||||
const HANDLER_CONTEXT& ) )
|
||||
{
|
||||
std::string typeName = RequestType().GetTypeName();
|
||||
std::string typeName = RequestType().GetFriendlyName();
|
||||
|
||||
wxASSERT_MSG( !m_handlers.count( typeName ),
|
||||
wxString::Format( "Duplicate API handler for type %s", typeName ) );
|
||||
|
@ -138,7 +138,7 @@ private:
|
|||
if( !aRequest.message().UnpackTo( &aDest ) )
|
||||
{
|
||||
std::string msg = fmt::format( "could not unpack message of type {} from request",
|
||||
aDest.GetTypeName() );
|
||||
aDest.GetFriendlyName() );
|
||||
aReply.mutable_status()->set_status( ApiStatusCode::AS_BAD_REQUEST );
|
||||
aReply.mutable_status()->set_error_message( msg );
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue