Change Save Symbol As... to Save Symbol Copy As...
See details in the bug report. (It's very complicated.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/12504
This commit is contained in:
parent
72c44d7fa3
commit
14d6ff8946
|
@ -52,7 +52,7 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar()
|
||||||
|
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
fileMenu->Add( ACTIONS::save );
|
fileMenu->Add( ACTIONS::save );
|
||||||
fileMenu->Add( EE_ACTIONS::saveSymbolAs );
|
fileMenu->Add( EE_ACTIONS::saveSymbolCopyAs );
|
||||||
|
|
||||||
if( !IsSymbolFromSchematic() )
|
if( !IsSymbolFromSchematic() )
|
||||||
fileMenu->Add( ACTIONS::saveAll );
|
fileMenu->Add( ACTIONS::saveAll );
|
||||||
|
|
|
@ -427,39 +427,39 @@ void SYMBOL_EDIT_FRAME::setupUIConditions()
|
||||||
return getTargetSymbol() != nullptr;
|
return getTargetSymbol() != nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::saveAll, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
mgr->SetConditions( ACTIONS::saveAll, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||||
mgr->SetConditions( ACTIONS::save, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
mgr->SetConditions( ACTIONS::save, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||||
mgr->SetConditions( EE_ACTIONS::saveLibraryAs, ENABLE( libSelectedCondition ) );
|
mgr->SetConditions( EE_ACTIONS::saveLibraryAs, ENABLE( libSelectedCondition ) );
|
||||||
mgr->SetConditions( EE_ACTIONS::saveSymbolAs, ENABLE( saveSymbolAsCondition ) );
|
mgr->SetConditions( EE_ACTIONS::saveSymbolCopyAs, ENABLE( saveSymbolAsCondition ) );
|
||||||
mgr->SetConditions( EE_ACTIONS::newSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
mgr->SetConditions( EE_ACTIONS::newSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||||
mgr->SetConditions( EE_ACTIONS::importSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
mgr->SetConditions( EE_ACTIONS::importSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::undo, ENABLE( haveSymbolCond && cond.UndoAvailable() ) );
|
mgr->SetConditions( ACTIONS::undo, ENABLE( haveSymbolCond && cond.UndoAvailable() ) );
|
||||||
mgr->SetConditions( ACTIONS::redo, ENABLE( haveSymbolCond && cond.RedoAvailable() ) );
|
mgr->SetConditions( ACTIONS::redo, ENABLE( haveSymbolCond && cond.RedoAvailable() ) );
|
||||||
mgr->SetConditions( ACTIONS::revert, ENABLE( symbolModifiedCondition ) );
|
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::toggleGridOverrides, CHECK( cond.GridOverrides() ) );
|
||||||
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );
|
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );
|
||||||
mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
|
mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
|
||||||
mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
|
mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
|
||||||
mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
|
mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::cut, ENABLE( isEditableCond ) );
|
mgr->SetConditions( ACTIONS::cut, ENABLE( isEditableCond ) );
|
||||||
mgr->SetConditions( ACTIONS::copy, ENABLE( haveSymbolCond ) );
|
mgr->SetConditions( ACTIONS::copy, ENABLE( haveSymbolCond ) );
|
||||||
mgr->SetConditions( ACTIONS::paste, ENABLE( isEditableCond && SELECTION_CONDITIONS::Idle ) );
|
mgr->SetConditions( ACTIONS::paste, ENABLE( isEditableCond && SELECTION_CONDITIONS::Idle ) );
|
||||||
mgr->SetConditions( ACTIONS::doDelete, ENABLE( isEditableCond ) );
|
mgr->SetConditions( ACTIONS::doDelete, ENABLE( isEditableCond ) );
|
||||||
mgr->SetConditions( ACTIONS::duplicate, ENABLE( isEditableCond ) );
|
mgr->SetConditions( ACTIONS::duplicate, ENABLE( isEditableCond ) );
|
||||||
mgr->SetConditions( ACTIONS::selectAll, ENABLE( haveSymbolCond ) );
|
mgr->SetConditions( ACTIONS::selectAll, ENABLE( haveSymbolCond ) );
|
||||||
mgr->SetConditions( ACTIONS::unselectAll, ENABLE( haveSymbolCond ) );
|
mgr->SetConditions( ACTIONS::unselectAll, ENABLE( haveSymbolCond ) );
|
||||||
|
|
||||||
mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( isEditableCond ) );
|
mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( isEditableCond ) );
|
||||||
mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( isEditableCond ) );
|
mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( isEditableCond ) );
|
||||||
mgr->SetConditions( EE_ACTIONS::mirrorH, ENABLE( isEditableCond ) );
|
mgr->SetConditions( EE_ACTIONS::mirrorH, ENABLE( isEditableCond ) );
|
||||||
mgr->SetConditions( EE_ACTIONS::mirrorV, ENABLE( isEditableCond ) );
|
mgr->SetConditions( EE_ACTIONS::mirrorV, ENABLE( isEditableCond ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) );
|
mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) );
|
||||||
mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) );
|
mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) );
|
||||||
|
|
||||||
auto pinTypeCond =
|
auto pinTypeCond =
|
||||||
[this]( const SELECTION& )
|
[this]( const SELECTION& )
|
||||||
|
|
|
@ -150,7 +150,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Save the currently selected symbol to a new name and/or location.
|
* 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.
|
* Save the currently selected library to a new file.
|
||||||
|
@ -421,7 +421,7 @@ private:
|
||||||
// Set up the tool framework
|
// Set up the tool framework
|
||||||
void setupTools();
|
void setupTools();
|
||||||
|
|
||||||
void saveSymbolAs();
|
void saveSymbolCopyAs();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the changes to the current library.
|
* Save the changes to the current library.
|
||||||
|
|
|
@ -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();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
}
|
}
|
||||||
|
@ -662,7 +662,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void SYMBOL_EDIT_FRAME::saveSymbolAs()
|
void SYMBOL_EDIT_FRAME::saveSymbolCopyAs()
|
||||||
{
|
{
|
||||||
LIB_SYMBOL* symbol = getTargetSymbol();
|
LIB_SYMBOL* symbol = getTargetSymbol();
|
||||||
|
|
||||||
|
@ -745,8 +745,6 @@ void SYMBOL_EDIT_FRAME::saveSymbolAs()
|
||||||
|
|
||||||
m_libMgr->UpdateSymbol( &new_symbol, libraryName );
|
m_libMgr->UpdateSymbol( &new_symbol, libraryName );
|
||||||
SyncLibraries( false );
|
SyncLibraries( false );
|
||||||
m_treePane->GetLibTree()->SelectLibId( LIB_ID( libraryName, new_symbol.GetName() ) );
|
|
||||||
LoadSymbol( symbolName, libraryName, m_unit );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -197,11 +197,11 @@ TOOL_ACTION EE_ACTIONS::renameSymbol( TOOL_ACTION_ARGS()
|
||||||
.Tooltip( _( "Rename the selected symbol" ) )
|
.Tooltip( _( "Rename the selected symbol" ) )
|
||||||
.Icon( BITMAPS::edit ) );
|
.Icon( BITMAPS::edit ) );
|
||||||
|
|
||||||
TOOL_ACTION EE_ACTIONS::saveSymbolAs( TOOL_ACTION_ARGS()
|
TOOL_ACTION EE_ACTIONS::saveSymbolCopyAs( TOOL_ACTION_ARGS()
|
||||||
.Name( "eeschema.SymbolLibraryControl.saveSymbolAs" )
|
.Name( "eeschema.SymbolLibraryControl.saveSymbolCopyAs" )
|
||||||
.Scope( AS_GLOBAL )
|
.Scope( AS_GLOBAL )
|
||||||
.FriendlyName( _( "Save As..." ) )
|
.FriendlyName( _( "Save Copy As..." ) )
|
||||||
.Tooltip( _( "Save the current symbol to a different library." ) )
|
.Tooltip( _( "Save a copy of the current symbol to a different library." ) )
|
||||||
.Icon( BITMAPS::save_as ) );
|
.Icon( BITMAPS::save_as ) );
|
||||||
|
|
||||||
TOOL_ACTION EE_ACTIONS::deleteSymbol( TOOL_ACTION_ARGS()
|
TOOL_ACTION EE_ACTIONS::deleteSymbol( TOOL_ACTION_ARGS()
|
||||||
|
|
|
@ -196,7 +196,7 @@ public:
|
||||||
|
|
||||||
// Library management
|
// Library management
|
||||||
static TOOL_ACTION saveLibraryAs;
|
static TOOL_ACTION saveLibraryAs;
|
||||||
static TOOL_ACTION saveSymbolAs;
|
static TOOL_ACTION saveSymbolCopyAs;
|
||||||
static TOOL_ACTION newSymbol;
|
static TOOL_ACTION newSymbol;
|
||||||
static TOOL_ACTION deriveFromExistingSymbol;
|
static TOOL_ACTION deriveFromExistingSymbol;
|
||||||
static TOOL_ACTION editSymbol;
|
static TOOL_ACTION editSymbol;
|
||||||
|
|
|
@ -107,7 +107,7 @@ bool SYMBOL_EDITOR_CONTROL::Init()
|
||||||
ctxMenu.AddSeparator();
|
ctxMenu.AddSeparator();
|
||||||
ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition || libInferredCondition );
|
ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition || libInferredCondition );
|
||||||
ctxMenu.AddItem( EE_ACTIONS::saveLibraryAs, libSelectedCondition );
|
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.AddItem( ACTIONS::revert, symbolSelectedCondition || libInferredCondition );
|
||||||
|
|
||||||
ctxMenu.AddSeparator();
|
ctxMenu.AddSeparator();
|
||||||
|
@ -218,8 +218,8 @@ int SYMBOL_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvt )
|
||||||
editFrame->Save();
|
editFrame->Save();
|
||||||
else if( aEvt.IsAction( &EE_ACTIONS::saveLibraryAs ) )
|
else if( aEvt.IsAction( &EE_ACTIONS::saveLibraryAs ) )
|
||||||
editFrame->SaveLibraryAs();
|
editFrame->SaveLibraryAs();
|
||||||
else if( aEvt.IsAction( &EE_ACTIONS::saveSymbolAs ) )
|
else if( aEvt.IsAction( &EE_ACTIONS::saveSymbolCopyAs ) )
|
||||||
editFrame->SaveSymbolAs();
|
editFrame->SaveSymbolCopyAs();
|
||||||
else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) )
|
else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) )
|
||||||
editFrame->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, ACTIONS::save.MakeEvent() );
|
||||||
Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveLibraryAs.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::Save, ACTIONS::saveAll.MakeEvent() );
|
||||||
Go( &SYMBOL_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
|
Go( &SYMBOL_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue