Library Editor: removed 'load component' hot key

This commit is contained in:
Maciej Suminski 2017-11-13 15:49:20 +01:00
parent 73ec145c33
commit 03c5620efe
4 changed files with 0 additions and 64 deletions

View File

@ -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 ); static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION, '@', ID_ZOOM_SELECTION );
// Special keys for library editor: // 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 HkCreatePin( _HKI( "Create Pin" ), HK_LIBEDIT_CREATE_PIN, 'P' );
static EDA_HOTKEY HkInsertPin( _HKI( "Repeat Pin" ), HK_REPEAT_LAST, WXK_INSERT ); 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' ); 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[] = static EDA_HOTKEY* libEdit_Hotkey_List[] =
{ {
&HkSaveLib, &HkSaveLib,
&HkLoadPart,
&HkCreatePin, &HkCreatePin,
&HkInsertPin, &HkInsertPin,
&HkMoveLibItem, &HkMoveLibItem,
@ -777,10 +775,6 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
} }
break; break;
case HK_LIBEDIT_LOAD_PART:
LoadOneLibraryPart( cmd );
break;
case HK_LIBEDIT_CREATE_PIN: case HK_LIBEDIT_CREATE_PIN:
if( ! itemInEdit ) if( ! itemInEdit )
{ {

View File

@ -45,7 +45,6 @@ enum hotkey_id_commnand {
HK_COPY_BLOCK, HK_COPY_BLOCK,
HK_PASTE_BLOCK, HK_PASTE_BLOCK,
HK_CUT_BLOCK, HK_CUT_BLOCK,
HK_LIBEDIT_LOAD_PART,
HK_LIBEDIT_CREATE_PIN, HK_LIBEDIT_CREATE_PIN,
HK_DELETE_PIN, HK_DELETE_PIN,
HK_ROTATE, HK_ROTATE,

View File

@ -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 ) bool LIB_EDIT_FRAME::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, const wxString& aLibrary )
{ {
wxString msg, rootName; wxString msg, rootName;

View File

@ -305,15 +305,6 @@ public:
void OnEditComponentProperties( wxCommandEvent& event ); void OnEditComponentProperties( wxCommandEvent& event );
void InstallFieldsEditorDialog( 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 OnViewEntryDoc( wxCommandEvent& event );
void OnCheckComponent( wxCommandEvent& event ); void OnCheckComponent( wxCommandEvent& event );
void OnSelectBodyStyle( wxCommandEvent& event ); void OnSelectBodyStyle( wxCommandEvent& event );