diff --git a/eeschema/symbol_editor/menubar_symbol_editor.cpp b/eeschema/symbol_editor/menubar_symbol_editor.cpp index 49c5a2b6e2..2b98849a65 100644 --- a/eeschema/symbol_editor/menubar_symbol_editor.cpp +++ b/eeschema/symbol_editor/menubar_symbol_editor.cpp @@ -52,7 +52,7 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() fileMenu->AppendSeparator(); fileMenu->Add( ACTIONS::save ); - fileMenu->Add( EE_ACTIONS::saveSymbolAs ); + fileMenu->Add( EE_ACTIONS::saveSymbolCopyAs ); if( !IsSymbolFromSchematic() ) fileMenu->Add( ACTIONS::saveAll ); diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 80d8a3563d..e7d0a431e5 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -427,39 +427,39 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() return getTargetSymbol() != nullptr; }; - mgr->SetConditions( ACTIONS::saveAll, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( ACTIONS::save, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::saveLibraryAs, ENABLE( libSelectedCondition ) ); - mgr->SetConditions( EE_ACTIONS::saveSymbolAs, ENABLE( saveSymbolAsCondition ) ); - mgr->SetConditions( EE_ACTIONS::newSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::importSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( ACTIONS::saveAll, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( ACTIONS::save, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( EE_ACTIONS::saveLibraryAs, ENABLE( libSelectedCondition ) ); + mgr->SetConditions( EE_ACTIONS::saveSymbolCopyAs, ENABLE( saveSymbolAsCondition ) ); + mgr->SetConditions( EE_ACTIONS::newSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( EE_ACTIONS::importSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( ACTIONS::undo, ENABLE( haveSymbolCond && cond.UndoAvailable() ) ); - mgr->SetConditions( ACTIONS::redo, ENABLE( haveSymbolCond && cond.RedoAvailable() ) ); - mgr->SetConditions( ACTIONS::revert, ENABLE( symbolModifiedCondition ) ); + mgr->SetConditions( ACTIONS::undo, ENABLE( haveSymbolCond && cond.UndoAvailable() ) ); + mgr->SetConditions( ACTIONS::redo, ENABLE( haveSymbolCond && cond.RedoAvailable() ) ); + mgr->SetConditions( ACTIONS::revert, ENABLE( symbolModifiedCondition ) ); - mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); + mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); - mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) ); - mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); + mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) ); + mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); - mgr->SetConditions( ACTIONS::cut, ENABLE( isEditableCond ) ); - mgr->SetConditions( ACTIONS::copy, ENABLE( haveSymbolCond ) ); - mgr->SetConditions( ACTIONS::paste, ENABLE( isEditableCond && SELECTION_CONDITIONS::Idle ) ); - mgr->SetConditions( ACTIONS::doDelete, ENABLE( isEditableCond ) ); - mgr->SetConditions( ACTIONS::duplicate, ENABLE( isEditableCond ) ); - mgr->SetConditions( ACTIONS::selectAll, ENABLE( haveSymbolCond ) ); + mgr->SetConditions( ACTIONS::cut, ENABLE( isEditableCond ) ); + mgr->SetConditions( ACTIONS::copy, ENABLE( haveSymbolCond ) ); + mgr->SetConditions( ACTIONS::paste, ENABLE( isEditableCond && SELECTION_CONDITIONS::Idle ) ); + mgr->SetConditions( ACTIONS::doDelete, ENABLE( isEditableCond ) ); + mgr->SetConditions( ACTIONS::duplicate, ENABLE( isEditableCond ) ); + mgr->SetConditions( ACTIONS::selectAll, ENABLE( haveSymbolCond ) ); mgr->SetConditions( ACTIONS::unselectAll, ENABLE( haveSymbolCond ) ); - mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( isEditableCond ) ); - mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( isEditableCond ) ); - mgr->SetConditions( EE_ACTIONS::mirrorH, ENABLE( isEditableCond ) ); - mgr->SetConditions( EE_ACTIONS::mirrorV, ENABLE( isEditableCond ) ); + mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( isEditableCond ) ); + mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( isEditableCond ) ); + mgr->SetConditions( EE_ACTIONS::mirrorH, ENABLE( isEditableCond ) ); + mgr->SetConditions( EE_ACTIONS::mirrorV, ENABLE( isEditableCond ) ); - mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) ); - mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) ); + mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) ); + mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) ); auto pinTypeCond = [this]( const SELECTION& ) diff --git a/eeschema/symbol_editor/symbol_edit_frame.h b/eeschema/symbol_editor/symbol_edit_frame.h index 6f1a3caadd..2774b0f6d9 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.h +++ b/eeschema/symbol_editor/symbol_edit_frame.h @@ -150,7 +150,7 @@ public: /** * Save the currently selected symbol to a new name and/or location. */ - void SaveSymbolAs(); + void SaveSymbolCopyAs(); /** * Save the currently selected library to a new file. @@ -421,7 +421,7 @@ private: // Set up the tool framework void setupTools(); - void saveSymbolAs(); + void saveSymbolCopyAs(); /** * Save the changes to the current library. diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index 9baae41bb4..eae48d7669 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -548,9 +548,9 @@ void SYMBOL_EDIT_FRAME::SaveLibraryAs() } -void SYMBOL_EDIT_FRAME::SaveSymbolAs() +void SYMBOL_EDIT_FRAME::SaveSymbolCopyAs() { - saveSymbolAs(); + saveSymbolCopyAs(); m_treePane->GetLibTree()->RefreshLibTree(); } @@ -662,7 +662,7 @@ private: }; -void SYMBOL_EDIT_FRAME::saveSymbolAs() +void SYMBOL_EDIT_FRAME::saveSymbolCopyAs() { LIB_SYMBOL* symbol = getTargetSymbol(); @@ -745,8 +745,6 @@ void SYMBOL_EDIT_FRAME::saveSymbolAs() m_libMgr->UpdateSymbol( &new_symbol, libraryName ); SyncLibraries( false ); - m_treePane->GetLibTree()->SelectLibId( LIB_ID( libraryName, new_symbol.GetName() ) ); - LoadSymbol( symbolName, libraryName, m_unit ); } diff --git a/eeschema/tools/ee_actions.cpp b/eeschema/tools/ee_actions.cpp index 01d422e1e5..eb1e952a0a 100644 --- a/eeschema/tools/ee_actions.cpp +++ b/eeschema/tools/ee_actions.cpp @@ -197,11 +197,11 @@ TOOL_ACTION EE_ACTIONS::renameSymbol( TOOL_ACTION_ARGS() .Tooltip( _( "Rename the selected symbol" ) ) .Icon( BITMAPS::edit ) ); -TOOL_ACTION EE_ACTIONS::saveSymbolAs( TOOL_ACTION_ARGS() - .Name( "eeschema.SymbolLibraryControl.saveSymbolAs" ) +TOOL_ACTION EE_ACTIONS::saveSymbolCopyAs( TOOL_ACTION_ARGS() + .Name( "eeschema.SymbolLibraryControl.saveSymbolCopyAs" ) .Scope( AS_GLOBAL ) - .FriendlyName( _( "Save As..." ) ) - .Tooltip( _( "Save the current symbol to a different library." ) ) + .FriendlyName( _( "Save Copy As..." ) ) + .Tooltip( _( "Save a copy of the current symbol to a different library." ) ) .Icon( BITMAPS::save_as ) ); TOOL_ACTION EE_ACTIONS::deleteSymbol( TOOL_ACTION_ARGS() diff --git a/eeschema/tools/ee_actions.h b/eeschema/tools/ee_actions.h index 89c0d8bc56..a62b233150 100644 --- a/eeschema/tools/ee_actions.h +++ b/eeschema/tools/ee_actions.h @@ -196,7 +196,7 @@ public: // Library management static TOOL_ACTION saveLibraryAs; - static TOOL_ACTION saveSymbolAs; + static TOOL_ACTION saveSymbolCopyAs; static TOOL_ACTION newSymbol; static TOOL_ACTION deriveFromExistingSymbol; static TOOL_ACTION editSymbol; diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index 88906892b3..f4427bc013 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -107,7 +107,7 @@ bool SYMBOL_EDITOR_CONTROL::Init() ctxMenu.AddSeparator(); ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition || libInferredCondition ); ctxMenu.AddItem( EE_ACTIONS::saveLibraryAs, libSelectedCondition ); - ctxMenu.AddItem( EE_ACTIONS::saveSymbolAs, saveSymbolAsCondition ); + ctxMenu.AddItem( EE_ACTIONS::saveSymbolCopyAs, saveSymbolAsCondition ); ctxMenu.AddItem( ACTIONS::revert, symbolSelectedCondition || libInferredCondition ); ctxMenu.AddSeparator(); @@ -218,8 +218,8 @@ int SYMBOL_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvt ) editFrame->Save(); else if( aEvt.IsAction( &EE_ACTIONS::saveLibraryAs ) ) editFrame->SaveLibraryAs(); - else if( aEvt.IsAction( &EE_ACTIONS::saveSymbolAs ) ) - editFrame->SaveSymbolAs(); + else if( aEvt.IsAction( &EE_ACTIONS::saveSymbolCopyAs ) ) + editFrame->SaveSymbolCopyAs(); else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) ) editFrame->SaveAll(); } @@ -722,7 +722,7 @@ void SYMBOL_EDITOR_CONTROL::setTransitions() Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveLibraryAs.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveSymbolAs.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveSymbolCopyAs.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::saveAll.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() );