diff --git a/eeschema/cmp_tree_model_adapter.cpp b/eeschema/cmp_tree_model_adapter.cpp index 21c80d3e78..a7be38c68e 100644 --- a/eeschema/cmp_tree_model_adapter.cpp +++ b/eeschema/cmp_tree_model_adapter.cpp @@ -386,7 +386,12 @@ bool CMP_TREE_MODEL_ADAPTER::ShowPreselect() return FindAndExpand( m_tree, [&]( CMP_TREE_NODE const* n ) { - return m_preselect_name == n->Name && m_preselect_unit == n->Unit; + if( n->Type == CMP_TREE_NODE::ALIAS && ( n->Children.empty() || !m_preselect_unit ) ) + return m_preselect_name == n->Name; + else if( n->Type == CMP_TREE_NODE::UNIT && m_preselect_unit ) + return m_preselect_name == n->Parent->Name && m_preselect_unit == n->Unit; + else + return false; } ); } diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index 6e9202fc22..22a9eaa520 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -141,15 +141,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const SCHLIB_FILTER* aFilte if( !aHistoryList.empty() ) { - // This is good for a transition for experienced users: giving them a History. Ideally, - // we actually make this part even faster to access with a popup on ALT-a or something. - // the history is under a node named "-- History --" - // However, because it is translatable, and we need to have a node name starting by "-- " - // because we (later) sort all node names alphabetically and this node should be the first, - // we build it with only with "History" string translatable - wxString nodename; - nodename << wxT("-- ") << _("History") << wxT(" --"); - adapter->AddAliasList( nodename, aHistoryList, NULL ); + adapter->AddAliasList( "-- " + _( "History" ) + " --", aHistoryList, NULL ); adapter->SetPreselectNode( aHistoryList[0], aHistoryLastUnit ); }