From ed059383c7ee01754ddd3dab13e73a77b2af79e5 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 20 Nov 2017 21:03:54 +0100 Subject: [PATCH] Library Editor: removed library actions from the part context menu --- eeschema/libeditframe.cpp | 2 +- eeschema/widgets/cmp_tree_pane.cpp | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index 3e2d5c832d..93a927c464 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -527,7 +527,7 @@ void LIB_EDIT_FRAME::OnUpdatePartModified( wxUpdateUIEvent& aEvent ) { bool readOnly = libName.IsEmpty() || m_libMgr->IsLibraryReadOnly( libName ); - aEvent.SetText( readOnly ? _( "Save part [Read Only]" ) : _( "Save part" ) ); + aEvent.SetText( readOnly ? _( "Save [Read Only]" ) : _( "Save" ) ); aEvent.Enable( !readOnly && !partName.IsEmpty() && m_libMgr->IsPartModified( partName, libName ) ); } diff --git a/eeschema/widgets/cmp_tree_pane.cpp b/eeschema/widgets/cmp_tree_pane.cpp index 41f79e732a..c1b229b105 100644 --- a/eeschema/widgets/cmp_tree_pane.cpp +++ b/eeschema/widgets/cmp_tree_pane.cpp @@ -67,18 +67,12 @@ CMP_TREE_PANE::CMP_TREE_PANE( LIB_EDIT_FRAME* aParent, LIB_MANAGER* aLibMgr ) menuPart->Append( ID_LIBEDIT_SAVE_PART, _( "Save" ) ); menuPart->Append( ID_LIBEDIT_REVERT_PART, _( "Revert" ) ); menuPart->AppendSeparator(); - menuPart->Append( ID_LIBEDIT_CUT_PART, _( "Cut part" ) ); - menuPart->Append( ID_LIBEDIT_COPY_PART, _( "Copy part" ) ); - menuPart->Append( ID_LIBEDIT_DUPLICATE_PART, _( "Duplicate part" ) ); + menuPart->Append( ID_LIBEDIT_CUT_PART, _( "Cut" ) ); + menuPart->Append( ID_LIBEDIT_COPY_PART, _( "Copy" ) ); + menuPart->Append( ID_LIBEDIT_DUPLICATE_PART, _( "Duplicate" ) ); menuPart->AppendSeparator(); - // Append the library menu to the part menu - for( size_t i = 0; i < menuLibrary->GetMenuItemCount(); ++i ) - { - wxMenuItem* menuItem = menuLibrary->FindItemByPosition( i ); - menuPart->Append( menuItem->GetId(), menuItem->GetItemLabel() ); - } - + // Menu displayed when nothing is selected std::unique_ptr menuNoSelection = std::make_unique(); menuNoSelection->Append( ID_LIBEDIT_NEW_LIBRARY, _( "New library..." ) ); menuNoSelection->Append( ID_LIBEDIT_ADD_LIBRARY, _( "Add existing library..." ) );