Eeschema: REMOVED "Update from Symbol Library"
This is effectively duplicated by "Update Symbol(s) from Library". Fixes https://gitlab.com/kicad/code/kicad/issues/5217
This commit is contained in:
parent
8930e48cf3
commit
5f6d309d36
|
@ -572,12 +572,6 @@ TOOL_ACTION EE_ACTIONS::remapSymbols( "eeschema.EditorControl.remapSymbols",
|
|||
_( "Remap library symbol references in legacy schematics to the symbol library table" ),
|
||||
rescue_xpm );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::refreshSymbolFromLibrary( "eeschema.EditorControl.refreshSymbolFromLibrary",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Update from Symbol Library" ),
|
||||
_( "Update from the symbol library using the library identifier" ),
|
||||
refresh_xpm );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::showBusManager( "eeschema.EditorControl.showBusManager",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Bus Definitions..." ), _( "Manage bus definitions" ),
|
||||
|
|
|
@ -155,7 +155,6 @@ public:
|
|||
|
||||
static TOOL_ACTION rescueSymbols;
|
||||
static TOOL_ACTION remapSymbols;
|
||||
static TOOL_ACTION refreshSymbolFromLibrary;
|
||||
|
||||
// Suite operations
|
||||
static TOOL_ACTION editWithLibEdit;
|
||||
|
|
|
@ -278,7 +278,6 @@ bool SCH_EDIT_TOOL::Init()
|
|||
auto wireSelectionCondition = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_LINE_LOCATE_WIRE_T );
|
||||
auto busSelectionCondition = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_LINE_LOCATE_BUS_T );
|
||||
auto singleSheetCondition = E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T );
|
||||
auto symbolsOnlyCondition = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_COMPONENT_T );
|
||||
//
|
||||
// Add edit actions to the move tool menu
|
||||
//
|
||||
|
@ -360,7 +359,6 @@ bool SCH_EDIT_TOOL::Init()
|
|||
selToolMenu.AddItem( EE_ACTIONS::editFootprint, E_C::SingleSymbol, 200 );
|
||||
selToolMenu.AddItem( EE_ACTIONS::autoplaceFields, singleComponentCondition, 200 );
|
||||
selToolMenu.AddItem( EE_ACTIONS::toggleDeMorgan, E_C::SingleSymbol, 200 );
|
||||
selToolMenu.AddItem( EE_ACTIONS::refreshSymbolFromLibrary, symbolsOnlyCondition, 200 );
|
||||
|
||||
std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu3 = std::make_shared<SYMBOL_UNIT_MENU>();
|
||||
symUnitMenu3->SetTool( m_selectionTool );
|
||||
|
@ -1329,80 +1327,6 @@ int SCH_EDIT_TOOL::ConvertDeMorgan( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int SCH_EDIT_TOOL::RefreshSymbolFromLibrary( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxString msg;
|
||||
bool appendToUndo = false;
|
||||
EE_SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::ComponentsOnly );
|
||||
|
||||
if( selection.Empty() )
|
||||
return 0;
|
||||
|
||||
WX_INFOBAR* infoBar = m_frame->GetInfoBar();
|
||||
|
||||
wxCHECK( infoBar, 0 );
|
||||
|
||||
INFOBAR_REPORTER reporter( infoBar );
|
||||
|
||||
SCH_SCREEN* currentScreen = m_frame->GetScreen();
|
||||
|
||||
wxCHECK( currentScreen, 0 );
|
||||
|
||||
for( auto item : selection )
|
||||
{
|
||||
SCH_COMPONENT* symbol = dynamic_cast<SCH_COMPONENT*>( item );
|
||||
|
||||
wxCHECK( symbol, 0 );
|
||||
|
||||
// This needs to be done before the LIB_ID is changed to prevent stale library symbols in
|
||||
// the schematic file.
|
||||
currentScreen->Remove( symbol );
|
||||
|
||||
if( !symbol->IsNew() )
|
||||
{
|
||||
saveCopyInUndoList( symbol, UNDO_REDO::CHANGED, appendToUndo );
|
||||
appendToUndo = true;
|
||||
}
|
||||
|
||||
LIB_ID id = symbol->GetLibId();
|
||||
|
||||
if( !id.IsValid() )
|
||||
{
|
||||
msg.Printf( _( "'%s' is not a valid library indentifier." ),
|
||||
id.GetUniStringLibId() );
|
||||
reporter.Report( msg, RPT_SEVERITY_WARNING );
|
||||
continue;
|
||||
}
|
||||
|
||||
LIB_PART* libSymbol = m_frame->Prj().SchSymbolLibTable()->LoadSymbol( id );
|
||||
|
||||
if( !libSymbol )
|
||||
{
|
||||
msg.Printf( _( "Symbol '%s' not found in symbol library '%s'." ),
|
||||
id.GetLibItemName().wx_str(), id.GetLibNickname().wx_str() );
|
||||
reporter.Report( msg, RPT_SEVERITY_WARNING );
|
||||
continue;
|
||||
}
|
||||
|
||||
symbol->SetLibSymbol( libSymbol->Flatten().release() );
|
||||
currentScreen->Append( symbol );
|
||||
m_selectionTool->SelectHighlightItem( symbol );
|
||||
updateView( symbol );
|
||||
}
|
||||
|
||||
if( selection.IsHover() )
|
||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
reporter.Finalize();
|
||||
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
m_frame->OnModify();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EE_SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::EditableItems );
|
||||
|
@ -1829,8 +1753,6 @@ void SCH_EDIT_TOOL::setTransitions()
|
|||
Go( &SCH_EDIT_TOOL::ConvertDeMorgan, EE_ACTIONS::toggleDeMorgan.MakeEvent() );
|
||||
Go( &SCH_EDIT_TOOL::ConvertDeMorgan, EE_ACTIONS::showDeMorganStandard.MakeEvent() );
|
||||
Go( &SCH_EDIT_TOOL::ConvertDeMorgan, EE_ACTIONS::showDeMorganAlternate.MakeEvent() );
|
||||
Go( &SCH_EDIT_TOOL::RefreshSymbolFromLibrary,
|
||||
EE_ACTIONS::refreshSymbolFromLibrary.MakeEvent() );
|
||||
Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toLabel.MakeEvent() );
|
||||
Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toHLabel.MakeEvent() );
|
||||
Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toGLabel.MakeEvent() );
|
||||
|
|
|
@ -54,8 +54,6 @@ public:
|
|||
int ChangeSymbols( const TOOL_EVENT& aEvent );
|
||||
int ConvertDeMorgan( const TOOL_EVENT& aEvent );
|
||||
|
||||
int RefreshSymbolFromLibrary( const TOOL_EVENT& aEvent );
|
||||
|
||||
/**
|
||||
* Change a text type to another one.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue