Remove conditions from common immediate-mode keys

The conditions prevent use in immediate mode for common actions.  While
this makes enable/disable easier in menu items, this fix is a patch
until we refactor the action framework to distinguish between immediate
mode hotkeys that should start without selections and menu items that
need a selection before running.

Fixes https://gitlab.com/kicad/code/kicad/issues/5333
This commit is contained in:
Seth Hillbrand 2021-01-31 14:43:46 -08:00
parent de9da20bda
commit 8567739a7a
4 changed files with 4 additions and 8 deletions

View File

@ -140,7 +140,6 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
editMenu->Add( ACTIONS::paste );
editMenu->Add( ACTIONS::pasteSpecial );
editMenu->Add( ACTIONS::doDelete );
editMenu->Add( ACTIONS::duplicate );
editMenu->AppendSeparator();
editMenu->Add( ACTIONS::selectAll );

View File

@ -389,12 +389,12 @@ void SCH_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( ACTIONS::acceleratedGraphics, CHECK( cond.CanvasType( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) ) );
mgr->SetConditions( ACTIONS::standardGraphics, CHECK( cond.CanvasType( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) ) );
mgr->SetConditions( ACTIONS::cut, ENABLE( SELECTION_CONDITIONS::NotEmpty ) );
mgr->SetConditions( ACTIONS::copy, ENABLE( SELECTION_CONDITIONS::NotEmpty ) );
mgr->SetConditions( ACTIONS::cut, ENABLE( hasElements ) );
mgr->SetConditions( ACTIONS::copy, ENABLE( hasElements ) );
mgr->SetConditions( ACTIONS::paste, ENABLE( SELECTION_CONDITIONS::Idle ) );
mgr->SetConditions( ACTIONS::pasteSpecial, ENABLE( SELECTION_CONDITIONS::Idle ) );
mgr->SetConditions( ACTIONS::doDelete, ENABLE( SELECTION_CONDITIONS::NotEmpty ) );
mgr->SetConditions( ACTIONS::duplicate, ENABLE( SELECTION_CONDITIONS::NotEmpty ) );
mgr->SetConditions( ACTIONS::doDelete, ENABLE( hasElements ) );
mgr->SetConditions( ACTIONS::duplicate, ENABLE( hasElements ) );
mgr->SetConditions( ACTIONS::selectAll, ENABLE( hasElements ) );
mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) );

View File

@ -199,7 +199,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
editMenu->Add( ACTIONS::copy );
editMenu->Add( ACTIONS::paste );
editMenu->Add( ACTIONS::doDelete );
editMenu->Add( ACTIONS::duplicate );
editMenu->AppendSeparator();
editMenu->Add( ACTIONS::selectAll );

View File

@ -657,8 +657,6 @@ void PCB_EDIT_FRAME::setupUIConditions()
ENABLE( SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::Tracks ) ) );
mgr->SetConditions( PCB_ACTIONS::deselectNet,
ENABLE( SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::Tracks ) ) );
mgr->SetConditions( PCB_ACTIONS::selectConnection,
ENABLE( SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::Tracks ) ) );
mgr->SetConditions( PCB_ACTIONS::selectSameSheet,
ENABLE( SELECTION_CONDITIONS::OnlyType( PCB_FOOTPRINT_T ) ) );