From 03c5620efe659d27a3c9bdf3441f1014c3c8ab10 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Nov 2017 15:49:20 +0100 Subject: [PATCH] Library Editor: removed 'load component' hot key --- eeschema/hotkeys.cpp | 6 ------ eeschema/hotkeys.h | 1 - eeschema/libedit.cpp | 48 ----------------------------------------- eeschema/libeditframe.h | 9 -------- 4 files changed, 64 deletions(-) diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index fa442d5c3e..e43467ac33 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -213,7 +213,6 @@ static EDA_HOTKEY HkFindNextDrcMarker( _HKI( "Find Next DRC Marker" ), HK_FIND_N static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION, '@', ID_ZOOM_SELECTION ); // Special keys for library editor: -static EDA_HOTKEY HkLoadPart( _HKI( "Load Component" ), HK_LIBEDIT_LOAD_PART, 'L' + GR_KB_CTRL ); static EDA_HOTKEY HkCreatePin( _HKI( "Create Pin" ), HK_LIBEDIT_CREATE_PIN, 'P' ); static EDA_HOTKEY HkInsertPin( _HKI( "Repeat Pin" ), HK_REPEAT_LAST, WXK_INSERT ); static EDA_HOTKEY HkMoveLibItem( _HKI( "Move Library Item" ), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M' ); @@ -321,7 +320,6 @@ static EDA_HOTKEY* schematic_Hotkey_List[] = static EDA_HOTKEY* libEdit_Hotkey_List[] = { &HkSaveLib, - &HkLoadPart, &HkCreatePin, &HkInsertPin, &HkMoveLibItem, @@ -777,10 +775,6 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, } break; - case HK_LIBEDIT_LOAD_PART: - LoadOneLibraryPart( cmd ); - break; - case HK_LIBEDIT_CREATE_PIN: if( ! itemInEdit ) { diff --git a/eeschema/hotkeys.h b/eeschema/hotkeys.h index c173e95c89..1d8b225233 100644 --- a/eeschema/hotkeys.h +++ b/eeschema/hotkeys.h @@ -45,7 +45,6 @@ enum hotkey_id_commnand { HK_COPY_BLOCK, HK_PASTE_BLOCK, HK_CUT_BLOCK, - HK_LIBEDIT_LOAD_PART, HK_LIBEDIT_CREATE_PIN, HK_DELETE_PIN, HK_ROTATE, diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index b9f1126cff..ba1e297d1d 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -143,54 +143,6 @@ bool LIB_EDIT_FRAME::LoadComponentFromCurrentLib( const wxString& aAliasName, in } -void LIB_EDIT_FRAME::LoadOneLibraryPart( wxCommandEvent& event ) -{ - m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() ); - - if( GetScreen()->IsModify() - && !IsOK( this, _( "The current symbol is not saved.\n\nDiscard current changes?" ) ) ) - return; - - wxString lib = GetCurLib(); - - // No current lib, ask user for the library to use. - if( lib.empty() ) - { - SelectActiveLibrary(); - - lib = GetCurLib(); - - if( lib.empty() ) - return; - } - - // Get the name of the current part to preselect it - LIB_PART* current_part = GetCurPart(); - LIB_ID id; - - if( current_part ) - id = current_part->GetLibId(); - - SCH_BASE_FRAME::HISTORY_LIST dummyHistoryList; - SCHLIB_FILTER filter; - filter.LoadFrom( lib ); - auto sel = SelectComponentFromLibrary( &filter, dummyHistoryList, true, 0, 0, &id, false ); - - if( sel.LibId.GetLibItemName().empty() ) - return; - - GetScreen()->ClrModify(); - m_lastDrawItem = m_drawItem = NULL; - - // Delete previous library symbol, if any - SetCurPart( NULL ); - m_aliasName.Empty(); - - // Load the new library symbol - LoadComponentFromCurrentLib( sel.LibId.GetLibItemName(), sel.Unit, sel.Convert ); -} - - bool LIB_EDIT_FRAME::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, const wxString& aLibrary ) { wxString msg, rootName; diff --git a/eeschema/libeditframe.h b/eeschema/libeditframe.h index 49d5801a25..f441748a0b 100644 --- a/eeschema/libeditframe.h +++ b/eeschema/libeditframe.h @@ -305,15 +305,6 @@ public: void OnEditComponentProperties( wxCommandEvent& event ); void InstallFieldsEditorDialog( wxCommandEvent& event ); - /** - * Loads a symbol from the currently selected library. - * - * If a library is already selected, the user is prompted for the component name - * to load. If there is no current selected library, the user is prompted to select - * a library name and then select component to load. - */ - void LoadOneLibraryPart( wxCommandEvent& event ); - void OnViewEntryDoc( wxCommandEvent& event ); void OnCheckComponent( wxCommandEvent& event ); void OnSelectBodyStyle( wxCommandEvent& event );