Don't allow break commands (or labelling cmds) on multiple wire selections.

Fixes https://gitlab.com/kicad/code/kicad/issues/10934
This commit is contained in:
Jeff Young 2022-02-27 20:14:22 +00:00
parent 1c6f3f8f0d
commit d4937f1b3e
1 changed files with 6 additions and 6 deletions

View File

@ -165,11 +165,11 @@ bool EE_SELECTION_TOOL::Init()
SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T,
SCH_SHEET_PIN_T, SCH_PIN_T, EOT };
auto wireSelection = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_LINE_LOCATE_WIRE_T );
auto busSelection = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto wireOrBusSelection = E_C::MoreThan( 0 ) && E_C::OnlyTypes( wireOrBusTypes );
auto connectedSelection = E_C::MoreThan( 0 ) && E_C::OnlyTypes( connectedTypes );
auto sheetSelection = E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T );
auto wireSelection = E_C::Count( 1 ) && E_C::OnlyType( SCH_LINE_LOCATE_WIRE_T );
auto busSelection = E_C::Count( 1 ) && E_C::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto wireOrBusSelection = E_C::Count( 1 ) && E_C::OnlyTypes( wireOrBusTypes );
auto connectedSelection = E_C::Count( 1 ) && E_C::OnlyTypes( connectedTypes );
auto sheetSelection = E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T );
auto schEditSheetPageNumberCondition =
[&] ( const SELECTION& aSel )
@ -219,7 +219,7 @@ bool EE_SELECTION_TOOL::Init()
menu.AddItem( EE_ACTIONS::finishBus, SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus, 100 );
menu.AddSeparator( 200 );
menu.AddItem( EE_ACTIONS::selectConnection, wireOrBusSelection && EE_CONDITIONS::Idle, 250 );
menu.AddItem( EE_ACTIONS::selectConnection, connectedSelection && EE_CONDITIONS::Idle, 250 );
menu.AddItem( EE_ACTIONS::placeJunction, wireOrBusSelection && EE_CONDITIONS::Idle, 250 );
menu.AddItem( EE_ACTIONS::placeLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 250 );
menu.AddItem( EE_ACTIONS::placeGlobalLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 250 );