From 2fb6f19a84f3dc01604a6c4d51c2b7452c5c0f8e Mon Sep 17 00:00:00 2001 From: Ian McInerney <ian.s.mcinerney@ieee.org> Date: Mon, 26 Jun 2023 23:16:51 +0100 Subject: [PATCH] Separate immediate and delayed action dispatch Using a boolean argument just leads to a lot of trailing booleans in the function calls and is not user friendly. Instead, introduce PostAction() to send an action that runs after the coroutine (equivalent to passing false or the default argument), and leave RunAction as the immediate execution function. --- .../3d_navlib/nl_3d_viewer_plugin_impl.cpp | 2 +- common/dialog_about/dialog_about.cpp | 4 +- common/dialogs/dialog_grid_settings.cpp | 4 +- common/eda_base_frame.cpp | 2 +- common/eda_draw_frame.cpp | 12 +-- common/tool/action_manager.cpp | 4 +- common/tool/action_menu.cpp | 2 +- common/tool/common_tools.cpp | 2 +- cvpcb/cvpcb_mainframe.cpp | 6 +- cvpcb/display_footprints_frame.cpp | 4 +- cvpcb/footprints_listbox.cpp | 2 +- cvpcb/tools/cvpcb_association_tool.cpp | 2 +- cvpcb/tools/cvpcb_control.cpp | 4 +- cvpcb/tools/cvpcb_fpviewer_selection_tool.cpp | 2 +- eeschema/cross-probing.cpp | 8 +- eeschema/dialogs/dialog_erc.cpp | 8 +- eeschema/dialogs/dialog_migrate_buses.cpp | 2 +- eeschema/files-io.cpp | 6 +- eeschema/navlib/nl_schematic_plugin_impl.cpp | 2 +- eeschema/picksymbol.cpp | 2 +- eeschema/sch_edit_frame.cpp | 18 ++-- eeschema/schematic_undo_redo.cpp | 2 +- eeschema/sim/simulator_frame.cpp | 2 +- eeschema/symbol_editor/symbol_edit_frame.cpp | 12 +-- eeschema/symbol_editor/symbol_editor.cpp | 8 +- .../symbol_editor/symbol_editor_undo_redo.cpp | 6 +- eeschema/symbol_viewer_frame.cpp | 6 +- eeschema/tools/ee_selection_tool.cpp | 16 ++-- eeschema/tools/sch_drawing_tools.cpp | 50 +++++------ eeschema/tools/sch_edit_tool.cpp | 50 +++++------ eeschema/tools/sch_editor_control.cpp | 32 +++---- eeschema/tools/sch_line_wire_bus_tool.cpp | 12 +-- eeschema/tools/sch_move_tool.cpp | 12 +-- eeschema/tools/sch_navigate_tool.cpp | 12 +-- eeschema/tools/simulator_control.cpp | 4 +- eeschema/tools/symbol_editor_control.cpp | 6 +- .../tools/symbol_editor_drawing_tools.cpp | 20 ++--- eeschema/tools/symbol_editor_edit_tool.cpp | 34 ++++---- eeschema/tools/symbol_editor_move_tool.cpp | 4 +- eeschema/widgets/hierarchy_pane.cpp | 2 +- eeschema/widgets/search_handlers.cpp | 4 +- eeschema/widgets/symbol_tree_pane.cpp | 2 +- gerbview/dialogs/dialog_print_gerbview.cpp | 2 +- gerbview/files.cpp | 4 +- gerbview/gerbview_frame.cpp | 6 +- gerbview/tools/gerbview_control.cpp | 2 +- gerbview/tools/gerbview_selection_tool.cpp | 2 +- gerbview/widgets/gerbview_layer_widget.cpp | 4 +- include/tool/tool_manager.h | 84 +++++++++++++++---- kicad/kicad_manager_frame.cpp | 12 +-- kicad/project_tree_item.cpp | 18 ++-- pagelayout_editor/pl_editor_frame.cpp | 4 +- pagelayout_editor/pl_editor_undo_redo.cpp | 2 +- pagelayout_editor/tools/pl_drawing_tools.cpp | 18 ++-- pagelayout_editor/tools/pl_edit_tool.cpp | 12 +-- pagelayout_editor/tools/pl_selection_tool.cpp | 4 +- pcbnew/array_creator.cpp | 4 +- pcbnew/board_commit.cpp | 2 +- pcbnew/cross-probing.cpp | 16 ++-- pcbnew/dialogs/dialog_cleanup_graphics.cpp | 2 +- .../dialog_cleanup_tracks_and_vias.cpp | 2 +- pcbnew/dialogs/dialog_drc.cpp | 6 +- pcbnew/dialogs/dialog_find.cpp | 4 +- pcbnew/dialogs/dialog_footprint_checker.cpp | 4 +- pcbnew/dialogs/dialog_global_deletion.cpp | 2 +- pcbnew/dialogs/dialog_group_properties.cpp | 6 +- pcbnew/dialogs/dialog_import_netlist.cpp | 2 +- pcbnew/dialogs/dialog_position_relative.cpp | 2 +- pcbnew/dialogs/dialog_print_pcbnew.cpp | 2 +- pcbnew/dialogs/dialog_update_pcb.cpp | 4 +- pcbnew/edit.cpp | 2 +- pcbnew/edit_track_width.cpp | 2 +- pcbnew/files.cpp | 2 +- pcbnew/footprint_edit_frame.cpp | 6 +- pcbnew/footprint_editor_utils.cpp | 4 +- pcbnew/footprint_libraries_utils.cpp | 6 +- pcbnew/footprint_viewer_frame.cpp | 8 +- pcbnew/footprint_wizard_frame.cpp | 8 +- pcbnew/microwave/microwave_inductor.cpp | 2 +- pcbnew/navlib/nl_pcbnew_plugin_impl.cpp | 4 +- pcbnew/netlist_reader/netlist.cpp | 4 +- pcbnew/pcb_edit_frame.cpp | 8 +- pcbnew/router/length_tuner_tool.cpp | 2 +- pcbnew/router/router_tool.cpp | 26 +++--- pcbnew/tools/board_editor_control.cpp | 40 ++++----- pcbnew/tools/board_inspection_tool.cpp | 12 +-- pcbnew/tools/drawing_stackup_table_tool.cpp | 2 +- pcbnew/tools/drawing_tool.cpp | 66 +++++++-------- pcbnew/tools/drc_tool.cpp | 2 +- pcbnew/tools/edit_tool.cpp | 48 +++++------ pcbnew/tools/edit_tool_move_fct.cpp | 12 +-- pcbnew/tools/footprint_editor_control.cpp | 2 +- pcbnew/tools/group_tool.cpp | 12 +-- pcbnew/tools/pad_tool.cpp | 14 ++-- pcbnew/tools/pcb_control.cpp | 12 +-- pcbnew/tools/pcb_point_editor.cpp | 2 +- pcbnew/tools/pcb_selection_tool.cpp | 22 ++--- pcbnew/tools/pcb_tool_base.cpp | 4 +- pcbnew/tools/position_relative_tool.cpp | 6 +- pcbnew/tools/zone_create_helper.cpp | 10 +-- pcbnew/widgets/appearance_controls.cpp | 15 ++-- pcbnew/widgets/search_handlers.cpp | 14 ++-- 102 files changed, 526 insertions(+), 479 deletions(-) diff --git a/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp b/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp index 51816af0c3..1c4d1b6f42 100644 --- a/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp +++ b/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp @@ -591,7 +591,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId ) if( runAction ) { - tool_manager->RunAction( *context, true ); + tool_manager->RunAction( *context ); m_canvas->Request_refresh(); } } diff --git a/common/dialog_about/dialog_about.cpp b/common/dialog_about/dialog_about.cpp index 4a7fbcd902..1ddb1090c9 100644 --- a/common/dialog_about/dialog_about.cpp +++ b/common/dialog_about/dialog_about.cpp @@ -478,14 +478,14 @@ void DIALOG_ABOUT::onCopyVersionInfo( wxCommandEvent& event ) void DIALOG_ABOUT::onDonateClick( wxCommandEvent& event ) { if( TOOL_MANAGER* mgr = static_cast<EDA_BASE_FRAME*>( GetParent() )->GetToolManager() ) - mgr->RunAction( "common.SuiteControl.donate", true ); + mgr->RunAction( "common.SuiteControl.donate" ); } void DIALOG_ABOUT::onReportBug( wxCommandEvent& event ) { if( TOOL_MANAGER* mgr = static_cast<EDA_BASE_FRAME*>( GetParent() )->GetToolManager() ) - mgr->RunAction( "common.SuiteControl.reportBug", true ); + mgr->RunAction( "common.SuiteControl.reportBug" ); } diff --git a/common/dialogs/dialog_grid_settings.cpp b/common/dialogs/dialog_grid_settings.cpp index d2da138c97..724fa303c3 100644 --- a/common/dialogs/dialog_grid_settings.cpp +++ b/common/dialogs/dialog_grid_settings.cpp @@ -130,8 +130,8 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow() mgr->ResetTools( TOOL_BASE::REDRAW ); // Notify GAL - mgr->RunAction( ACTIONS::gridPreset, true, gridCfg.last_size_idx ); - mgr->RunAction( ACTIONS::gridSetOrigin, true, new VECTOR2D( m_parent->GetGridOrigin() ) ); + mgr->RunAction( ACTIONS::gridPreset, gridCfg.last_size_idx ); + mgr->RunAction( ACTIONS::gridSetOrigin, new VECTOR2D( m_parent->GetGridOrigin() ) ); m_parent->UpdateGridSelectBox(); diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index e510cfb323..a2c0540abe 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -1260,7 +1260,7 @@ void EDA_BASE_FRAME::DoWithAcceptedFiles() for( const wxFileName& file : m_AcceptedFiles ) { wxString fn = file.GetFullPath(); - m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( file.GetExt() ), true, &fn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( file.GetExt() ), &fn ); } } diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index 1db8d61cd3..b012776c55 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -276,7 +276,7 @@ void EDA_DRAW_FRAME::unitsChangeRefresh() { // Notify all tools the units have changed if( m_toolManager ) - m_toolManager->RunAction( ACTIONS::updateUnits, true ); + m_toolManager->RunAction( ACTIONS::updateUnits ); UpdateStatusBar(); UpdateMsgPanel(); @@ -347,7 +347,7 @@ void EDA_DRAW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars // Notify all tools the preferences have changed if( m_toolManager ) - m_toolManager->RunAction( ACTIONS::updatePreferences, true ); + m_toolManager->RunAction( ACTIONS::updatePreferences ); } @@ -465,11 +465,11 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) // (Only matters on some versions of GTK.) wxSafeYield(); - m_toolManager->RunAction( ACTIONS::gridProperties, true ); + m_toolManager->RunAction( ACTIONS::gridProperties ); } else { - m_toolManager->RunAction( ACTIONS::gridPreset, true, idx ); + m_toolManager->RunAction( ACTIONS::gridPreset, idx ); } UpdateStatusBar(); @@ -556,7 +556,7 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event ) if( id < 0 || !( id < (int)m_zoomSelectBox->GetCount() ) ) return; - m_toolManager->RunAction( ACTIONS::zoomPreset, true, id ); + m_toolManager->RunAction( ACTIONS::zoomPreset, id ); UpdateStatusBar(); m_canvas->Refresh(); // Needed on Windows because clicking on m_zoomSelectBox remove the focus from m_canvas @@ -913,7 +913,7 @@ void EDA_DRAW_FRAME::HardRedraw() void EDA_DRAW_FRAME::Zoom_Automatique( bool aWarpPointer ) { - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); } diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp index 22b6c76684..9092bc28f9 100644 --- a/common/tool/action_manager.cpp +++ b/common/tool/action_manager.cpp @@ -205,7 +205,7 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const KeyNameFromKeyCode( aHotKey ) ); if( runAction ) - return m_toolMgr->RunAction( *context, true ); + return m_toolMgr->RunAction( *context ); } else if( !global.empty() ) { @@ -222,7 +222,7 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const act->GetName(), KeyNameFromKeyCode( aHotKey ) ); - if( runAction && m_toolMgr->RunAction( *act, true ) ) + if( runAction && m_toolMgr->RunAction( *act ) ) return true; } } diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index 5245a53b5a..20ee35d807 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -405,7 +405,7 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) if( type == wxEVT_MENU_OPEN ) { if( m_dirty && m_tool ) - getToolManager()->RunAction<ACTION_MENU*>( ACTIONS::updateMenu, true, this ); + getToolManager()->RunAction<ACTION_MENU*>( ACTIONS::updateMenu, this ); wxMenu* parent = dynamic_cast<wxMenu*>( GetParent() ); diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index 5f73cf044d..5cb3ec82f2 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -163,7 +163,7 @@ int COMMON_TOOLS::CursorControl( const TOOL_EVENT& aEvent ) } getViewControls()->SetCursorPosition( cursor, true, true, type ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); return 0; } diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index d0b7ae1a66..6981b2e176 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -328,7 +328,7 @@ void CVPCB_MAINFRAME::setupEventHandlers() [this]( wxCommandEvent& ) { // saveAssociations must be run immediately - GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToFile, true ); + GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToFile ); } ); // Connect the handlers for the ok/cancel buttons @@ -336,7 +336,7 @@ void CVPCB_MAINFRAME::setupEventHandlers() [this]( wxCommandEvent& ) { // saveAssociations must be run immediately, before running Close( true ) - GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToSchematic, true ); + GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToSchematic ); Close( true ); }, wxID_OK ); Bind( wxEVT_BUTTON, @@ -503,7 +503,7 @@ void CVPCB_MAINFRAME::updateFootprintViewerOnIdle( wxIdleEvent& aEvent ) // If the footprint view window is displayed, update the footprint. if( GetFootprintViewerFrame() ) - GetToolManager()->RunAction( CVPCB_ACTIONS::showFootprintViewer, true ); + GetToolManager()->RunAction( CVPCB_ACTIONS::showFootprintViewer ); DisplayStatus(); diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index d764e950dc..621c5dfb16 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -572,9 +572,9 @@ void DISPLAY_FOOTPRINTS_FRAME::updateView() wxAuiToolBarItem* toolOpt = m_mainToolBar->FindTool( ID_CVPCB_FPVIEWER_AUTOZOOM_TOOL ); if( toolOpt->GetState() & wxAUI_BUTTON_STATE_CHECKED ) - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); else - m_toolManager->RunAction( ACTIONS::centerContents, true ); + m_toolManager->RunAction( ACTIONS::centerContents ); UpdateMsgPanel(); } diff --git a/cvpcb/footprints_listbox.cpp b/cvpcb/footprints_listbox.cpp index 8a865f39d3..3dbd0b81dd 100644 --- a/cvpcb/footprints_listbox.cpp +++ b/cvpcb/footprints_listbox.cpp @@ -205,7 +205,7 @@ void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event ) void FOOTPRINTS_LISTBOX::OnLeftDClick( wxListEvent& event ) { - GetParent()->GetToolManager()->RunAction( CVPCB_ACTIONS::associate, true ); + GetParent()->GetToolManager()->RunAction( CVPCB_ACTIONS::associate ); } diff --git a/cvpcb/tools/cvpcb_association_tool.cpp b/cvpcb/tools/cvpcb_association_tool.cpp index 28e1ef678e..9c08e1d2d7 100644 --- a/cvpcb/tools/cvpcb_association_tool.cpp +++ b/cvpcb/tools/cvpcb_association_tool.cpp @@ -221,7 +221,7 @@ int CVPCB_ASSOCIATION_TOOL::Associate( const TOOL_EVENT& aEvent ) } // Move to the next not associated component - m_toolMgr->RunAction( CVPCB_ACTIONS::gotoNextNA ); + m_toolMgr->PostAction( CVPCB_ACTIONS::gotoNextNA ); return 0; } diff --git a/cvpcb/tools/cvpcb_control.cpp b/cvpcb/tools/cvpcb_control.cpp index 2353074612..da0938e857 100644 --- a/cvpcb/tools/cvpcb_control.cpp +++ b/cvpcb/tools/cvpcb_control.cpp @@ -70,13 +70,13 @@ int CVPCB_CONTROL::Main( const TOOL_EVENT& aEvent ) { // The right arrow moves focus to the focusable object to the right case WXK_RIGHT: - m_toolMgr->RunAction( CVPCB_ACTIONS::changeFocusRight ); + m_toolMgr->PostAction( CVPCB_ACTIONS::changeFocusRight ); handled = true; break; // The left arrow moves focus to the focusable object to the left case WXK_LEFT: - m_toolMgr->RunAction( CVPCB_ACTIONS::changeFocusLeft ); + m_toolMgr->PostAction( CVPCB_ACTIONS::changeFocusLeft ); handled = true; break; diff --git a/cvpcb/tools/cvpcb_fpviewer_selection_tool.cpp b/cvpcb/tools/cvpcb_fpviewer_selection_tool.cpp index 72f8051039..7404175d45 100644 --- a/cvpcb/tools/cvpcb_fpviewer_selection_tool.cpp +++ b/cvpcb/tools/cvpcb_fpviewer_selection_tool.cpp @@ -64,7 +64,7 @@ int CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) } else if( evt->IsDblClick( BUT_MIDDLE ) ) { - m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitScreen ); } else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE ) { diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 91a58e5735..451cf3e027 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -215,12 +215,12 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) if( strcmp( idcmd, "$CONFIG" ) == 0 ) { - GetToolManager()->RunAction( ACTIONS::showSymbolLibTable, true ); + GetToolManager()->RunAction( ACTIONS::showSymbolLibTable ); return; } else if( strcmp( idcmd, "$ERC" ) == 0 ) { - GetToolManager()->RunAction( EE_ACTIONS::runERC, true ); + GetToolManager()->RunAction( EE_ACTIONS::runERC ); return; } else if( strcmp( idcmd, "$NET:" ) == 0 ) @@ -235,7 +235,7 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) else m_highlightedConn = wxEmptyString; - GetToolManager()->RunAction( EE_ACTIONS::updateNetHighlighting, true ); + GetToolManager()->RunAction( EE_ACTIONS::updateNetHighlighting ); SetStatusText( _( "Selected net:" ) + wxS( " " ) + UnescapeString( netName ) ); return; @@ -970,7 +970,7 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) break; case MAIL_SCH_UPDATE: - m_toolManager->RunAction( ACTIONS::updateSchematicFromPcb, true ); + m_toolManager->RunAction( ACTIONS::updateSchematicFromPcb ); break; case MAIL_RELOAD_LIB: diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 0e9a3e4ee6..8b8d51019b 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -276,7 +276,7 @@ void DIALOG_ERC::OnDeleteOneClick( wxCommandEvent& aEvent ) if( m_notebook->GetSelection() == 0 ) { // Clear the selection. It may be the selected ERC marker. - m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); m_markerTreeModel->DeleteCurrentItem( true ); @@ -632,8 +632,8 @@ void DIALOG_ERC::OnERCItemSelected( wxDataViewEvent& aEvent ) if( !sheet.empty() && sheet != m_parent->GetCurrentSheet() ) { - m_parent->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); - m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_parent->GetToolManager()->RunAction( ACTIONS::cancelInteractive ); + m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); m_parent->SetCurrentSheet( sheet ); m_parent->DisplayCurrentSheet(); @@ -951,7 +951,7 @@ void DIALOG_ERC::OnSeverity( wxCommandEvent& aEvent ) void DIALOG_ERC::deleteAllMarkers( bool aIncludeExclusions ) { // Clear current selection list to avoid selection of deleted items - m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); m_markerTreeModel->DeleteItems( false, aIncludeExclusions, false ); diff --git a/eeschema/dialogs/dialog_migrate_buses.cpp b/eeschema/dialogs/dialog_migrate_buses.cpp index b27cdf9a80..712576cb28 100644 --- a/eeschema/dialogs/dialog_migrate_buses.cpp +++ b/eeschema/dialogs/dialog_migrate_buses.cpp @@ -68,7 +68,7 @@ DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES( SCH_EDIT_FRAME* aParent ) loadGraphData(); updateUi(); - aParent->GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + aParent->GetToolManager()->RunAction( ACTIONS::zoomFitScreen ); } diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 622f705201..6f7dd6ab95 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -286,7 +286,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in // Do not leave g_RootSheet == NULL because it is expected to be // a valid sheet. Therefore create a dummy empty root sheet and screen. CreateScreens(); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); msg.Printf( _( "Failed to load '%s'." ), fullFileName ); SetMsgPanel( wxEmptyString, msg ); @@ -1287,7 +1287,7 @@ void SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType ) // Do not leave g_RootSheet == NULL because it is expected to be // a valid sheet. Therefore create a dummy empty root sheet and screen. CreateScreens(); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); wxString msg = wxString::Format( _( "Error loading schematic '%s'." ), aFileName ); DisplayErrorMessage( this, msg, ioe.What() ); @@ -1298,7 +1298,7 @@ void SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType ) catch( const std::exception& exc ) { CreateScreens(); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); wxString msg = wxString::Format( _( "Unhandled exception occurred loading schematic " "'%s'." ), aFileName ); diff --git a/eeschema/navlib/nl_schematic_plugin_impl.cpp b/eeschema/navlib/nl_schematic_plugin_impl.cpp index c661c778d2..56284b76e4 100644 --- a/eeschema/navlib/nl_schematic_plugin_impl.cpp +++ b/eeschema/navlib/nl_schematic_plugin_impl.cpp @@ -478,7 +478,7 @@ long NL_SCHEMATIC_PLUGIN_IMPL::SetActiveCommand( std::string commandId ) if( runAction ) { - tool_manager->RunAction( *context, true ); + tool_manager->RunAction( *context ); } } else diff --git a/eeschema/picksymbol.cpp b/eeschema/picksymbol.cpp index d64031266d..b6532962d0 100644 --- a/eeschema/picksymbol.cpp +++ b/eeschema/picksymbol.cpp @@ -305,7 +305,7 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_SYMBOL* aSymbol ) // If selected make sure all the now-included pins are selected if( aSymbol->IsSelected() ) - m_toolManager->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, true, aSymbol ); + m_toolManager->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, aSymbol ); UpdateItem( aSymbol, false, true ); commit.Push( _( "Convert Symbol" ) ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index db318c192d..8d78980ef4 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -479,7 +479,7 @@ void SCH_EDIT_FRAME::setupTools() m_toolManager->InitTools(); // Run the selection tool, it is supposed to be always active - m_toolManager->RunAction( EE_ACTIONS::selectionActivate ); + m_toolManager->PostAction( EE_ACTIONS::selectionActivate ); GetCanvas()->SetEventDispatcher( m_toolDispatcher ); } @@ -885,7 +885,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent ) // Note this this will commit *some* pending changes. For instance, the EE_POINT_EDITOR // will cancel any drag currently in progress, but commit all changes from previous drags. if( m_toolManager ) - m_toolManager->RunAction( ACTIONS::cancelInteractive, true ); + m_toolManager->RunAction( ACTIONS::cancelInteractive ); // Shutdown blocks must be determined and vetoed as early as possible if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION @@ -1256,7 +1256,7 @@ void SCH_EDIT_FRAME::OnFindDialogClose() m_findReplaceDialog->Destroy(); m_findReplaceDialog = nullptr; - m_toolManager->RunAction( ACTIONS::updateFind, true ); + m_toolManager->RunAction( ACTIONS::updateFind ); } @@ -1664,7 +1664,7 @@ void SCH_EDIT_FRAME::updateTitle() void SCH_EDIT_FRAME::initScreenZoom() { - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); GetScreen()->m_zoomInitialized = true; } @@ -1965,7 +1965,7 @@ void SCH_EDIT_FRAME::UpdateNetHighlightStatus() void SCH_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen ) { if( m_toolManager ) - m_toolManager->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolManager->RunAction( EE_ACTIONS::clearSelection ); SCH_BASE_FRAME::SetScreen( aScreen ); GetCanvas()->DisplaySheet( static_cast<SCH_SCREEN*>( aScreen ) ); @@ -2067,7 +2067,7 @@ void SCH_EDIT_FRAME::onSize( wxSizeEvent& aEvent ) // We only need this until the frame is done resizing and the final client size is // established. Unbind( wxEVT_SIZE, &SCH_EDIT_FRAME::onSize, this ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen ); } // Skip() is called in the base class. @@ -2149,13 +2149,13 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() { wxCHECK( m_toolManager, /* void */ ); - m_toolManager->RunAction( ACTIONS::cancelInteractive, true ); - m_toolManager->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolManager->RunAction( ACTIONS::cancelInteractive ); + m_toolManager->RunAction( EE_ACTIONS::clearSelection ); SCH_SCREEN* screen = GetCurrentSheet().LastScreen(); wxCHECK( screen, /* void */ ); - m_toolManager->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolManager->RunAction( EE_ACTIONS::clearSelection ); SCH_BASE_FRAME::SetScreen( screen ); diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp index 5f868858c4..8d21cef6ce 100644 --- a/eeschema/schematic_undo_redo.cpp +++ b/eeschema/schematic_undo_redo.cpp @@ -287,7 +287,7 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) if( eda_item->Type() == SCH_SHEET_T ) { if( static_cast<SCH_SHEET*>( eda_item )->GetScreen() == GetScreen() ) - GetToolManager()->RunAction( EE_ACTIONS::leaveSheet ); + GetToolManager()->PostAction( EE_ACTIONS::leaveSheet ); } SCH_ITEM* schItem = static_cast<SCH_ITEM*>( eda_item ); diff --git a/eeschema/sim/simulator_frame.cpp b/eeschema/sim/simulator_frame.cpp index 513b60e9d6..38f607b71a 100644 --- a/eeschema/sim/simulator_frame.cpp +++ b/eeschema/sim/simulator_frame.cpp @@ -613,7 +613,7 @@ void SIMULATOR_FRAME::doCloseWindow() m_simulator->Clean(); // Cancel a running simProbe or simTune tool - m_schematicFrame->GetToolManager()->RunAction( ACTIONS::cancelInteractive ); + m_schematicFrame->GetToolManager()->PostAction( ACTIONS::cancelInteractive ); SaveSettings( config() ); diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index ad9d45a7e2..226beaa23f 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -223,7 +223,7 @@ SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : bbox.SetSize( max_size_x, max_size_y ); GetCanvas()->GetView()->SetBoundary( bbox ); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); m_acceptedExts.emplace( KiCadSymbolLibFileExtension, &ACTIONS::ddAddLibrary ); DragAcceptFiles( true ); @@ -660,8 +660,8 @@ void SYMBOL_EDIT_FRAME::OnSelectUnit( wxCommandEvent& event ) if( ( i == wxNOT_FOUND ) || ( ( i + 1 ) == m_unit ) ) return; - m_toolManager->RunAction( ACTIONS::cancelInteractive, true ); - m_toolManager->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolManager->RunAction( ACTIONS::cancelInteractive ); + m_toolManager->RunAction( EE_ACTIONS::clearSelection ); m_unit = i + 1; @@ -717,7 +717,7 @@ wxString SYMBOL_EDIT_FRAME::SetCurLib( const wxString& aLibNickname ) void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom ) { - m_toolManager->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolManager->RunAction( EE_ACTIONS::clearSelection ); GetCanvas()->GetView()->Clear(); delete m_symbol; @@ -748,7 +748,7 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom ) GetCanvas()->GetView()->ClearHiddenFlags(); if( aUpdateZoom ) - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); GetCanvas()->Refresh(); @@ -1152,7 +1152,7 @@ void SYMBOL_EDIT_FRAME::emptyScreen() SetCurSymbol( nullptr, false ); SetScreen( m_dummyScreen ); ClearUndoRedoList(); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); Refresh(); } diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index e55540e094..217d200e0e 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -241,7 +241,7 @@ bool SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib( const wxString& aAliasName, in m_SyncPinEdit = GetCurSymbol()->IsMulti() && !GetCurSymbol()->UnitsLocked(); ClearUndoRedoList(); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); SetShowDeMorgan( GetCurSymbol()->Flatten()->HasConversion() ); if( aUnit > 0 ) @@ -265,7 +265,7 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux( LIB_SYMBOL* aEntry, const wxStr return false; } - m_toolManager->RunAction( ACTIONS::cancelInteractive, true ); + m_toolManager->RunAction( ACTIONS::cancelInteractive ); // Symbols from the schematic are edited in place and not managed by the library manager. if( IsSymbolFromSchematic() ) @@ -336,7 +336,7 @@ void SYMBOL_EDIT_FRAME::SaveAll() void SYMBOL_EDIT_FRAME::CreateNewSymbol( const wxString& inheritFromSymbolName ) { - m_toolManager->RunAction( ACTIONS::cancelInteractive, true ); + m_toolManager->RunAction( ACTIONS::cancelInteractive ); wxArrayString rootSymbols; wxString lib = getTargetLib(); @@ -1032,7 +1032,7 @@ bool SYMBOL_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile ) SCH_IO_MGR::SCH_FILE_T fileType = SCH_IO_MGR::SCH_FILE_T::SCH_KICAD; PROJECT& prj = Prj(); - m_toolManager->RunAction( ACTIONS::cancelInteractive, true ); + m_toolManager->RunAction( ACTIONS::cancelInteractive ); if( !aNewFile && ( aLibrary.empty() || !prj.SchSymbolLibTable()->HasLibrary( aLibrary ) ) ) { diff --git a/eeschema/symbol_editor/symbol_editor_undo_redo.cpp b/eeschema/symbol_editor/symbol_editor_undo_redo.cpp index 4ac0a12e58..ca517040bb 100644 --- a/eeschema/symbol_editor/symbol_editor_undo_redo.cpp +++ b/eeschema/symbol_editor/symbol_editor_undo_redo.cpp @@ -62,7 +62,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList() if( GetRedoCommandCount() <= 0 ) return; - m_toolManager->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolManager->RunAction( EE_ACTIONS::clearSelection ); // Load the last redo entry PICKED_ITEMS_LIST* redoCommand = PopCommandFromRedoList(); @@ -115,7 +115,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList() if( GetUndoCommandCount() <= 0 ) return; - m_toolManager->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolManager->RunAction( EE_ACTIONS::clearSelection ); // Load the last undo entry PICKED_ITEMS_LIST* undoCommand = PopCommandFromUndoList(); @@ -165,7 +165,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList() void SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo() { - m_toolManager->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolManager->RunAction( EE_ACTIONS::clearSelection ); // Load the last undo entry PICKED_ITEMS_LIST* undoCommand = PopCommandFromUndoList(); diff --git a/eeschema/symbol_viewer_frame.cpp b/eeschema/symbol_viewer_frame.cpp index 1f56a0c1e9..2043ed3313 100644 --- a/eeschema/symbol_viewer_frame.cpp +++ b/eeschema/symbol_viewer_frame.cpp @@ -266,7 +266,7 @@ SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAM bbox.SetOrigin( -max_size_x / 2, -max_size_y / 2 ); bbox.SetSize( max_size_x, max_size_y ); GetCanvas()->GetView()->SetBoundary( bbox ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen ); // If a symbol was previously selected in m_symbolList from a previous run, show it wxString symbName = m_symbolList->GetStringSelection(); @@ -492,7 +492,7 @@ void SYMBOL_VIEWER_FRAME::updatePreviewSymbol() AppendMsgPanel( _( "Keywords" ), m_previewItem->GetKeyWords() ); } - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); GetCanvas()->Refresh(); } @@ -921,7 +921,7 @@ void SYMBOL_VIEWER_FRAME::SetSelectedSymbol( const wxString& aSymbolName ) void SYMBOL_VIEWER_FRAME::DClickOnSymbolList( wxCommandEvent& event ) { - m_toolManager->RunAction( EE_ACTIONS::addSymbolToSchematic, true ); + m_toolManager->RunAction( EE_ACTIONS::addSymbolToSchematic ); } diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 73566099eb..14df6aafb9 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -483,9 +483,9 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) EDA_ITEM* item = m_selection.Front(); if( item && item->Type() == SCH_SHEET_T ) - m_toolMgr->RunAction( EE_ACTIONS::enterSheet ); + m_toolMgr->PostAction( EE_ACTIONS::enterSheet ); else - m_toolMgr->RunAction( EE_ACTIONS::properties ); + m_toolMgr->PostAction( EE_ACTIONS::properties ); } else if( evt->IsDblClick( BUT_MIDDLE ) ) { @@ -493,9 +493,9 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) // Middle double click? Do zoom to fit or zoom to objects if( evt->Modifier( MD_CTRL ) ) // Is CTRL key down? - m_toolMgr->RunAction( ACTIONS::zoomFitObjects, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitObjects ); else - m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitScreen ); } else if( evt->IsDrag( BUT_LEFT ) ) { @@ -561,11 +561,11 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) } else if( evt->IsMouseDown( BUT_AUX1 ) ) { - m_toolMgr->RunAction( EE_ACTIONS::navigateBack, true ); + m_toolMgr->RunAction( EE_ACTIONS::navigateBack ); } else if( evt->IsMouseDown( BUT_AUX2 ) ) { - m_toolMgr->RunAction( EE_ACTIONS::navigateForward, true ); + m_toolMgr->RunAction( EE_ACTIONS::navigateForward ); } else if( evt->Category() == TC_COMMAND && evt->Action() == TA_CHOICE_MENU_CHOICE ) { @@ -585,7 +585,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) && *evt->GetCommandId() <= ID_POPUP_SCH_UNFOLD_BUS_END ) { wxString* net = new wxString( *evt->Parameter<wxString*>() ); - m_toolMgr->RunAction<wxString*>( EE_ACTIONS::unfoldBus, true, net ); + m_toolMgr->RunAction<wxString*>( EE_ACTIONS::unfoldBus, net ); } } else if( evt->IsCancelInteractive() ) @@ -907,7 +907,7 @@ bool EE_SELECTION_TOOL::selectPoint( EE_COLLECTOR& aCollector, const VECTOR2I& a // Try to call selectionMenu via RunAction() to avoid event-loop contention // But it we cannot handle the event, then we don't have an active tool loop, so // handle it directly. - if( !m_toolMgr->RunAction<COLLECTOR*>( EE_ACTIONS::selectionMenu, true, &aCollector ) ) + if( !m_toolMgr->RunAction<COLLECTOR*>( EE_ACTIONS::selectionMenu, &aCollector ) ) { if( !doSelectionMenu( &aCollector ) ) aCollector.m_MenuCancelled = true; diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 33cf35b0c3..9fd35c5f1b 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -153,7 +153,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) { m_frame->SaveCopyForRepeatItem( aSymbol ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_selectionTool->AddItemToSel( aSymbol ); aSymbol->SetFlags( IS_NEW | IS_MOVING ); @@ -163,7 +163,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) // Set IS_MOVING again, as AddItemToCommitAndScreen() will have cleared it. aSymbol->SetFlags( IS_MOVING ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); }; auto setCursor = @@ -176,7 +176,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) auto cleanup = [&]() { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_view->ClearPreview(); delete symbol; symbol = nullptr; @@ -299,7 +299,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) { if( !symbol ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); // Pick the symbol to be placed bool footprintPreviews = m_frame->eeconfig()->m_Appearance.footprint_preview; @@ -422,7 +422,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) if( symbol ) { m_frame->SelectUnit( symbol, unit ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } } } @@ -486,7 +486,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) REENTRANCY_GUARD guard( &m_inPlaceImage ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); // Add all the drawable symbols to preview if( image ) @@ -510,7 +510,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_view->ClearPreview(); m_view->RecacheAllItems(); delete image; @@ -528,7 +528,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) // Prime the pump if( image ) { - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else if( aEvent.HasPosition() ) { @@ -601,7 +601,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) { if( !image ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); wxFileDialog dlg( m_frame, _( "Choose Image" ), m_mruPath, wxEmptyString, _( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(), @@ -658,7 +658,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) commit.Push( _( "Add Image" ) ); image = nullptr; - m_toolMgr->RunAction( ACTIONS::activatePointEditor ); + m_toolMgr->PostAction( ACTIONS::activatePointEditor ); m_view->ClearPreview(); @@ -766,7 +766,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) return 0; } - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); cursorPos = aEvent.HasPosition() ? aEvent.Position() : controls->GetMousePosition(); @@ -793,7 +793,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) if( aEvent.HasPosition() && type != SCH_SHEET_PIN_T ) m_toolMgr->PrimeTool( aEvent.Position() ); else - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); // Main loop: keep receiving events while( TOOL_EVENT* evt = Wait() ) @@ -1161,7 +1161,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) if( isSheetPin ) sheet = dynamic_cast<SCH_SHEET*>( m_selectionTool->GetSelection().Front() ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -1199,7 +1199,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) auto cleanup = [&]() { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_view->ClearPreview(); delete item; item = nullptr; @@ -1289,7 +1289,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) // First click creates... if( !item ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( isText ) { @@ -1380,7 +1380,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) if( item->Type() != SCH_SHEET_PIN_T ) m_selectionTool->AddItemToSel( item ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); // update the cursor so it looks correct before another event setCursor(); @@ -1509,7 +1509,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) // gets whacked. m_toolMgr->DeactivateTool(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -1522,7 +1522,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_view->ClearPreview(); delete item; item = nullptr; @@ -1591,7 +1591,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } else if( evt->IsClick( BUT_LEFT ) && !item ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( isTextBox ) { @@ -1677,7 +1677,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) item = nullptr; m_view->ClearPreview(); - m_toolMgr->RunAction( ACTIONS::activatePointEditor ); + m_toolMgr->PostAction( ACTIONS::activatePointEditor ); } } else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) ) @@ -1689,7 +1689,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } else if( evt->IsDblClick( BUT_LEFT ) && !item ) { - m_toolMgr->RunAction( EE_ACTIONS::properties, true ); + m_toolMgr->RunAction( EE_ACTIONS::properties ); } else if( evt->IsClick( BUT_RIGHT ) ) { @@ -1729,7 +1729,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) REENTRANCY_GUARD guard( &m_inDrawSheet ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -1742,7 +1742,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_view->ClearPreview(); delete sheet; sheet = nullptr; @@ -1831,12 +1831,12 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) } else if( evt->IsDblClick( BUT_LEFT ) ) { - m_toolMgr->RunAction( EE_ACTIONS::enterSheet, false ); + m_toolMgr->PostAction( EE_ACTIONS::enterSheet ); break; } } - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); sheet = new SCH_SHEET( m_frame->GetCurrentSheet().Last(), cursorPos ); sheet->SetFlags( IS_NEW | IS_MOVING ); diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index fe809baf74..6494bdd40f 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -909,14 +909,14 @@ int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) if( moving ) { - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else { EE_SELECTION selectionCopy = selection; if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); SCH_LINE_WIRE_BUS_TOOL* lwbTool = m_toolMgr->GetTool<SCH_LINE_WIRE_BUS_TOOL>(); lwbTool->TrimOverLappingWires( commit, &selectionCopy ); @@ -1111,7 +1111,7 @@ int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) EE_SELECTION selectionCopy = selection; if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( connections ) { @@ -1213,12 +1213,12 @@ int SCH_EDIT_TOOL::Swap( const TOOL_EVENT& aEvent ) if( isMoving ) { - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else { if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( connections ) m_frame->TestDanglingEnds(); @@ -1237,7 +1237,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) if( sourceItems.empty() ) return 0; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); SCH_COMMIT commit( m_toolMgr ); EE_SELECTION newItems; @@ -1267,7 +1267,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) schIUScale.MilsToIU( cfg->m_Drawing.default_repeat_offset_y ) ) ); } - m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, true, newItem ); + m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, newItem ); newItem->SetFlags( IS_NEW ); m_frame->AddToScreen( newItem, m_frame->GetScreen() ); commit.Added( newItem, m_frame->GetScreen() ); @@ -1288,7 +1288,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) annotateStartNum, false, false, reporter ); } - m_toolMgr->RunAction( EE_ACTIONS::move, true, &commit ); + m_toolMgr->RunAction( EE_ACTIONS::move, &commit ); while( m_toolMgr->GetTool<SCH_MOVE_TOOL>()->IsToolActive() ) { @@ -1360,7 +1360,7 @@ int SCH_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent ) return 0; // Don't leave a freed pointer in the selection - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); for( EDA_ITEM* item : items ) item->ClearFlags( STRUCT_DELETED ); @@ -1439,7 +1439,7 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) { PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_pickerItem = nullptr; // Deactivate other tools; particularly important if another PICKER is currently running @@ -1456,7 +1456,7 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>(); selectionTool->UnbrightenItem( m_pickerItem ); selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ ); - m_toolMgr->RunAction( ACTIONS::doDelete, true ); + m_toolMgr->RunAction( ACTIONS::doDelete ); m_pickerItem = nullptr; } @@ -1494,10 +1494,10 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) m_toolMgr->GetTool<EE_SELECTION_TOOL>()->UnbrightenItem( m_pickerItem ); // Wake the selection tool after exiting to ensure the cursor gets updated - m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false ); + m_toolMgr->PostAction( EE_ACTIONS::selectionActivate ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } @@ -1587,7 +1587,7 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent ) } if( clearSelection ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); return 0; } @@ -1627,7 +1627,7 @@ int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent ) if( moving ) { - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else { @@ -1635,7 +1635,7 @@ int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent ) commit.Push( _( "Autoplace Fields" ) ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); } return 0; @@ -1693,10 +1693,10 @@ int SCH_EDIT_TOOL::ConvertDeMorgan( const TOOL_EVENT& aEvent ) m_frame->ConvertPart( symbol ); if( symbol->IsNew() ) - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); return 0; } @@ -1715,7 +1715,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) VECTOR2D cursorPos = getViewControls()->GetCursorPosition( false ); if( ds && ds->HitTestDrawingSheetItems( getView(), cursorPos ) ) - m_toolMgr->RunAction( ACTIONS::pageSettings ); + m_toolMgr->PostAction( ACTIONS::pageSettings ); } return 0; @@ -2003,7 +2003,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) updateItem( curr_item, true ); if( clearSelection ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); return 0; } @@ -2312,7 +2312,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) } if( selected ) - m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::removeItemFromSel, true, item ); + m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::removeItemFromSel, item ); SCH_COMMIT commit( m_toolMgr ); @@ -2328,7 +2328,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) commit.Push( _( "Change Item Type" ) ); if( selected ) - m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, true, newtext ); + m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, newtext ); // Otherwise, pointer is owned by the undo stack if( item->IsNew() ) @@ -2349,7 +2349,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) } if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); return 0; } @@ -2410,7 +2410,7 @@ int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent ) m_frame->TestDanglingEnds(); m_frame->GetCanvas()->Refresh(); - m_toolMgr->RunAction( EE_ACTIONS::drag, true, &commit ); + m_toolMgr->RunAction( EE_ACTIONS::drag, &commit ); while( m_toolMgr->GetTool<SCH_MOVE_TOOL>()->IsToolActive() ) { @@ -2445,7 +2445,7 @@ int SCH_EDIT_TOOL::CleanupSheetPins( const TOOL_EVENT& aEvent ) m_frame->OnModify(); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); return 0; } diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index af9b5f9cf8..33d7842684 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -132,8 +132,8 @@ int SCH_EDITOR_CONTROL::Revert( const TOOL_EVENT& aEvent ) if( m_frame->GetCurrentSheet().Last() != &root ) { - m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( ACTIONS::cancelInteractive ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); // Store the current zoom level into the current screen before switching m_frame->GetScreen()->m_LastZoomLevel = m_frame->GetCanvas()->GetView()->GetScale(); @@ -656,10 +656,10 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) } // Wake the selection tool after exiting to ensure the cursor gets updated - m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false ); + m_toolMgr->PostAction( EE_ACTIONS::selectionActivate ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } @@ -746,10 +746,10 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent ) // ( avoid crash in some cases when the SimTune tool is deselected ) EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>(); selectionTool->ClearSelection(); - m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false ); + m_toolMgr->PostAction( EE_ACTIONS::selectionActivate ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } @@ -1196,7 +1196,7 @@ int SCH_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent ) return highlightNet( m_toolMgr, aPos ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } @@ -1301,7 +1301,7 @@ bool SCH_EDITOR_CONTROL::doCopy( bool aUseDuplicateClipboard ) plugin.Format( &selection, &selPath, schematic, &formatter, true ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( aUseDuplicateClipboard ) { @@ -1346,7 +1346,7 @@ int SCH_EDITOR_CONTROL::Cut( const TOOL_EVENT& aEvent ) } if( doCopy() ) - m_toolMgr->RunAction( ACTIONS::doDelete, true ); + m_toolMgr->RunAction( ACTIONS::doDelete ); return 0; } @@ -1853,8 +1853,8 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) m_frame->GetCurrentSheet().UpdateAllScreenReferences(); // Now clear the previous selection, select the pasted items, and fire up the "move" tool. - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); - m_toolMgr->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, true, &loadedItems ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, &loadedItems ); EE_SELECTION& selection = selTool->GetSelection(); @@ -1952,7 +1952,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) selection.SetReferencePoint( item->GetPosition() ); } - m_toolMgr->RunAction( EE_ACTIONS::move, true, &commit ); + m_toolMgr->RunAction( EE_ACTIONS::move, &commit ); while( m_toolMgr->GetTool<SCH_MOVE_TOOL>()->IsToolActive() ) { @@ -1979,7 +1979,7 @@ int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent ) symbol = (SCH_SYMBOL*) selection.Front(); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( !symbol || symbol->GetEditFlags() != 0 ) return 0; @@ -1991,7 +1991,7 @@ int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent ) return 0; } - m_toolMgr->RunAction( ACTIONS::showSymbolEditor, true ); + m_toolMgr->RunAction( ACTIONS::showSymbolEditor ); symbolEditor = (SYMBOL_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH_SYMBOL_EDITOR, false ); if( symbolEditor ) @@ -2232,7 +2232,7 @@ int SCH_EDITOR_CONTROL::ToggleOPCurrents( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::ChangeLineMode( const TOOL_EVENT& aEvent ) { m_frame->eeconfig()->m_Drawing.line_mode = aEvent.Parameter<LINE_MODE>(); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); return 0; } @@ -2241,7 +2241,7 @@ int SCH_EDITOR_CONTROL::NextLineMode( const TOOL_EVENT& aEvent ) { m_frame->eeconfig()->m_Drawing.line_mode++; m_frame->eeconfig()->m_Drawing.line_mode %= LINE_MODE::LINE_MODE_COUNT; - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); return 0; } diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index 6dc8833c95..0310b8267d 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -290,7 +290,7 @@ int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent ) const DRAW_SEGMENT_EVENT_PARAMS* params = aEvent.Parameter<const DRAW_SEGMENT_EVENT_PARAMS*>(); m_frame->PushTool( aEvent ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( aEvent.HasPosition() ) { @@ -381,7 +381,7 @@ SCH_LINE* SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus( const wxString& aNet, const VECTO if( aPos == VECTOR2I( 0, 0 ) ) pos = static_cast<VECTOR2I>( getViewControls()->GetCursorPosition() ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_busUnfold.entry = new SCH_BUS_WIRE_ENTRY( pos ); m_busUnfold.entry->SetParent( m_frame->GetScreen() ); @@ -584,7 +584,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const TOOL_EVENT& aTool, int aType, auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); for( SCH_LINE* wire : m_wires ) delete wire; @@ -962,7 +962,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const TOOL_EVENT& aTool, int aType, computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos, currentMode, posture ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } } //------------------------------------------------------------------------ @@ -997,7 +997,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const TOOL_EVENT& aTool, int aType, if( m_busUnfold.in_progress ) { m_busUnfold.label->Rotate90( evt->IsAction( &EE_ACTIONS::rotateCW ) ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else { @@ -1121,7 +1121,7 @@ void SCH_LINE_WIRE_BUS_TOOL::finishSegments() // Clear selection when done so that a new wire can be started. // NOTE: this must be done before simplifyWireList is called or we might end up with // freed selected items. - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); SCH_SCREEN* screen = m_frame->GetScreen(); SCH_COMMIT commit( m_toolMgr ); diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index a0d3201f05..2bb1a51399 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -414,13 +414,13 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) // And give it a kick so it doesn't have to wait for the first mouse movement // to refresh. - m_toolMgr->RunAction( EE_ACTIONS::restartMove ); + m_toolMgr->PostAction( EE_ACTIONS::restartMove ); } } else { // The tool hotkey is interpreted as a click when already dragging/moving - m_toolMgr->RunAction( ACTIONS::cursorClick ); + m_toolMgr->PostAction( ACTIONS::cursorClick ); } return 0; @@ -842,11 +842,11 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) } else if( evt->IsAction( &EE_ACTIONS::rotateCW ) ) { - m_toolMgr->RunAction( EE_ACTIONS::rotateCW, true, &commit ); + m_toolMgr->RunAction( EE_ACTIONS::rotateCW, &commit ); } else if( evt->IsAction( &EE_ACTIONS::rotateCCW ) ) { - m_toolMgr->RunAction( EE_ACTIONS::rotateCCW, true, &commit ); + m_toolMgr->RunAction( EE_ACTIONS::rotateCCW, &commit ); } else if( evt->Action() == TA_CHOICE_MENU_CHOICE ) { @@ -859,7 +859,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) if( symbol ) { m_frame->SelectUnit( symbol, unit ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } } } @@ -982,7 +982,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) item->ClearEditFlags(); if( unselect ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); else m_selectionTool->RebuildSelection(); // Schematic cleanup might have merged lines, etc. diff --git a/eeschema/tools/sch_navigate_tool.cpp b/eeschema/tools/sch_navigate_tool.cpp index f9dba7df30..5db86f1a22 100644 --- a/eeschema/tools/sch_navigate_tool.cpp +++ b/eeschema/tools/sch_navigate_tool.cpp @@ -106,8 +106,8 @@ int SCH_NAVIGATE_TOOL::Forward( const TOOL_EVENT& aEvent ) { m_navIndex++; - m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); - m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive ); + m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); m_frame->SetCurrentSheet( *m_navIndex ); m_frame->DisplayCurrentSheet(); @@ -127,8 +127,8 @@ int SCH_NAVIGATE_TOOL::Back( const TOOL_EVENT& aEvent ) { m_navIndex--; - m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); - m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive ); + m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); m_frame->SetCurrentSheet( *m_navIndex ); m_frame->DisplayCurrentSheet(); @@ -278,8 +278,8 @@ void SCH_NAVIGATE_TOOL::pushToHistory( SCH_SHEET_PATH aPath ) void SCH_NAVIGATE_TOOL::changeSheet( SCH_SHEET_PATH aPath ) { - m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); - m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive ); + m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); // Store the current zoom level into the current screen before switching m_frame->GetScreen()->m_LastZoomLevel = m_frame->GetCanvas()->GetView()->GetScale(); diff --git a/eeschema/tools/simulator_control.cpp b/eeschema/tools/simulator_control.cpp index a0661751cc..47e12d8bfc 100644 --- a/eeschema/tools/simulator_control.cpp +++ b/eeschema/tools/simulator_control.cpp @@ -314,7 +314,7 @@ int SIMULATOR_CONTROL::Probe( const TOOL_EVENT& aEvent ) if( blocking_dialog ) blocking_dialog->Close( true ); - m_schematicFrame->GetToolManager()->RunAction( EE_ACTIONS::simProbe ); + m_schematicFrame->GetToolManager()->PostAction( EE_ACTIONS::simProbe ); m_schematicFrame->Raise(); return 0; @@ -331,7 +331,7 @@ int SIMULATOR_CONTROL::Tune( const TOOL_EVENT& aEvent ) if( blocking_dialog ) blocking_dialog->Close( true ); - m_schematicFrame->GetToolManager()->RunAction( EE_ACTIONS::simTune ); + m_schematicFrame->GetToolManager()->PostAction( EE_ACTIONS::simTune ); m_schematicFrame->Raise(); return 0; diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index 1ffb6089a9..32a102f152 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -416,8 +416,8 @@ int SYMBOL_EDITOR_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent ) if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { - m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( ACTIONS::cancelInteractive ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); SYMBOL_EDIT_FRAME* symbolEditor = static_cast<SYMBOL_EDIT_FRAME*>( m_frame ); symbolEditor->SetConvert( convert ); @@ -681,7 +681,7 @@ int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent ) symbol->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false ); schframe->Raise(); - schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, false, symbol ); + schframe->GetToolManager()->PostAction( EE_ACTIONS::placeSymbol, symbol ); } return 0; diff --git a/eeschema/tools/symbol_editor_drawing_tools.cpp b/eeschema/tools/symbol_editor_drawing_tools.cpp index 3431f01f82..38a05683c2 100644 --- a/eeschema/tools/symbol_editor_drawing_tools.cpp +++ b/eeschema/tools/symbol_editor_drawing_tools.cpp @@ -95,7 +95,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings(); wxString description; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -113,7 +113,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_view->ClearPreview(); delete item; item = nullptr; @@ -203,7 +203,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) // First click creates... if( !item ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); switch( type ) { @@ -350,7 +350,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) // gets whacked. m_toolMgr->DeactivateTool(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -363,7 +363,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_view->ClearPreview(); delete item; item = nullptr; @@ -429,7 +429,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) if( !symbol ) continue; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); int lineWidth = schIUScale.MilsToIU( settings->m_Defaults.line_width ); @@ -524,7 +524,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) commit.Push( description ); m_frame->RebuildView(); - m_toolMgr->RunAction( ACTIONS::activatePointEditor ); + m_toolMgr->PostAction( ACTIONS::activatePointEditor ); } } else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) ) @@ -535,7 +535,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } else if( evt->IsDblClick( BUT_LEFT ) && !item ) { - m_toolMgr->RunAction( EE_ACTIONS::properties, true ); + m_toolMgr->RunAction( EE_ACTIONS::properties ); } else if( evt->IsClick( BUT_RIGHT ) ) { @@ -654,10 +654,10 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent ) LIB_PIN* pin = pinTool->RepeatPin( sourcePin ); g_lastPinWeakPtr = pin; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( pin ) - m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, true, pin ); + m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, pin ); } return 0; diff --git a/eeschema/tools/symbol_editor_edit_tool.cpp b/eeschema/tools/symbol_editor_edit_tool.cpp index cd49161ca6..82284e4093 100644 --- a/eeschema/tools/symbol_editor_edit_tool.cpp +++ b/eeschema/tools/symbol_editor_edit_tool.cpp @@ -180,13 +180,13 @@ int SYMBOL_EDITOR_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) if( item->IsMoving() ) { - m_toolMgr->RunAction( ACTIONS::refreshPreview, true ); + m_toolMgr->RunAction( ACTIONS::refreshPreview ); } else { if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( !localCommit.Empty() ) localCommit.Push( _( "Rotate" ) ); @@ -229,12 +229,12 @@ int SYMBOL_EDITOR_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) if( item->IsMoving() ) { - m_toolMgr->RunAction( ACTIONS::refreshPreview, true ); + m_toolMgr->RunAction( ACTIONS::refreshPreview ); } else { if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_frame->OnModify(); } @@ -263,7 +263,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent ) return 0; // Don't leave a freed pointer in the selection - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); commit.Modify( symbol, m_frame->GetScreen() ); @@ -337,7 +337,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) { PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); m_pickerItem = nullptr; // Deactivate other tools; particularly important if another PICKER is currently running @@ -353,7 +353,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>(); selectionTool->UnbrightenItem( m_pickerItem ); selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ ); - m_toolMgr->RunAction( ACTIONS::doDelete, true ); + m_toolMgr->RunAction( ACTIONS::doDelete ); m_pickerItem = nullptr; } @@ -399,10 +399,10 @@ int SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) m_toolMgr->GetTool<EE_SELECTION_TOOL>()->UnbrightenItem( m_pickerItem ); // Wake the selection tool after exiting to ensure the cursor gets updated - m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false ); + m_toolMgr->PostAction( EE_ACTIONS::selectionActivate ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } @@ -459,7 +459,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) } if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); return 0; } @@ -558,8 +558,8 @@ void SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties() LIB_SYMBOL* symbol = m_frame->GetCurSymbol(); bool partLocked = symbol->UnitsLocked(); - m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( ACTIONS::cancelInteractive ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); DIALOG_LIB_SYMBOL_PROPERTIES dlg( m_frame, symbol ); @@ -607,7 +607,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::PinTable( const TOOL_EVENT& aEvent ) if( !symbol ) return 0; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); saveCopyInUndoList( symbol, UNDO_REDO::LIBEDIT ); @@ -817,7 +817,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent ) if( !selection.Empty() ) { selection.SetReferencePoint( getViewControls()->GetCursorPosition( true ) ); - m_toolMgr->RunAction( EE_ACTIONS::move, true, &commit ); + m_toolMgr->RunAction( EE_ACTIONS::move, &commit ); commit.Push( _( "Paste" ) ); } @@ -870,11 +870,11 @@ int SYMBOL_EDITOR_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) getView()->Add( newItem ); } - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); - m_toolMgr->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, true, &newItems ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, &newItems ); selection.SetReferencePoint( mapCoords( getViewControls()->GetCursorPosition( true ) ) ); - m_toolMgr->RunAction( EE_ACTIONS::move, true, &commit ); + m_toolMgr->RunAction( EE_ACTIONS::move, &commit ); commit.Push( _( "Duplicate" ) ); return 0; diff --git a/eeschema/tools/symbol_editor_move_tool.cpp b/eeschema/tools/symbol_editor_move_tool.cpp index d0ce3abf9e..da31f34850 100644 --- a/eeschema/tools/symbol_editor_move_tool.cpp +++ b/eeschema/tools/symbol_editor_move_tool.cpp @@ -363,14 +363,14 @@ int SYMBOL_EDITOR_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) commit->Revert(); if( unselect ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); else m_toolMgr->ProcessEvent( EVENTS::SelectedEvent ); } else { if( unselect ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); if( !localCommit.Empty() ) localCommit.Push( _( "Move" ) ); diff --git a/eeschema/widgets/hierarchy_pane.cpp b/eeschema/widgets/hierarchy_pane.cpp index 17852a3b4d..e034cc971d 100644 --- a/eeschema/widgets/hierarchy_pane.cpp +++ b/eeschema/widgets/hierarchy_pane.cpp @@ -253,7 +253,7 @@ void HIERARCHY_PANE::onSelectSheetPath( wxTreeEvent& aEvent ) TREE_ITEM_DATA* itemData = static_cast<TREE_ITEM_DATA*>( m_tree->GetItemData( itemSel ) ); SetCursor( wxCURSOR_ARROWWAIT ); - m_frame->GetToolManager()->RunAction<SCH_SHEET_PATH*>( EE_ACTIONS::changeSheet, true, + m_frame->GetToolManager()->RunAction<SCH_SHEET_PATH*>( EE_ACTIONS::changeSheet, &itemData->m_SheetPath ); SetCursor( wxCURSOR_ARROW ); } diff --git a/eeschema/widgets/search_handlers.cpp b/eeschema/widgets/search_handlers.cpp index 0e254355bf..0a540637ad 100644 --- a/eeschema/widgets/search_handlers.cpp +++ b/eeschema/widgets/search_handlers.cpp @@ -76,7 +76,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows ) EDA_ITEMS selectedItems; std::vector<SCH_SEARCH_HIT> selectedHits; - m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); for( long row : aItemRows ) { @@ -105,7 +105,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows ) } if( selectedItems.size() ) - m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, true, &selectedItems ); + m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, &selectedItems ); m_frame->GetCanvas()->Refresh( false ); } diff --git a/eeschema/widgets/symbol_tree_pane.cpp b/eeschema/widgets/symbol_tree_pane.cpp index 873225e309..e8c024e5cd 100644 --- a/eeschema/widgets/symbol_tree_pane.cpp +++ b/eeschema/widgets/symbol_tree_pane.cpp @@ -64,7 +64,7 @@ SYMBOL_TREE_PANE::~SYMBOL_TREE_PANE() void SYMBOL_TREE_PANE::onSymbolSelected( wxCommandEvent& aEvent ) { - m_symbolEditFrame->GetToolManager()->RunAction( EE_ACTIONS::editSymbol, true ); + m_symbolEditFrame->GetToolManager()->RunAction( EE_ACTIONS::editSymbol ); // Make sure current-part highlighting doesn't get lost in selection highlighting m_tree->Unselect(); diff --git a/gerbview/dialogs/dialog_print_gerbview.cpp b/gerbview/dialogs/dialog_print_gerbview.cpp index 74a88c3222..71ed039923 100644 --- a/gerbview/dialogs/dialog_print_gerbview.cpp +++ b/gerbview/dialogs/dialog_print_gerbview.cpp @@ -308,7 +308,7 @@ void DIALOG_PRINT_GERBVIEW::saveSettings() int GERBVIEW_CONTROL::Print( const TOOL_EVENT& aEvent ) { // Selection affects the original item visibility - m_toolMgr->RunAction( GERBVIEW_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( GERBVIEW_ACTIONS::selectionClear ); BOARD_PRINTOUT_SETTINGS settings( m_frame->GetPageSettings() ); settings.m_colorSettings = m_frame->GetColorSettings(); diff --git a/gerbview/files.cpp b/gerbview/files.cpp index 340935dcfb..b6e89137e9 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -687,7 +687,7 @@ void GERBVIEW_FRAME::DoWithAcceptedFiles() { wxString fn = file.GetFullPath(); // Open zip archive in editor - m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( ArchiveFileExtension ), true, &fn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( ArchiveFileExtension ), &fn ); } else { @@ -698,5 +698,5 @@ void GERBVIEW_FRAME::DoWithAcceptedFiles() // Open files in editor if( !gerbFn.IsEmpty() ) - m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( GerberFileExtension ), true, &gerbFn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( GerberFileExtension ), &gerbFn ); } diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 05e0d0073d..ac2225cb40 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -162,7 +162,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ) m_auimgr.Update(); SetActiveLayer( 0, true ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); + GetToolManager()->PostAction( ACTIONS::zoomFitScreen ); resolveCanvasType(); @@ -185,7 +185,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ) m_acceptedExts.emplace( DrillFileExtension, &GERBVIEW_ACTIONS::loadGerbFiles ); DragAcceptFiles( true ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen ); // Ensure the window is on top Raise(); @@ -808,7 +808,7 @@ void GERBVIEW_FRAME::SetActiveLayer( int aLayer, bool doLayerWidgetUpdate ) UpdateTitleAndInfo(); - m_toolManager->RunAction( GERBVIEW_ACTIONS::layerChanged ); // notify other tools + m_toolManager->PostAction( GERBVIEW_ACTIONS::layerChanged ); // notify other tools GetCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere GetCanvas()->SetHighContrastLayer( GERBER_DRAW_LAYER( aLayer ) ); diff --git a/gerbview/tools/gerbview_control.cpp b/gerbview/tools/gerbview_control.cpp index 52a273adf0..d37784c5b5 100644 --- a/gerbview/tools/gerbview_control.cpp +++ b/gerbview/tools/gerbview_control.cpp @@ -398,7 +398,7 @@ int GERBVIEW_CONTROL::ClearLayer( const TOOL_EVENT& aEvent ) int GERBVIEW_CONTROL::ClearAllLayers( const TOOL_EVENT& aEvent ) { m_frame->Clear_DrawLayers( false ); - m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitScreen ); canvas()->Refresh(); m_frame->ClearMsgPanel(); diff --git a/gerbview/tools/gerbview_selection_tool.cpp b/gerbview/tools/gerbview_selection_tool.cpp index 632a1cd1bc..0c079d9c4c 100644 --- a/gerbview/tools/gerbview_selection_tool.cpp +++ b/gerbview/tools/gerbview_selection_tool.cpp @@ -193,7 +193,7 @@ int GERBVIEW_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) else if( evt->IsDblClick( BUT_MIDDLE ) ) { // Middle double click? Do zoom to fit - m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitScreen ); } else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE ) { diff --git a/gerbview/widgets/gerbview_layer_widget.cpp b/gerbview/widgets/gerbview_layer_widget.cpp index 6e8b1d4938..492a4c64f6 100644 --- a/gerbview/widgets/gerbview_layer_widget.cpp +++ b/gerbview/widgets/gerbview_layer_widget.cpp @@ -252,11 +252,11 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event ) break; case ID_LAYER_MOVE_UP: - m_frame->GetToolManager()->RunAction( GERBVIEW_ACTIONS::moveLayerUp, true ); + m_frame->GetToolManager()->RunAction( GERBVIEW_ACTIONS::moveLayerUp ); break; case ID_LAYER_MOVE_DOWN: - m_frame->GetToolManager()->RunAction( GERBVIEW_ACTIONS::moveLayerDown, true ); + m_frame->GetToolManager()->RunAction( GERBVIEW_ACTIONS::moveLayerDown ); break; case ID_LAYER_DELETE: diff --git a/include/tool/tool_manager.h b/include/tool/tool_manager.h index 7368432715..e04d074fa9 100644 --- a/include/tool/tool_manager.h +++ b/include/tool/tool_manager.h @@ -127,7 +127,7 @@ public: void ShutdownTool( const std::string& aToolName ); /** - * Run the specified action. + * Run the specified action immediately, pausing the current action to run the new one. * * The common format for action names is "application.ToolName.Action". * @@ -135,60 +135,110 @@ public: * action is expecting, otherwise an assert will occur when reading the paramter. * * @param aActionName is the name of action to be invoked. - * @param aNow decides if the action has to be run immediately or after the current coroutine - * is preemptied. * @param aParam is an optional parameter that might be used by the invoked action. Its meaning * depends on the action. * @return False if the action was not found. */ template<typename T> - bool RunAction( const std::string& aActionName, bool aNow, T aParam ) + bool RunAction( const std::string& aActionName, T aParam ) { // Use a cast to ensure the proper type is stored inside the parameter std::any a( static_cast<T>( aParam ) ); - return doRunAction( aActionName, aNow, a ); + return doRunAction( aActionName, true, a ); } - bool RunAction( const std::string& aActionName, bool aNow = false ) + bool RunAction( const std::string& aActionName ) { // Default initialize the parameter argument to an empty std::any std::any a; - return doRunAction( aActionName, aNow, a ); + return doRunAction( aActionName, true, a ); } /** - * Run the specified action. - * - * This function will only return if the action has been handled when the action is run - * immediately (aNow = true), otherwise it will always return false. + * Run the specified action immediately, pausing the current action to run the new one. * * Note: The type of the optional parameter must match exactly with the type the consuming * action is expecting, otherwise an assert will occur when reading the paramter. * * @param aAction is the action to be invoked. - * @param aNow decides if the action has to be run immediately or after the current coroutine - * is preemptied. * @param aParam is an optional parameter that might be used by the invoked action. Its meaning * depends on the action. * @return True if the action was handled immediately */ template<typename T> - bool RunAction( const TOOL_ACTION& aAction, bool aNow, T aParam ) + bool RunAction( const TOOL_ACTION& aAction, T aParam ) { // Use a cast to ensure the proper type is stored inside the parameter std::any a( static_cast<T>( aParam ) ); - return doRunAction( aAction, aNow, a ); + return doRunAction( aAction, true, a ); } - bool RunAction( const TOOL_ACTION& aAction, bool aNow = false ) + bool RunAction( const TOOL_ACTION& aAction ) { // Default initialize the parameter argument to an empty std::any std::any a; - return doRunAction( aAction, aNow, a ); + return doRunAction( aAction, true, a ); + } + + /** + * Run the specified action after the current action (coroutine) ends. + * + * The common format for action names is "application.ToolName.Action". + * + * Note: The type of the optional parameter must match exactly with the type the consuming + * action is expecting, otherwise an assert will occur when reading the paramter. + * + * @param aActionName is the name of action to be invoked. + * @param aParam is an optional parameter that might be used by the invoked action. Its meaning + * depends on the action. + * @return False if the action was not found. + */ + template<typename T> + bool PostAction( const std::string& aActionName, T aParam ) + { + // Use a cast to ensure the proper type is stored inside the parameter + std::any a( static_cast<T>( aParam ) ); + + return doRunAction( aActionName, false, a ); + } + + bool PostAction( const std::string& aActionName ) + { + // Default initialize the parameter argument to an empty std::any + std::any a; + + return doRunAction( aActionName, false, a ); + } + + /** + * Run the specified action after the current action (coroutine) ends. + * + * Note: The type of the optional parameter must match exactly with the type the consuming + * action is expecting, otherwise an assert will occur when reading the paramter. + * + * @param aAction is the action to be invoked. + * @param aParam is an optional parameter that might be used by the invoked action. Its meaning + * depends on the action. + */ + template<typename T> + bool PostAction( const TOOL_ACTION& aAction, T aParam ) + { + // Use a cast to ensure the proper type is stored inside the parameter + std::any a( static_cast<T>( aParam ) ); + + return doRunAction( aAction, false, a ); + } + + void PostAction( const TOOL_ACTION& aAction ) + { + // Default initialize the parameter argument to an empty std::any + std::any a; + + doRunAction( aAction, false, a ); } /** diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index 11dd20d000..92684beb85 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -440,7 +440,7 @@ void KICAD_MANAGER_FRAME::DoWithAcceptedFiles() if( ext == ProjectFileExtension || ext == LegacyProjectFileExtension ) { wxString fn = fileName.GetFullPath(); - m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( fileName.GetExt() ), true, &fn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( fileName.GetExt() ), &fn ); return; } @@ -464,7 +464,7 @@ void KICAD_MANAGER_FRAME::DoWithAcceptedFiles() else { wxString fn = fileName.GetFullPath(); - m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( fileName.GetExt() ), true, &fn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( fileName.GetExt() ), &fn ); } } @@ -477,7 +477,7 @@ void KICAD_MANAGER_FRAME::DoWithAcceptedFiles() { wxString command = fullEditorName + " " + gerberFiles; m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( GerberFileExtension ), - true, &command ); + &command ); } } } @@ -713,7 +713,7 @@ void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event ) wxString filename = dlg.GetPath(); if( !dlg.GetPath().IsEmpty() && !Pgm().GetTextEditor().IsEmpty() ) - m_toolManager->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::openTextEditor, true, &filename ); + m_toolManager->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::openTextEditor, &filename ); } @@ -882,12 +882,12 @@ void KICAD_MANAGER_FRAME::OnIdle( wxIdleEvent& aEvent ) if( fn.GetExt() == LegacySchematicFileExtension || fn.GetExt() == KiCadSchematicFileExtension ) { - GetToolManager()->RunAction( KICAD_MANAGER_ACTIONS::editSchematic, true ); + GetToolManager()->RunAction( KICAD_MANAGER_ACTIONS::editSchematic ); } else if( fn.GetExt() == LegacyPcbFileExtension || fn.GetExt() == KiCadPcbFileExtension ) { - GetToolManager()->RunAction( KICAD_MANAGER_ACTIONS::editPCB, true ); + GetToolManager()->RunAction( KICAD_MANAGER_ACTIONS::editPCB ); } } diff --git a/kicad/project_tree_item.cpp b/kicad/project_tree_item.cpp index c9db4ea734..bd605601bd 100644 --- a/kicad/project_tree_item.cpp +++ b/kicad/project_tree_item.cpp @@ -200,9 +200,9 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) case TREE_FILE_TYPE::SEXPR_SCHEMATIC: // Schematics not part of the project are opened in a separate process. if( fullFileName == frame->SchFileName() || fullFileName == frame->SchLegacyFileName() ) - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editSchematic, true ); + toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editSchematic ); else - toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editOtherSch, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editOtherSch, &fullFileName ); break; @@ -210,9 +210,9 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) case TREE_FILE_TYPE::SEXPR_PCB: // Boards not part of the project are opened in a separate process. if( fullFileName == frame->PcbFileName() || fullFileName == frame->PcbLegacyFileName() ) - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editPCB, true ); + toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editPCB ); else - toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editOtherPCB, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editOtherPCB, &fullFileName ); break; @@ -221,7 +221,7 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) case TREE_FILE_TYPE::DRILL: case TREE_FILE_TYPE::DRILL_NC: case TREE_FILE_TYPE::DRILL_XNC: - toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::viewGerbers, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::viewGerbers, &fullFileName ); break; case TREE_FILE_TYPE::HTML: @@ -236,22 +236,22 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) case TREE_FILE_TYPE::TXT: case TREE_FILE_TYPE::MD: case TREE_FILE_TYPE::REPORT: - toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::openTextEditor, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::openTextEditor, &fullFileName ); break; case TREE_FILE_TYPE::DRAWING_SHEET: - toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editDrawingSheet, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editDrawingSheet, &fullFileName ); break; case TREE_FILE_TYPE::FOOTPRINT_FILE: - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editFootprints, true ); + toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editFootprints ); packet = fullFileName.ToStdString(); kiway.ExpressMail( FRAME_FOOTPRINT_EDITOR, MAIL_FP_EDIT, packet ); break; case TREE_FILE_TYPE::SCHEMATIC_LIBFILE: case TREE_FILE_TYPE::SEXPR_SYMBOL_LIB_FILE: - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editSymbols, true ); + toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editSymbols ); packet = fullFileName.ToStdString(); kiway.ExpressMail( FRAME_SCH_SYMBOL_EDITOR, MAIL_LIB_EDIT, packet ); break; diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index f405a2e353..b103b304da 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -912,7 +912,7 @@ void PL_EDITOR_FRAME::OnNewDrawingSheet() UpdateTitleAndInfo(); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); if( GetCurrentFileName().IsEmpty() ) { @@ -970,4 +970,4 @@ void PL_EDITOR_FRAME::UpdateMsgPanelInfo() SetMsgPanel( msgItems ); } -#endif \ No newline at end of file +#endif diff --git a/pagelayout_editor/pl_editor_undo_redo.cpp b/pagelayout_editor/pl_editor_undo_redo.cpp index 592bf23900..3c54a46802 100644 --- a/pagelayout_editor/pl_editor_undo_redo.cpp +++ b/pagelayout_editor/pl_editor_undo_redo.cpp @@ -141,7 +141,7 @@ void PL_EDITOR_FRAME::RollbackFromUndo() if( pageSettingsAndTitleBlock ) { - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen ); HardRedraw(); // items based off of corners will need re-calculating } else diff --git a/pagelayout_editor/tools/pl_drawing_tools.cpp b/pagelayout_editor/tools/pl_drawing_tools.cpp index 917dd76ee5..185b49cd51 100644 --- a/pagelayout_editor/tools/pl_drawing_tools.cpp +++ b/pagelayout_editor/tools/pl_drawing_tools.cpp @@ -76,7 +76,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) DS_DRAW_ITEM_BASE* item = nullptr; bool isText = aEvent.IsAction( &PL_ACTIONS::placeText ); - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -92,7 +92,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); item = nullptr; // There's nothing to roll-back, but we still need to pop the undo stack @@ -152,7 +152,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) { m_frame->SaveCopyInUndoList(); - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); item = dataItem->GetDrawItems()[0]; item->SetFlags( IS_NEW | IS_MOVING ); @@ -175,7 +175,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) // Now we re-select and inform other tools, so that the Properties panel // is updated. - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); m_selectionTool->AddItemToSel( item, false ); item = nullptr; @@ -223,7 +223,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) // gets whacked. m_toolMgr->DeactivateTool(); - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -251,7 +251,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) if( evt->IsCancelInteractive() || evt->IsActivate() ) { - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); if( item ) { @@ -273,7 +273,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) if( !item ) // start drawing { m_frame->SaveCopyInUndoList(); - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); DS_DATA_ITEM* dataItem = m_frame->AddDrawingSheetItem( type ); dataItem->MoveToUi( cursorPos ); @@ -289,14 +289,14 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) { // Now we re-select and inform other tools, so that the Properties panel // is updated. - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); m_selectionTool->AddItemToSel( item, false ); item->ClearEditFlags(); item = nullptr; // Activate point editor immediately to allow resizing of the item just created - m_toolMgr->RunAction( ACTIONS::activatePointEditor, true ); + m_toolMgr->RunAction( ACTIONS::activatePointEditor ); m_frame->OnModify(); } diff --git a/pagelayout_editor/tools/pl_edit_tool.cpp b/pagelayout_editor/tools/pl_edit_tool.cpp index 9b918df1f6..669d456997 100644 --- a/pagelayout_editor/tools/pl_edit_tool.cpp +++ b/pagelayout_editor/tools/pl_edit_tool.cpp @@ -310,7 +310,7 @@ int PL_EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) m_frame->OnModify(); if( unselect ) - m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_toolMgr->RunAction( PL_ACTIONS::clearSelection ); else m_toolMgr->PostEvent( EVENTS::SelectedEvent ); @@ -355,7 +355,7 @@ bool PL_EDIT_TOOL::updateModificationPoint( PL_SELECTION& aSelection ) int PL_EDIT_TOOL::ImportDrawingSheetContent( const TOOL_EVENT& aEvent ) { - m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); + m_toolMgr->RunAction( ACTIONS::cancelInteractive ); wxCommandEvent evt( wxEVT_NULL, ID_APPEND_DESCR_FILE ); m_frame->Files_io( evt ); @@ -427,7 +427,7 @@ int PL_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) PL_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PL_SELECTION_TOOL>(); selectionTool->UnbrightenItem( m_pickerItem ); selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ ); - m_toolMgr->RunAction( ACTIONS::doDelete, true ); + m_toolMgr->RunAction( ACTIONS::doDelete ); m_pickerItem = nullptr; } @@ -473,10 +473,10 @@ int PL_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) m_toolMgr->GetTool<PL_SELECTION_TOOL>()->UnbrightenItem( m_pickerItem ); // Wake the selection tool after exiting to ensure the cursor gets updated - m_toolMgr->RunAction( PL_ACTIONS::selectionActivate, false ); + m_toolMgr->PostAction( PL_ACTIONS::selectionActivate ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } @@ -561,7 +561,7 @@ int PL_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent ) if( !selection.Empty() ) { selection.SetReferencePoint( selection.GetTopLeftItem()->GetPosition() ); - m_toolMgr->RunAction( PL_ACTIONS::move, false ); + m_toolMgr->PostAction( PL_ACTIONS::move ); } return 0; diff --git a/pagelayout_editor/tools/pl_selection_tool.cpp b/pagelayout_editor/tools/pl_selection_tool.cpp index 7883305671..010d7bfae6 100644 --- a/pagelayout_editor/tools/pl_selection_tool.cpp +++ b/pagelayout_editor/tools/pl_selection_tool.cpp @@ -152,7 +152,7 @@ int PL_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( selectionContains( evt->Position() ) ) { // Yes -> run the move tool and wait till it finishes - m_toolMgr->RunAction( "plEditor.InteractiveMove.move", true ); + m_toolMgr->RunAction( "plEditor.InteractiveMove.move" ); } else { @@ -165,7 +165,7 @@ int PL_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) // Middle double click? Do zoom to fit or zoom to objects else if( evt->IsDblClick( BUT_MIDDLE ) ) { - m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitScreen ); } else if( evt->IsCancelInteractive() ) diff --git a/pcbnew/array_creator.cpp b/pcbnew/array_creator.cpp index 1f421c0f41..83177f4036 100644 --- a/pcbnew/array_creator.cpp +++ b/pcbnew/array_creator.cpp @@ -205,8 +205,8 @@ void ARRAY_CREATOR::Invoke() all_added_items.push_back( item ); } - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, true, &all_added_items ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); + m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &all_added_items ); commit.Push( _( "Create an array" ) ); } diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index e4ab0a67c8..0d97f30005 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -656,7 +656,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags ) m_toolMgr->PostEvent( EVENTS::UnselectedEvent ); if( autofillZones ) - m_toolMgr->RunAction( PCB_ACTIONS::zoneFillDirty ); + m_toolMgr->PostAction( PCB_ACTIONS::zoneFillDirty ); if( selectedModified ) m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified ); diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index d9479097b9..48e2607486 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -96,7 +96,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) if( strcmp( idcmd, "$CONFIG" ) == 0 ) { - GetToolManager()->RunAction( ACTIONS::showSymbolLibTable, true ); + GetToolManager()->RunAction( ACTIONS::showSymbolLibTable ); return; } else if( strcmp( idcmd, "$CUSTOM_RULES" ) == 0 ) @@ -106,7 +106,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) } else if( strcmp( idcmd, "$DRC" ) == 0 ) { - GetToolManager()->RunAction( PCB_ACTIONS::runDRC, true ); + GetToolManager()->RunAction( PCB_ACTIONS::runDRC ); return; } else if( strcmp( idcmd, "$CLEAR" ) == 0 ) @@ -192,9 +192,9 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) bbox = footprint->GetBoundingBox( true, false ); // No invisible text in bbox calc if( pad ) - m_toolManager->RunAction<BOARD_ITEM*>( PCB_ACTIONS::highlightItem, true, pad ); + m_toolManager->RunAction<BOARD_ITEM*>( PCB_ACTIONS::highlightItem, pad ); else - m_toolManager->RunAction<BOARD_ITEM*>( PCB_ACTIONS::highlightItem, true, footprint ); + m_toolManager->RunAction<BOARD_ITEM*>( PCB_ACTIONS::highlightItem, footprint ); } else if( netcode > 0 || multiHighlight ) { @@ -645,11 +645,11 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) if( selectConnections ) { - GetToolManager()->RunAction( PCB_ACTIONS::syncSelectionWithNets, true, &items ); + GetToolManager()->RunAction( PCB_ACTIONS::syncSelectionWithNets, &items ); } else { - GetToolManager()->RunAction( PCB_ACTIONS::syncSelection, true, &items ); + GetToolManager()->RunAction( PCB_ACTIONS::syncSelection, &items ); } // Update 3D viewer highlighting @@ -662,7 +662,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) } case MAIL_PCB_UPDATE: - m_toolManager->RunAction( ACTIONS::updatePcbFromSchematic, true ); + m_toolManager->RunAction( ACTIONS::updatePcbFromSchematic ); break; case MAIL_IMPORT_FILE: @@ -692,7 +692,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) } case MAIL_RELOAD_PLUGINS: - GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload, true ); + GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload ); break; // many many others. diff --git a/pcbnew/dialogs/dialog_cleanup_graphics.cpp b/pcbnew/dialogs/dialog_cleanup_graphics.cpp index 97620089db..67206fbe55 100644 --- a/pcbnew/dialogs/dialog_cleanup_graphics.cpp +++ b/pcbnew/dialogs/dialog_cleanup_graphics.cpp @@ -98,7 +98,7 @@ void DIALOG_CLEANUP_GRAPHICS::doCleanup( bool aDryRun ) if( !aDryRun ) { // Clear current selection list to avoid selection of deleted items - m_parentFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_parentFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); // ... and to keep the treeModel from trying to refresh a deleted item m_changesTreeModel->Update( nullptr, RPT_SEVERITY_ACTION ); diff --git a/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp index 083c8adc07..f4c2e5c704 100644 --- a/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp @@ -117,7 +117,7 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup( bool aDryRun ) if( !aDryRun ) { // Clear current selection list to avoid selection of deleted items - m_parentFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_parentFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); // ... and to keep the treeModel from trying to refresh a deleted item m_changesTreeModel->Update( nullptr, RPT_SEVERITY_ACTION ); diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index ceefcc7e81..eb776032b5 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -472,7 +472,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) if( rc_item->GetErrorCode() == DRCE_UNCONNECTED_ITEMS ) { if( !m_frame->GetPcbNewSettings()->m_Display.m_ShowGlobalRatsnest ) - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::showRatsnest, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::showRatsnest ); if( item->Type() == PCB_ZONE_T ) { @@ -1016,7 +1016,7 @@ void DIALOG_DRC::ExcludeMarker() void DIALOG_DRC::deleteAllMarkers( bool aIncludeExclusions ) { // Clear current selection list to avoid selection of deleted items - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); m_markersTreeModel->DeleteItems( false, aIncludeExclusions, false ); m_unconnectedTreeModel->DeleteItems( false, aIncludeExclusions, false ); @@ -1099,7 +1099,7 @@ void DIALOG_DRC::OnDeleteOneClick( wxCommandEvent& aEvent ) if( m_Notebook->GetSelection() == 0 ) { // Clear the selection. It may be the selected DRC marker. - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); m_markersTreeModel->DeleteCurrentItem( true ); diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index 02cae523c6..73c564cbb0 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -239,7 +239,7 @@ void DIALOG_FIND::search( bool aDirection ) // Search parameters m_frame->GetFindReplaceData().findString = searchString; - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); m_frame->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y ); BOARD* board = m_frame->GetBoard(); @@ -393,7 +393,7 @@ void DIALOG_FIND::search( bool aDirection ) } else { - m_frame->GetToolManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, *m_it ); + m_frame->GetToolManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, *m_it ); msg.Printf( _( "'%s' found" ), searchString ); m_frame->SetStatusText( msg ); diff --git a/pcbnew/dialogs/dialog_footprint_checker.cpp b/pcbnew/dialogs/dialog_footprint_checker.cpp index 293e7e79f4..7936c46d6a 100644 --- a/pcbnew/dialogs/dialog_footprint_checker.cpp +++ b/pcbnew/dialogs/dialog_footprint_checker.cpp @@ -376,7 +376,7 @@ void DIALOG_FOOTPRINT_CHECKER::refreshEditor() void DIALOG_FOOTPRINT_CHECKER::OnDeleteOneClick( wxCommandEvent& aEvent ) { // Clear the selection. It may be the selected DRC marker. - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); m_markersTreeModel->DeleteCurrentItem( true ); @@ -400,7 +400,7 @@ void DIALOG_FOOTPRINT_CHECKER::OnDeleteAllClick( wxCommandEvent& event ) void DIALOG_FOOTPRINT_CHECKER::deleteAllMarkers() { // Clear current selection list to avoid selection of deleted items - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); m_markersTreeModel->DeleteItems( false, true, false ); m_frame->GetBoard()->DeleteMARKERs( true, true ); diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index 7b72b48598..e120c753b2 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -118,7 +118,7 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions() bool delete_all = m_delAll->GetValue(); // Clear selection before removing any items - m_Parent->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_Parent->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); BOARD* board = m_Parent->GetBoard(); BOARD_COMMIT commit( m_Parent ); diff --git a/pcbnew/dialogs/dialog_group_properties.cpp b/pcbnew/dialogs/dialog_group_properties.cpp index 9300026e6b..0ea96900bf 100644 --- a/pcbnew/dialogs/dialog_group_properties.cpp +++ b/pcbnew/dialogs/dialog_group_properties.cpp @@ -106,7 +106,7 @@ bool DIALOG_GROUP_PROPERTIES::TransferDataFromWindow() m_group->SetName( m_nameCtrl->GetValue() ); m_group->SetLocked( m_locked->GetValue() ); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_group->RemoveAll(); for( size_t ii = 0; ii < m_membersList->GetCount(); ++ii ) @@ -115,7 +115,7 @@ bool DIALOG_GROUP_PROPERTIES::TransferDataFromWindow() m_group->AddItem( item ); } - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, m_group ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, m_group ); commit.Push( _( "Modified group" ) ); return true; @@ -141,7 +141,7 @@ void DIALOG_GROUP_PROPERTIES::OnMemberSelected( wxCommandEvent& aEvent ) void DIALOG_GROUP_PROPERTIES::OnAddMember( wxCommandEvent& event ) { - m_toolMgr->RunAction( PCB_ACTIONS::pickNewGroupMember, true ); + m_toolMgr->RunAction( PCB_ACTIONS::pickNewGroupMember ); } diff --git a/pcbnew/dialogs/dialog_import_netlist.cpp b/pcbnew/dialogs/dialog_import_netlist.cpp index 5163adb852..a91bd90d52 100644 --- a/pcbnew/dialogs/dialog_import_netlist.cpp +++ b/pcbnew/dialogs/dialog_import_netlist.cpp @@ -102,7 +102,7 @@ DIALOG_IMPORT_NETLIST::~DIALOG_IMPORT_NETLIST() { KIGFX::VIEW_CONTROLS* controls = m_parent->GetCanvas()->GetViewControls(); controls->SetCursorPosition( controls->GetMousePosition() ); - m_parent->GetToolManager()->RunAction( PCB_ACTIONS::move, true ); + m_parent->GetToolManager()->RunAction( PCB_ACTIONS::move ); } } diff --git a/pcbnew/dialogs/dialog_position_relative.cpp b/pcbnew/dialogs/dialog_position_relative.cpp index fa05ecc430..8512d4e009 100644 --- a/pcbnew/dialogs/dialog_position_relative.cpp +++ b/pcbnew/dialogs/dialog_position_relative.cpp @@ -215,7 +215,7 @@ void DIALOG_POSITION_RELATIVE::OnSelectItemClick( wxCommandEvent& event ) POSITION_RELATIVE_TOOL* posrelTool = m_toolMgr->GetTool<POSITION_RELATIVE_TOOL>(); wxASSERT( posrelTool ); - m_toolMgr->RunAction( PCB_ACTIONS::selectpositionRelativeItem, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectpositionRelativeItem ); Hide(); } diff --git a/pcbnew/dialogs/dialog_print_pcbnew.cpp b/pcbnew/dialogs/dialog_print_pcbnew.cpp index c0893fc407..9ea832646b 100644 --- a/pcbnew/dialogs/dialog_print_pcbnew.cpp +++ b/pcbnew/dialogs/dialog_print_pcbnew.cpp @@ -465,7 +465,7 @@ void DIALOG_PRINT_PCBNEW::saveSettings() int PCB_CONTROL::Print( const TOOL_EVENT& aEvent ) { // Selection affects the origin item visibility - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); PCBNEW_PRINTOUT_SETTINGS settings( m_frame->GetPageSettings() ); DIALOG_PRINT_PCBNEW dlg( (PCB_BASE_EDIT_FRAME*) m_frame, &settings ); diff --git a/pcbnew/dialogs/dialog_update_pcb.cpp b/pcbnew/dialogs/dialog_update_pcb.cpp index d626135241..7b031a3ff7 100644 --- a/pcbnew/dialogs/dialog_update_pcb.cpp +++ b/pcbnew/dialogs/dialog_update_pcb.cpp @@ -79,7 +79,7 @@ DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB() { KIGFX::VIEW_CONTROLS* controls = m_frame->GetCanvas()->GetViewControls(); controls->SetCursorPosition( controls->GetMousePosition() ); - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::move, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::move ); } } @@ -98,7 +98,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) if( !aDryRun ) { m_frame->GetToolManager()->DeactivateTool(); - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); } BOARD_NETLIST_UPDATER updater( m_frame, m_frame->GetBoard() ); diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 429799ac9d..b46c2339e8 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -167,7 +167,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) break; case PCB_GROUP_T: - m_toolManager->RunAction<PCB_GROUP*>( PCB_ACTIONS::groupProperties, true, + m_toolManager->RunAction<PCB_GROUP*>( PCB_ACTIONS::groupProperties, static_cast<PCB_GROUP*>( aItem ) ); break; diff --git a/pcbnew/edit_track_width.cpp b/pcbnew/edit_track_width.cpp index 281a0ef3fc..d2f0bb57f0 100644 --- a/pcbnew/edit_track_width.cpp +++ b/pcbnew/edit_track_width.cpp @@ -227,5 +227,5 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event ) break; } - m_toolManager->RunAction( PCB_ACTIONS::trackViaSizeChanged, true ); + m_toolManager->RunAction( PCB_ACTIONS::trackViaSizeChanged ); } diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 6d21d608b0..b4f456c493 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -825,7 +825,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in // we should not ask PLUGINs to do these items: loadedBoard->BuildListOfNets(); ResolveDRCExclusions( true ); - m_toolManager->RunAction( PCB_ACTIONS::repairBoard, true, true); + m_toolManager->RunAction( PCB_ACTIONS::repairBoard, true); if( loadedBoard->IsModified() ) OnModify(); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index d0f370ba72..de7e157478 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -298,7 +298,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset ); m_appearancePanel->SetTabIndex( cfg->m_AuiPanels.appearance_panel_tab ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); + GetToolManager()->PostAction( ACTIONS::zoomFitScreen ); UpdateTitle(); setupUnits( GetSettings() ); @@ -1140,9 +1140,9 @@ void FOOTPRINT_EDIT_FRAME::setupTools() PCB_EDIT_FRAME* pcbframe = static_cast<PCB_EDIT_FRAME*>( Kiway().Player( FRAME_PCB_EDITOR, false ) ); if( pcbframe ) - pcbframe->GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload, true ); + pcbframe->GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload ); else - m_toolManager->RunAction( PCB_ACTIONS::pluginsReload, true ); + m_toolManager->RunAction( PCB_ACTIONS::pluginsReload ); } diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index ec82f9edf9..c23fad8c61 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -251,7 +251,7 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) } case PCB_GROUP_T: - m_toolManager->RunAction<PCB_GROUP*>( PCB_ACTIONS::groupProperties, true, + m_toolManager->RunAction<PCB_GROUP*>( PCB_ACTIONS::groupProperties, static_cast<PCB_GROUP*>( aItem ) ); break; @@ -279,7 +279,7 @@ void FOOTPRINT_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer ) m_appearancePanel->OnLayerChanged(); - m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools + m_toolManager->PostAction( PCB_ACTIONS::layerChanged ); // notify other tools GetCanvas()->SetFocus(); // allow capture of hotkeys GetCanvas()->SetHighContrastLayer( aLayer ); GetCanvas()->Refresh(); diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index 6ce44fe712..6c0353d804 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -794,7 +794,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprint( FOOTPRINT* aFootprint ) PAD_TOOL* padTool = m_toolManager->GetTool<PAD_TOOL>(); if( padTool->InPadEditMode() ) - m_toolManager->RunAction( PCB_ACTIONS::recombinePad, true ); + m_toolManager->RunAction( PCB_ACTIONS::recombinePad ); wxString libraryName = aFootprint->GetFPID().GetLibNickname(); wxString footprintName = aFootprint->GetFPID().GetLibItemName(); @@ -968,7 +968,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew ) return false; } - m_toolManager->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolManager->RunAction( PCB_ACTIONS::selectionClear ); BOARD_COMMIT commit( pcbframe ); // Create a copy for the board, first using Clone() to keep existing Uuids, and then either @@ -1015,7 +1015,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew ) commit.Push( wxT( "Insert footprint" ) ); pcbframe->Raise(); - pcb_ToolManager->RunAction( PCB_ACTIONS::placeFootprint, true, newFootprint ); + pcb_ToolManager->RunAction( PCB_ACTIONS::placeFootprint, newFootprint ); } newFootprint->ClearFlags(); diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 1dae3e2627..4902806f52 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -796,7 +796,7 @@ void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB( wxCommandEvent& aEvent ) if( blocking_dialog ) blocking_dialog->Close( true ); - toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + toolMgr->RunAction( PCB_ACTIONS::selectionClear ); BOARD_COMMIT commit( pcbframe ); // Create the "new" footprint @@ -831,7 +831,7 @@ void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB( wxCommandEvent& aEvent ) commit.Push( wxT( "Insert footprint" ) ); pcbframe->Raise(); - toolMgr->RunAction( PCB_ACTIONS::placeFootprint, false, newFootprint ); + toolMgr->PostAction( PCB_ACTIONS::placeFootprint, newFootprint ); newFootprint->ClearFlags(); } @@ -1220,9 +1220,9 @@ void FOOTPRINT_VIEWER_FRAME::updateView() wxAuiToolBarItem* toolOpt = m_mainToolBar->FindTool( ID_FPVIEWER_AUTOZOOM_TOOL ); if( toolOpt->GetState() & wxAUI_BUTTON_STATE_CHECKED ) - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); else - m_toolManager->RunAction( ACTIONS::centerContents, true ); + m_toolManager->RunAction( ACTIONS::centerContents ); UpdateMsgPanel(); } diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 2dd0735cba..753cf22d19 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -206,7 +206,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent updateView(); SetActiveLayer( F_Cu ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); + GetToolManager()->PostAction( ACTIONS::zoomFitScreen ); // Do not Run a dialog here: on some Window Managers, it creates issues. // Reason: the FOOTPRINT_WIZARD_FRAME is run as modal; @@ -291,7 +291,7 @@ void FOOTPRINT_WIZARD_FRAME::updateView() GetCanvas()->UpdateColors(); GetCanvas()->DisplayBoard( GetBoard() ); m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen ); UpdateMsgPanel(); } @@ -643,7 +643,7 @@ void FOOTPRINT_WIZARD_FRAME::PythonPluginsReload() PCB_EDIT_FRAME* pcbframe = static_cast<PCB_EDIT_FRAME*>( Kiway().Player( FRAME_PCB_EDITOR, false ) ); if( pcbframe ) - pcbframe->GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload, true ); + pcbframe->GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload ); else - GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload, true ); + GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload ); } diff --git a/pcbnew/microwave/microwave_inductor.cpp b/pcbnew/microwave/microwave_inductor.cpp index 57efb21f3e..f4208abb21 100644 --- a/pcbnew/microwave/microwave_inductor.cpp +++ b/pcbnew/microwave/microwave_inductor.cpp @@ -309,7 +309,7 @@ void MICROWAVE_TOOL::createInductorBetween( const VECTOR2I& aStart, const VECTOR else { // at this point, we can save the footprint - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, inductorFP.get() ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, inductorFP.get() ); BOARD_COMMIT commit( this ); commit.Add( inductorFP.release() ); diff --git a/pcbnew/navlib/nl_pcbnew_plugin_impl.cpp b/pcbnew/navlib/nl_pcbnew_plugin_impl.cpp index adf9c7ca05..e717e51fba 100644 --- a/pcbnew/navlib/nl_pcbnew_plugin_impl.cpp +++ b/pcbnew/navlib/nl_pcbnew_plugin_impl.cpp @@ -459,9 +459,7 @@ long NL_PCBNEW_PLUGIN_IMPL::SetActiveCommand( std::string commandId ) } if( runAction ) - { - tool_manager->RunAction( *context, true ); - } + tool_manager->RunAction( *context ); } else { diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index 9556e11680..5d02e419b8 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -120,7 +120,7 @@ void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aR // Spread new footprints. std::vector<FOOTPRINT*> newFootprints = aUpdater.GetAddedFootprints(); - GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); SpreadFootprints( &newFootprints, { 0, 0 }, true ); @@ -128,7 +128,7 @@ void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aR if( !newFootprints.empty() ) { for( FOOTPRINT* footprint : newFootprints ) - GetToolManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, footprint ); + GetToolManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, footprint ); *aRunDragCommand = true; } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index ae7dc1d4a3..7e79a5c1dd 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -371,7 +371,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_appearancePanel->SetTabIndex( settings->m_AuiPanels.appearance_panel_tab ); } - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); + GetToolManager()->PostAction( ACTIONS::zoomFitScreen ); // This is used temporarily to fix a client size issue on GTK that causes zoom to fit // to calculate the wrong zoom size. See PCB_EDIT_FRAME::onSize(). @@ -405,7 +405,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : PythonSyncProjectName(); // Sync action plugins in case they changed since the last time the frame opened - GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload, true ); + GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload ); GetCanvas()->SwitchBackend( m_canvasType ); ActivateGalCanvas(); @@ -1371,7 +1371,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer ) m_appearancePanel->OnLayerChanged(); - m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools + m_toolManager->PostAction( PCB_ACTIONS::layerChanged ); // notify other tools GetCanvas()->SetFocus(); // allow capture of hotkeys GetCanvas()->SetHighContrastLayer( aLayer ); @@ -2450,7 +2450,7 @@ void PCB_EDIT_FRAME::onSize( wxSizeEvent& aEvent ) // We only need this until the frame is done resizing and the final client size is // established. Unbind( wxEVT_SIZE, &PCB_EDIT_FRAME::onSize, this ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen ); } // Skip() is called in the base class. diff --git a/pcbnew/router/length_tuner_tool.cpp b/pcbnew/router/length_tuner_tool.cpp index f0d4edfa19..0ba154b932 100644 --- a/pcbnew/router/length_tuner_tool.cpp +++ b/pcbnew/router/length_tuner_tool.cpp @@ -279,7 +279,7 @@ void LENGTH_TUNER_TOOL::setTransitions() int LENGTH_TUNER_TOOL::MainLoop( const TOOL_EVENT& aEvent ) { // Deselect all items - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); frame()->PushTool( aEvent ); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 4e85367cef..387ae0851d 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -312,7 +312,7 @@ protected: { bds.UseCustomTrackViaSize( true ); bds.m_TempOverrideTrackWidth = true; - m_frame.GetToolManager()->RunAction( ACT_CustomTrackWidth, true ); + m_frame.GetToolManager()->RunAction( ACT_CustomTrackWidth ); } else if( id == ID_POPUP_PCB_SELECT_AUTO_WIDTH ) { @@ -438,7 +438,7 @@ protected: { bds.UseCustomDiffPairDimensions( true ); TOOL_MANAGER* toolManager = m_frame.GetToolManager(); - toolManager->RunAction( PCB_ACTIONS::routerDiffPairDialog, true ); + toolManager->RunAction( PCB_ACTIONS::routerDiffPairDialog ); } else if( id == ID_POPUP_PCB_SELECT_USE_NETCLASS_DIFFPAIR ) { @@ -1485,7 +1485,7 @@ void ROUTER_TOOL::performRouting() frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); controls()->SetAutoPan( false ); { - m_toolMgr->RunAction( ACT_CustomTrackWidth, true ); + m_toolMgr->RunAction( ACT_CustomTrackWidth ); } controls()->SetAutoPan( true ); setCursor(); @@ -1636,7 +1636,7 @@ int ROUTER_TOOL::RouteSelected( const TOOL_EVENT& aEvent ) if( selection.Size() == 0 ) return 0; - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); frame->PushTool( aEvent ); @@ -1714,9 +1714,9 @@ int ROUTER_TOOL::RouteSelected( const TOOL_EVENT& aEvent ) bool autoRouted = false; if( autoRoute ) - m_toolMgr->RunAction( PCB_ACTIONS::routerAttemptFinish, false, &autoRouted ); + m_toolMgr->PostAction( PCB_ACTIONS::routerAttemptFinish, &autoRouted ); else if( otherEnd ) - m_toolMgr->RunAction( PCB_ACTIONS::routerContinueFromEnd, false ); + m_toolMgr->PostAction( PCB_ACTIONS::routerContinueFromEnd ); // We want autorouted tracks to all be in one undo group except for // any tracks that need to be manually finished. @@ -1762,7 +1762,7 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent ) } // Deselect all items - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); frame->PushTool( aEvent ); @@ -1853,7 +1853,7 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent ) } else if( evt->IsAction( &ACT_PlaceThroughVia ) ) { - m_toolMgr->RunAction( PCB_ACTIONS::layerToggle, true ); + m_toolMgr->RunAction( PCB_ACTIONS::layerToggle ); } else if( evt->IsAction( &PCB_ACTIONS::layerChanged ) ) { @@ -1923,7 +1923,7 @@ void ROUTER_TOOL::performDragging( int aMode ) m_cancelled = true; - m_toolMgr->RunAction( PCB_ACTIONS::drag45Degree, false ); + m_toolMgr->PostAction( PCB_ACTIONS::drag45Degree ); return; } @@ -2078,7 +2078,7 @@ void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECT bool ROUTER_TOOL::CanInlineDrag( int aDragMode ) { - m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor, true, + m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor, NeighboringSegmentFilter ); const PCB_SELECTION& selection = m_toolMgr->GetTool<PCB_SELECTION_TOOL>()->GetSelection(); @@ -2108,7 +2108,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) if( selection.Empty() ) { - m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor, true, + m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor, NeighboringSegmentFilter ); } @@ -2137,7 +2137,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) item->SetLocked( false ); } - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); frame()->PushTool( aEvent ); Activate(); @@ -2444,7 +2444,7 @@ int ROUTER_TOOL::InlineBreakTrack( const TOOL_EVENT& aEvent ) if( item->Type() != PCB_TRACE_T ) return 0; - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); Activate(); diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index b31acf1d2d..2b0bd81195 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -746,7 +746,7 @@ int BOARD_EDITOR_CONTROL::TrackWidthInc( const TOOL_EVENT& aEvent ) designSettings.SetDiffPairIndex( widthIndex ); designSettings.UseCustomDiffPairDimensions( false ); - m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged, true ); + m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged ); } else { @@ -770,7 +770,7 @@ int BOARD_EDITOR_CONTROL::TrackWidthInc( const TOOL_EVENT& aEvent ) designSettings.SetTrackWidthIndex( widthIndex ); designSettings.UseCustomTrackViaSize( false ); - m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged, true ); + m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged ); } return 0; @@ -826,7 +826,7 @@ int BOARD_EDITOR_CONTROL::TrackWidthDec( const TOOL_EVENT& aEvent ) designSettings.SetDiffPairIndex( widthIndex ); designSettings.UseCustomDiffPairDimensions( false ); - m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged, true ); + m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged ); } else { @@ -850,7 +850,7 @@ int BOARD_EDITOR_CONTROL::TrackWidthDec( const TOOL_EVENT& aEvent ) designSettings.SetTrackWidthIndex( widthIndex ); designSettings.UseCustomTrackViaSize( false ); - m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged, true ); + m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged ); } return 0; @@ -899,7 +899,7 @@ int BOARD_EDITOR_CONTROL::ViaSizeInc( const TOOL_EVENT& aEvent ) designSettings.SetViaSizeIndex( sizeIndex ); designSettings.UseCustomTrackViaSize( false ); - m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged, true ); + m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged ); } return 0; @@ -956,7 +956,7 @@ int BOARD_EDITOR_CONTROL::ViaSizeDec( const TOOL_EVENT& aEvent ) designSettings.SetViaSizeIndex( sizeIndex ); designSettings.UseCustomTrackViaSize( false ); - m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged, true ); + m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged ); } return 0; @@ -977,7 +977,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent ) BOARD* board = getModel<BOARD>(); COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings(); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_frame->PushTool( aEvent ); @@ -990,7 +990,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); commit.Revert(); if( fromOtherCommand ) @@ -1024,8 +1024,8 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent ) { m_placingFootprint = true; fp->SetPosition( cursorPos ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, fp ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, fp ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else if( aEvent.HasPosition() ) { @@ -1044,7 +1044,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent ) cursorPos = controls->GetCursorPosition( !evt->DisableGridSnapping() ); if( reselect && fp ) - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, fp ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, fp ); if( evt->IsCancelInteractive() ) { @@ -1128,13 +1128,13 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent ) fp->GetField( FOOTPRINT_FIELD )->SetText( UnescapeString( fp->GetFPIDAsString() ) ); commit.Add( fp ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, fp ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, fp ); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); commit.Push( _( "Place a footprint" ) ); fp = nullptr; // to indicate that there is no footprint that we currently modify m_placingFootprint = false; @@ -1203,7 +1203,7 @@ int BOARD_EDITOR_CONTROL::modifyLockSelected( MODIFY_MODE aMode ) BOARD_COMMIT commit( m_frame ); if( selection.Empty() ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor ); // Resolve TOGGLE mode if( aMode == TOGGLE ) @@ -1361,7 +1361,7 @@ int BOARD_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent ) toMerge.push_back( curr_area ); } - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); if( !toMerge.empty() ) { @@ -1370,7 +1370,7 @@ int BOARD_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent ) commit.Push( wxT( "Merge zones" ) ); for( EDA_ITEM* item : merged ) - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, item ); + m_toolMgr->RunAction( PCB_ACTIONS::selectItem, item ); } } @@ -1503,7 +1503,7 @@ int BOARD_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent ) } selectionTool->ClearSelection(); - m_toolMgr->RunAction( PCB_ACTIONS::selectNet, true, netCode ); + m_toolMgr->RunAction( PCB_ACTIONS::selectNet, netCode ); canvas()->ForceRefresh(); DIALOG_ASSIGN_NETCLASS dlg( m_frame, netName, board()->GetNetClassAssignmentCandidates(), @@ -1561,7 +1561,7 @@ int BOARD_EDITOR_CONTROL::EditFpInFpEditor( const TOOL_EVENT& aEvent ) editor->Raise(); // Iconize( false ); if( selection.IsHover() ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); return 0; } @@ -1592,7 +1592,7 @@ int BOARD_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent ) return false; // drill origin is a one-shot; don't continue with tool } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } diff --git a/pcbnew/tools/board_inspection_tool.cpp b/pcbnew/tools/board_inspection_tool.cpp index 1b3075a7d7..3393efd01e 100644 --- a/pcbnew/tools/board_inspection_tool.cpp +++ b/pcbnew/tools/board_inspection_tool.cpp @@ -1516,10 +1516,10 @@ int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent ) m_frame->m_probingSchToPcb = true; // recursion guard { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); if( item ) - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, item ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, item ); } m_frame->m_probingSchToPcb = false; @@ -1756,15 +1756,15 @@ int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) { PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>(); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor, true, + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); + m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor, EDIT_TOOL::PadFilter ); PCB_SELECTION& selection = selectionTool->GetSelection(); if( selection.Empty() ) { - m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor, true, + m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor, EDIT_TOOL::FootprintFilter ); selection = selectionTool->GetSelection(); } @@ -1817,7 +1817,7 @@ int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) } } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } diff --git a/pcbnew/tools/drawing_stackup_table_tool.cpp b/pcbnew/tools/drawing_stackup_table_tool.cpp index f600ba009a..5efc0dc25b 100644 --- a/pcbnew/tools/drawing_stackup_table_tool.cpp +++ b/pcbnew/tools/drawing_stackup_table_tool.cpp @@ -549,7 +549,7 @@ int DRAWING_TOOL::InteractivePlaceWithPreview( const TOOL_EVENT& aEvent, BOARD_COMMIT commit( m_frame ); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); // do not capture or auto-pan until we start placing the table SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::TEXT ); diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index ec41852c2c..c730341bc3 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -410,7 +410,7 @@ int DRAWING_TOOL::DrawRectangle( const TOOL_EVENT& aEvent ) commit.Add( rect ); commit.Push( isTextBox ? _( "Draw a text box" ) : _( "Draw a rectangle" ) ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, rect ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, rect ); } } @@ -458,7 +458,7 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent ) commit.Add( circle ); commit.Push( _( "Draw a circle" ) ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, circle ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, circle ); } circle = new PCB_SHAPE( parent ); @@ -505,7 +505,7 @@ int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent ) commit.Add( arc ); commit.Push( _( "Draw an arc" ) ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, arc ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, arc ); } arc = new PCB_SHAPE( parent ); @@ -536,7 +536,7 @@ int DRAWING_TOOL::PlaceImage( const TOOL_EVENT& aEvent ) PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>(); BOARD_COMMIT commit( m_frame ); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); // Add all the drawable symbols to preview if( image ) @@ -559,7 +559,7 @@ int DRAWING_TOOL::PlaceImage( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_view->ClearPreview(); m_view->RecacheAllItems(); delete image; @@ -577,7 +577,7 @@ int DRAWING_TOOL::PlaceImage( const TOOL_EVENT& aEvent ) // Prime the pump if( image ) { - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else if( aEvent.HasPosition() ) { @@ -650,7 +650,7 @@ int DRAWING_TOOL::PlaceImage( const TOOL_EVENT& aEvent ) { if( !image ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); wxFileDialog dlg( m_frame, _( "Choose Image" ), wxEmptyString, wxEmptyString, _( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(), @@ -705,10 +705,10 @@ int DRAWING_TOOL::PlaceImage( const TOOL_EVENT& aEvent ) commit.Add( image ); commit.Push( _( "Place an image" ) ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, image ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, image ); image = nullptr; - m_toolMgr->RunAction( ACTIONS::activatePointEditor ); + m_toolMgr->PostAction( ACTIONS::activatePointEditor ); m_view->ClearPreview(); @@ -785,7 +785,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) auto cleanup = [&]() { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_controls->ForceCursorPosition( false ); m_controls->ShowCursor( true ); m_controls->SetAutoPan( false ); @@ -803,7 +803,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::TEXT ); }; - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_frame->PushTool( aEvent ); @@ -875,7 +875,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) if( !text ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_controls->ForceCursorPosition( true, m_controls->GetCursorPosition() ); @@ -934,7 +934,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) m_frame->GetCanvas()->Refresh(); } - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, text ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, text ); m_view->Update( &selection() ); // update the cursor so it looks correct before another event @@ -945,12 +945,12 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) if( placing ) { text->ClearFlags(); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); commit.Add( text ); commit.Push( _( "Place a text" ) ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, text ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, text ); text = nullptr; } @@ -971,7 +971,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) cursorPos = m_controls->GetMousePosition(); } - m_toolMgr->RunAction( PCB_ACTIONS::refreshPreview ); + m_toolMgr->PostAction( PCB_ACTIONS::refreshPreview ); m_controls->ShowCursor( true ); m_controls->CaptureCursor( text != nullptr ); @@ -1082,7 +1082,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MEASURE ); }; - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_frame->PushTool( aEvent ); @@ -1093,7 +1093,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) // Set initial cursor setCursor(); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); if( aEvent.HasPosition() ) m_toolMgr->PrimeTool( aEvent.Position() ); @@ -1185,7 +1185,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) { case SET_ORIGIN: { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); PCB_LAYER_ID layer = m_frame->GetActiveLayer(); @@ -1289,7 +1289,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) if( t == PCB_DIM_LEADER_T ) frame()->OnEditItemRequest( dimension ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, dimension ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, dimension ); break; } @@ -1303,7 +1303,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) } else if( evt->IsDblClick( BUT_LEFT ) ) { - m_toolMgr->RunAction( PCB_ACTIONS::cursorClick, false ); + m_toolMgr->PostAction( PCB_ACTIONS::cursorClick ); } } else if( evt->IsMotion() ) @@ -1501,7 +1501,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) return 0; } - m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); + m_toolMgr->RunAction( ACTIONS::cancelInteractive ); std::vector<BOARD_ITEM*> newItems; // all new items, including group std::vector<BOARD_ITEM*> selectedItems; // the group, or newItems if no group @@ -1552,10 +1552,10 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) m_view->Add( &preview ); // Clear the current selection then select the drawings so that edit tools work on them - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() ); - m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, true, &selItems ); + m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &selItems ); m_frame->PushTool( aEvent ); @@ -1598,7 +1598,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) if( evt->IsCancelInteractive() || evt->IsActivate() ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); if( group ) { @@ -1672,7 +1672,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent ) SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::ANCHOR ); PCB_GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() ); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_frame->PushTool( aEvent ); @@ -1845,7 +1845,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, // Set initial cursor setCursor(); - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); if( aStartingPoint ) m_toolMgr->PrimeTool( *aStartingPoint ); @@ -1952,7 +1952,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, if( !started ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); if( aStartingPoint ) { @@ -2020,7 +2020,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, { commit.Add( graphic ); commit.Push( _( "Draw a line segment" ) ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, graphic ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, graphic ); } else { @@ -2250,7 +2250,7 @@ bool DRAWING_TOOL::drawArc( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, bool started = false; bool cancelled = false; - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); if( aStartingPoint ) m_toolMgr->PrimeTool( *aStartingPoint ); @@ -2310,7 +2310,7 @@ bool DRAWING_TOOL::drawArc( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, { if( !started ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_controls->SetAutoPan( true ); m_controls->CaptureCursor( true ); @@ -2489,7 +2489,7 @@ bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE** aZone ) if( selection.Empty() ) { clearSelection = true; - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor ); } // we want a single zone @@ -2500,7 +2500,7 @@ bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE** aZone ) if( !*aZone ) { if( clearSelection ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); return false; } diff --git a/pcbnew/tools/drc_tool.cpp b/pcbnew/tools/drc_tool.cpp index dd63dc8679..2e247d0610 100644 --- a/pcbnew/tools/drc_tool.cpp +++ b/pcbnew/tools/drc_tool.cpp @@ -82,7 +82,7 @@ void DRC_TOOL::ShowDRCDialog( wxWindow* aParent ) } Activate(); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); if( !m_drcDialog ) { diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 03c8ee83b0..8c3dea74f0 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -282,11 +282,11 @@ int EDIT_TOOL::GetAndPlace( const TOOL_EVENT& aEvent ) if( fp ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, fp ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, fp ); selectionTool->GetSelection().SetReferencePoint( fp->GetPosition() ); - m_toolMgr->RunAction( PCB_ACTIONS::move, false ); + m_toolMgr->PostAction( PCB_ACTIONS::move ); } return 0; @@ -314,7 +314,7 @@ bool EDIT_TOOL::invokeInlineRouter( int aDragMode ) if( theRouter->CanInlineDrag( aDragMode ) ) { - m_toolMgr->RunAction( PCB_ACTIONS::routerInlineDrag, true, aDragMode ); + m_toolMgr->RunAction( PCB_ACTIONS::routerInlineDrag, aDragMode ); return true; } @@ -839,7 +839,7 @@ int EDIT_TOOL::ChangeTrackWidth( const TOOL_EVENT& aEvent ) if( selection.IsHover() ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); // Notify other tools of the changes -- This updates the visual ratsnest m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified ); @@ -1341,14 +1341,14 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) VECTOR2D cursorPos = getViewControls()->GetCursorPosition( false ); if( ds && ds->HitTestDrawingSheetItems( getView(), cursorPos ) ) - m_toolMgr->RunAction( ACTIONS::pageSettings ); + m_toolMgr->PostAction( ACTIONS::pageSettings ); else - m_toolMgr->RunAction( PCB_ACTIONS::footprintProperties, true ); + m_toolMgr->RunAction( PCB_ACTIONS::footprintProperties ); } if( selection.IsHover() ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); } else { @@ -1475,12 +1475,12 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) m_commit->Push( _( "Rotate" ) ); if( is_hover && !m_dragging ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified ); if( m_dragging ) - m_toolMgr->RunAction( PCB_ACTIONS::updateLocalRatsnest, false ); + m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest ); } // Restore the old reference so any mouse dragging that occurs doesn't make the selection jump @@ -1675,12 +1675,12 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) m_commit->Push( _( "Mirror" ) ); if( selection.IsHover() && !m_dragging ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified ); if( m_dragging ) - m_toolMgr->RunAction( PCB_ACTIONS::updateLocalRatsnest, false ); + m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest ); return 0; } @@ -1752,12 +1752,12 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) m_commit->Push( _( "Change Side / Flip" ) ); if( selection.IsHover() && !m_dragging ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified ); if( m_dragging ) - m_toolMgr->RunAction( PCB_ACTIONS::updateLocalRatsnest, false ); + m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest ); // Restore the old reference so any mouse dragging that occurs doesn't make the selection jump // to this now invalid reference @@ -1773,7 +1773,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut ) { // As we are about to remove items, they have to be removed from the selection first - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); for( EDA_ITEM* item : aItems ) { @@ -1856,7 +1856,7 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut ) canvas()->Refresh(); // Restore the selection on the original zone - m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, zone ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, zone ); break; } @@ -1985,7 +1985,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) // In "alternative" mode, we expand selected track items to their full connection. if( isAlt && ( selectionCopy.HasType( PCB_TRACE_T ) || selectionCopy.HasType( PCB_VIA_T ) ) ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectConnection, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectConnection ); } // Finally run RequestSelection() one more time to find out what user wants to do about @@ -2097,12 +2097,12 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent ) m_commit->Push( _( "Move exact" ) ); if( selection.IsHover() ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified ); if( m_dragging ) - m_toolMgr->RunAction( PCB_ACTIONS::updateLocalRatsnest, false ); + m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest ); } return 0; @@ -2225,11 +2225,11 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) } // Clear the old selection first - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); // Select the new items EDA_ITEMS nItems( new_items.begin(), new_items.end() ); - m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, true, &nItems ); + m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &nItems ); // record the new items as added if( !selection.Empty() ) @@ -2239,7 +2239,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) // TODO(ISM): This line can't be used to activate the tool until we allow multiple // activations. - // m_toolMgr->RunAction( PCB_ACTIONS::move, true ); + // m_toolMgr->RunAction( PCB_ACTIONS::move ); // Instead we have to create the event and call the tool's function // directly @@ -2250,7 +2250,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) // Deslect the duplicated item if we originally started as a hover selection if( is_hover ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); } return 0; @@ -2398,7 +2398,7 @@ bool EDIT_TOOL::pickReferencePoint( const wxString& aTooltip, const wxString& aS m_statusPopup->Popup(); canvas()->SetStatusPopup( m_statusPopup->GetPanel() ); - m_toolMgr->RunAction( ACTIONS::pickerSubTool, true ); + m_toolMgr->RunAction( ACTIONS::pickerSubTool ); while( !done ) { diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index 3a0bf8a8ae..f7b226faab 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -394,7 +394,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi pickedReferencePoint ) ) { if( is_hover ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); editFrame->PopTool( aEvent ); return 0; @@ -449,7 +449,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi displayConstraintsMessage( hv45Mode ); // Prime the pump - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); // Main loop: keep receiving events do @@ -666,7 +666,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi statusPopup.Move( wxGetMousePosition() + wxPoint( 20, 20 ) ); - m_toolMgr->RunAction( PCB_ACTIONS::updateLocalRatsnest, false, new VECTOR2I( movement ) ); + m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest, new VECTOR2I( movement ) ); } else if( evt->IsCancelInteractive() || evt->IsActivate() ) { @@ -794,7 +794,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi // Unselect all items to clear selection flags and then re-select the originally selected // items (after the potential Revert()). - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); // TODO: there's an encapsulation leak here: this commit often has more than just the move // in it; for instance it might have a paste, append board, etc. as well. @@ -818,12 +818,12 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi m_commit->Push( aCommitMessage ); EDA_ITEMS oItems( orig_items.begin(), orig_items.end() ); - m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, true, &oItems ); + m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &oItems ); } m_toolMgr->GetTool<DRAWING_TOOL>()->UpdateStatusBar(); // Remove the dynamic ratsnest from the screen - m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest, true ); + m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest ); editFrame->PopTool( aEvent ); editFrame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); diff --git a/pcbnew/tools/footprint_editor_control.cpp b/pcbnew/tools/footprint_editor_control.cpp index 77e65c9d9d..0fd77e1b02 100644 --- a/pcbnew/tools/footprint_editor_control.cpp +++ b/pcbnew/tools/footprint_editor_control.cpp @@ -524,7 +524,7 @@ int FOOTPRINT_EDITOR_CONTROL::ImportFootprint( const TOOL_EVENT& aEvent ) m_frame->ReCreateHToolbar(); } - m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitScreen ); m_frame->OnModify(); return 0; } diff --git a/pcbnew/tools/group_tool.cpp b/pcbnew/tools/group_tool.cpp index 2bd225f346..d0629af32b 100644 --- a/pcbnew/tools/group_tool.cpp +++ b/pcbnew/tools/group_tool.cpp @@ -145,7 +145,7 @@ int GROUP_TOOL::PickNewMember( const TOOL_EVENT& aEvent ) picker->SetClickHandler( [&]( const VECTOR2D& aPoint ) -> bool { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); const PCB_SELECTION& sel = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, @@ -200,7 +200,7 @@ int GROUP_TOOL::PickNewMember( const TOOL_EVENT& aEvent ) statusPopup.Popup(); canvas()->SetStatusPopup( statusPopup.GetPanel() ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); while( !done ) { @@ -315,10 +315,10 @@ int GROUP_TOOL::Ungroup( const TOOL_EVENT& aEvent ) std::vector<BOARD_ITEM*> members; if( selection.Empty() ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor ); PCB_SELECTION selCopy = selection; - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); for( EDA_ITEM* item : selCopy ) { @@ -358,7 +358,7 @@ int GROUP_TOOL::Ungroup( const TOOL_EVENT& aEvent ) } EDA_ITEMS mem( members.begin(), members.end() ); - m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, true, &mem ); + m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &mem ); m_toolMgr->PostEvent( EVENTS::SelectedItemsModified ); m_frame->OnModify(); @@ -374,7 +374,7 @@ int GROUP_TOOL::RemoveFromGroup( const TOOL_EVENT& aEvent ) BOARD_COMMIT commit( m_frame ); if( selection.Empty() ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor ); std::map<PCB_GROUP*, std::vector<BOARD_ITEM*>> groupMap; diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index d11351e4fa..21466c948d 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -70,7 +70,7 @@ void PAD_TOOL::Reset( RESET_REASON aReason ) bool highContrast = ( opts.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL ); if( m_wasHighContrast != highContrast ) - m_toolMgr->RunAction( ACTIONS::highContrastMode, true ); + m_toolMgr->RunAction( ACTIONS::highContrastMode ); frame()->GetInfoBar()->Dismiss(); @@ -300,7 +300,7 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent ) std::deque<int> storedPadNumbers; std::map<wxString, std::pair<int, wxString>> oldNumbers; - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); frame()->PushTool( aEvent ); @@ -348,7 +348,7 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent ) if( evt->IsCancelInteractive() ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); commit.Revert(); frame()->PopTool( aEvent ); @@ -611,7 +611,7 @@ int PAD_TOOL::EditPad( const TOOL_EVENT& aEvent ) } ); if( !m_wasHighContrast ) - m_toolMgr->RunAction( ACTIONS::highContrastMode, true ); + m_toolMgr->RunAction( ACTIONS::highContrastMode ); if( PCB_ACTIONS::explodePad.GetHotKey() == PCB_ACTIONS::recombinePad.GetHotKey() ) { @@ -635,7 +635,7 @@ int PAD_TOOL::EditPad( const TOOL_EVENT& aEvent ) bool highContrast = ( opts.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL ); if( m_wasHighContrast != highContrast ) - m_toolMgr->RunAction( ACTIONS::highContrastMode, true ); + m_toolMgr->RunAction( ACTIONS::highContrastMode ); settings->m_PadEditModePad = nullptr; @@ -727,7 +727,7 @@ PCB_LAYER_ID PAD_TOOL::explodePad( PAD* aPad ) } commit.Push( _("Edit pad shapes") ); - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); return layer; } @@ -739,7 +739,7 @@ std::vector<PCB_SHAPE*> PAD_TOOL::RecombinePad( PAD* aPad, bool aIsDryRun, BOARD // Don't leave an object in the point editor that might no longer exist after // recombining the pad. - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); for( BOARD_ITEM* item : footprint->GraphicalItems() ) item->ClearFlags( SKIP_STRUCT ); diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index 1bdc0ccc29..60e378cfa0 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -570,7 +570,7 @@ int PCB_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent ) return false; // drill origin is a one-shot; don't continue with tool } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); } return 0; @@ -596,7 +596,7 @@ int PCB_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) PCB_PICKER_TOOL* picker = m_toolMgr->GetTool<PCB_PICKER_TOOL>(); m_pickerItem = nullptr; - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); // Deactivate other tools; particularly important if another PICKER is currently running Activate(); @@ -683,7 +683,7 @@ int PCB_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) m_frame->GetCanvas()->Refresh(); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); return 0; } @@ -1103,7 +1103,7 @@ int PCB_CONTROL::placeBoardItems( BOARD* aBoard, bool aAnchorAtOrigin, bool aRea int PCB_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsNew, bool aAnchorAtOrigin, bool aReannotateDuplicates ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>(); EDIT_TOOL* editTool = m_toolMgr->GetTool<EDIT_TOOL>(); @@ -1153,7 +1153,7 @@ int PCB_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsNew, // Select the items that should be selected EDA_ITEMS toSel( itemsToSel.begin(), itemsToSel.end() ); - m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, true, &toSel ); + m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &toSel ); // Reannotate duplicate footprints (make sense only in board editor ) if( aReannotateDuplicates && m_isBoardEditor ) @@ -1185,7 +1185,7 @@ int PCB_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsNew, getViewControls()->SetCursorPosition( getViewControls()->GetMousePosition(), false ); m_toolMgr->ProcessEvent( EVENTS::SelectedEvent ); - m_toolMgr->RunAction( PCB_ACTIONS::move, true ); + m_toolMgr->RunAction( PCB_ACTIONS::move ); } return 0; diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index 53639adecc..0137024630 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -2323,7 +2323,7 @@ int PCB_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent ) } else { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); commit.Remove( item ); } } diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index e0cbe4cdf9..d67cdb5c31 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -298,7 +298,7 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) // Single click? Select single object if( m_highlight_modifier && brd_editor ) { - m_toolMgr->RunAction( PCB_ACTIONS::highlightNet, true ); + m_toolMgr->RunAction( PCB_ACTIONS::highlightNet ); } else { @@ -338,15 +338,15 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( m_selection.GetSize() == 1 && m_selection[0]->Type() == PCB_GROUP_T ) EnterGroup(); else - m_toolMgr->RunAction( PCB_ACTIONS::properties, true ); + m_toolMgr->RunAction( PCB_ACTIONS::properties ); } else if( evt->IsDblClick( BUT_MIDDLE ) ) { // Middle double click? Do zoom to fit or zoom to objects if( evt->Modifier( MD_CTRL ) ) // Is CTRL key down? - m_toolMgr->RunAction( ACTIONS::zoomFitObjects, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitObjects ); else - m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolMgr->RunAction( ACTIONS::zoomFitScreen ); } else if( evt->IsDrag( BUT_LEFT ) ) { @@ -424,11 +424,11 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) && dynamic_cast<PCB_TRACK*>( m_selection.GetItem( 0 ) ); if( haveTrack && trackDragAction == TRACK_DRAG_ACTION::DRAG ) - m_toolMgr->RunAction( PCB_ACTIONS::drag45Degree, true ); + m_toolMgr->RunAction( PCB_ACTIONS::drag45Degree ); else if( haveTrack && trackDragAction == TRACK_DRAG_ACTION::DRAG_FREE_ANGLE ) - m_toolMgr->RunAction( PCB_ACTIONS::dragFreeAngle, true ); + m_toolMgr->RunAction( PCB_ACTIONS::dragFreeAngle ); else - m_toolMgr->RunAction( PCB_ACTIONS::move, true ); + m_toolMgr->RunAction( PCB_ACTIONS::move ); } else { @@ -554,7 +554,7 @@ PCB_SELECTION& PCB_SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aCl if( selectionEmpty ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, aClientFilter ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, aClientFilter ); m_selection.ClearReferencePoint(); } @@ -1155,7 +1155,7 @@ int PCB_SELECTION_TOOL::unrouteSelected( const TOOL_EVENT& aEvent ) // Get the tracks on our list of pads, then delete them selectAllConnectedTracks( toUnroute, STOP_CONDITION::STOP_AT_PAD ); - m_toolMgr->RunAction( ACTIONS::doDelete, true ); + m_toolMgr->RunAction( ACTIONS::doDelete ); // Reselect our footprint/pads as they were in our original selection for( EDA_ITEM* item : selectedItems ) @@ -1544,7 +1544,7 @@ int PCB_SELECTION_TOOL::grabUnconnected( const TOOL_EVENT& aEvent ) select( nearest ); } - m_toolMgr->RunAction( PCB_ACTIONS::moveIndividually, true ); + m_toolMgr->RunAction( PCB_ACTIONS::moveIndividually ); return 0; } @@ -2280,7 +2280,7 @@ void PCB_SELECTION_TOOL::ClearSelection( bool aQuietMode ) if( !aQuietMode ) { m_toolMgr->ProcessEvent( EVENTS::ClearedEvent ); - m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest, true ); + m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest ); } } diff --git a/pcbnew/tools/pcb_tool_base.cpp b/pcbnew/tools/pcb_tool_base.cpp index 599f6d98c0..831d335b49 100644 --- a/pcbnew/tools/pcb_tool_base.cpp +++ b/pcbnew/tools/pcb_tool_base.cpp @@ -49,7 +49,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const TOOL_EVENT& aTool, BOARD_COMMIT commit( frame() ); - GetManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + GetManager()->RunAction( PCB_ACTIONS::selectionClear ); Activate(); // Must be done after Activate() so that it gets set into the correct context @@ -214,7 +214,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const TOOL_EVENT& aTool, } else if( evt->IsAction( &PCB_ACTIONS::trackViaSizeChanged ) ) { - m_toolMgr->RunAction( ACTIONS::refreshPreview ); + m_toolMgr->PostAction( ACTIONS::refreshPreview ); } else if( newItem && evt->Category() == TC_COMMAND ) { diff --git a/pcbnew/tools/position_relative_tool.cpp b/pcbnew/tools/position_relative_tool.cpp index ba4ee899b6..9f3bf89813 100644 --- a/pcbnew/tools/position_relative_tool.cpp +++ b/pcbnew/tools/position_relative_tool.cpp @@ -153,7 +153,7 @@ int POSITION_RELATIVE_TOOL::RelativeItemSelectionMove( const VECTOR2I& aPosAncho m_commit->Push( _( "Position Relative" ) ); if( m_selection.IsHover() ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified ); @@ -175,7 +175,7 @@ int POSITION_RELATIVE_TOOL::SelectPositionRelativeItem( const TOOL_EVENT& aEvent picker->SetClickHandler( [&]( const VECTOR2D& aPoint ) -> bool { - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear ); const PCB_SELECTION& sel = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) @@ -219,7 +219,7 @@ int POSITION_RELATIVE_TOOL::SelectPositionRelativeItem( const TOOL_EVENT& aEvent statusPopup.Popup(); canvas()->SetStatusPopup( statusPopup.GetPanel() ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); while( !done ) { diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index 0da5a1eaaf..5c936efb61 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -172,7 +172,7 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE& aZone, const ZONE& aCutout ) // Clear the selection before removing the old zone auto toolMgr = m_tool.GetManager(); - toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + toolMgr->RunAction( PCB_ACTIONS::selectionClear ); SHAPE_POLY_SET originalOutline( *aZone.Outline() ); originalOutline.BooleanSubtract( *aCutout.Outline(), SHAPE_POLY_SET::PM_FAST ); @@ -213,7 +213,7 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE& aZone, const ZONE& aCutout ) else { m_params.m_sourceZone = newZones[0]; - toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, newZones[0] ); + toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, newZones[0] ); } } @@ -238,7 +238,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr<ZONE> aZone ) commit.Add( aZone.get() ); commit.Push( _( "Add a zone" ) ); - m_tool.GetManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, + m_tool.GetManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, aZone.release() ); break; } @@ -263,7 +263,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr<ZONE> aZone ) poly->SetPolyShape( *aZone->Outline() ); commit.Add( poly ); - m_tool.GetManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, poly ); + m_tool.GetManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, poly ); commit.Push( _( "Add a graphical polygon" ) ); @@ -286,7 +286,7 @@ bool ZONE_CREATE_HELPER::OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr ) if( m_zone ) { - m_tool.GetManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_tool.GetManager()->RunAction( PCB_ACTIONS::selectionClear ); // set up properties from zone const auto& settings = *m_parentView.GetPainter()->GetSettings(); diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index c55a46b67b..81521d289e 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -295,7 +295,7 @@ void NET_GRID_TABLE::updateNetVisibility( const NET_GRID_ENTRY& aNet ) const TOOL_ACTION& action = aNet.visible ? PCB_ACTIONS::showNetInRatsnest : PCB_ACTIONS::hideNetInRatsnest; - m_frame->GetToolManager()->RunAction( action, true, aNet.code ); + m_frame->GetToolManager()->RunAction( action, aNet.code ); } @@ -496,7 +496,7 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo m_btnNetInspector->Bind( wxEVT_BUTTON, [&]( wxCommandEvent& aEvent ) { - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::listNets, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::listNets ); passOnFocus(); } ); @@ -514,7 +514,7 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo m_cbFlipBoard->Bind( wxEVT_CHECKBOX, [&]( wxCommandEvent& aEvent ) { - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::flipBoard, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::flipBoard ); } ); m_toggleGridRenderer = new GRID_BITMAP_TOGGLE_RENDERER( KiBitmap( BITMAPS::visibility ), @@ -2966,17 +2966,17 @@ void APPEARANCE_CONTROLS::onNetContextMenu( wxCommandEvent& aEvent ) break; case ID_HIGHLIGHT_NET: - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::highlightNet, true, net.code ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::highlightNet, net.code ); m_frame->GetCanvas()->Refresh(); break; case ID_SELECT_NET: - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectNet, true, net.code ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectNet, net.code ); m_frame->GetCanvas()->Refresh(); break; case ID_DESELECT_NET: - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::deselectNet, true, net.code ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::deselectNet, net.code ); m_frame->GetCanvas()->Refresh(); break; @@ -3013,7 +3013,6 @@ void APPEARANCE_CONTROLS::showNetclass( const wxString& aClassName, bool aShow ) { m_frame->GetToolManager()->RunAction( aShow ? PCB_ACTIONS::showNetInRatsnest : PCB_ACTIONS::hideNetInRatsnest, - true, net->GetNetCode() ); int row = m_netsTable->GetRowByNetcode( net->GetNetCode() ); @@ -3194,7 +3193,7 @@ void APPEARANCE_CONTROLS::onNetclassContextMenu( wxCommandEvent& aEvent ) runOnNetsOfClass( m_contextMenuNetclass, [&]( NETINFO_ITEM* aItem ) { - toolMgr->RunAction( action, true, aItem->GetNetCode() ); + toolMgr->RunAction( action, aItem->GetNetCode() ); } ); } break; diff --git a/pcbnew/widgets/search_handlers.cpp b/pcbnew/widgets/search_handlers.cpp index 605dd401e5..b915f48877 100644 --- a/pcbnew/widgets/search_handlers.cpp +++ b/pcbnew/widgets/search_handlers.cpp @@ -41,7 +41,7 @@ void PCB_SEARCH_HANDLER::ActivateItem( long aItemRow ) std::vector<long> item = { aItemRow }; SelectItems( item ); - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::properties, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::properties ); } @@ -113,12 +113,12 @@ void FOOTPRINT_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows ) } } - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); if( selectedItems.size() ) { EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() ); - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItems, true, &selItems ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItems, &selItems ); } m_frame->GetCanvas()->Refresh( false ); @@ -202,12 +202,12 @@ void ZONE_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows ) } } - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); if( selectedItems.size() ) { EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() ); - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItems, true, &selItems ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItems, &selItems ); } m_frame->GetCanvas()->Refresh( false ); @@ -293,12 +293,12 @@ void TEXT_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows ) } } - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear ); if( selectedItems.size() ) { EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() ); - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItems, true, &selItems ); + m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItems, &selItems ); } m_frame->GetCanvas()->Refresh( false );