A better is-modified test.

Fixes https://gitlab.com/kicad/code/kicad/issues/10791
This commit is contained in:
Jeff Young 2022-03-28 21:41:36 +01:00
parent 4ee6f9e138
commit 09ba7468ae
1 changed files with 4 additions and 3 deletions

View File

@ -370,10 +370,11 @@ void SYMBOL_EDIT_FRAME::setupUIConditions()
return IsSymbolEditable() && !IsSymbolAlias();
};
auto libModifiedCondition =
auto symbolModifiedCondition =
[this]( const SELECTION& sel )
{
return m_libMgr->HasModifications();
return m_libMgr->IsSymbolModified( GetTargetLibId().GetLibItemName(),
GetTargetLibId().GetLibNickname() );
};
auto libSelectedCondition =
@ -403,7 +404,7 @@ void SYMBOL_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( ACTIONS::undo, ENABLE( haveSymbolCond && cond.UndoAvailable() ) );
mgr->SetConditions( ACTIONS::redo, ENABLE( haveSymbolCond && cond.RedoAvailable() ) );
mgr->SetConditions( ACTIONS::revert, ENABLE( haveSymbolCond && libModifiedCondition ) );
mgr->SetConditions( ACTIONS::revert, ENABLE( symbolModifiedCondition ) );
mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) );
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );