diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 88ae383af9..d74a18210b 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -168,13 +168,11 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) break; case PCB_GROUP_T: - m_toolManager->RunAction( PCB_ACTIONS::groupProperties, - static_cast( aItem ) ); + m_toolManager->RunAction( PCB_ACTIONS::groupProperties, static_cast( aItem ) ); break; case PCB_GENERATOR_T: - m_toolManager->RunAction( PCB_ACTIONS::generatorProperties, - static_cast( aItem ) ); + static_cast( aItem )->ShowPropertiesDialog( this ); break; case PCB_MARKER_T: diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index 585667ce77..061a2fa626 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -252,8 +252,7 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) } case PCB_GROUP_T: - m_toolManager->RunAction( PCB_ACTIONS::groupProperties, - static_cast( aItem ) ); + m_toolManager->RunAction( PCB_ACTIONS::groupProperties, static_cast( aItem ) ); break; case PCB_MARKER_T: diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index 1a9f9aa77a..fca16ff7ff 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -548,10 +548,8 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit if( item->Type() == PCB_GENERATOR_T ) { - PCB_GENERATOR* generator = static_cast( item ); - - m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genUpdateEdit, - aCommit, generator ); + m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genUpdateEdit, aCommit, + static_cast( item ) ); } else if( item->Type() == PCB_FOOTPRINT_T ) { @@ -586,10 +584,8 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit { if( item->Type() == PCB_GENERATOR_T ) { - PCB_GENERATOR* generator = static_cast( item ); - - m_toolMgr->RunSynchronousAction( - PCB_ACTIONS::genStartEdit, aCommit, generator ); + m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genStartEdit, aCommit, + static_cast( item ) ); } else { @@ -807,10 +803,8 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit { if( item->Type() == PCB_GENERATOR_T ) { - PCB_GENERATOR* generator = static_cast( item ); - - m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genPushEdit, aCommit, - generator ); + m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genPushEdit, aCommit, + static_cast( item ) ); } } } @@ -820,10 +814,8 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit { if( item->Type() == PCB_GENERATOR_T ) { - PCB_GENERATOR* generator = static_cast( item ); - - m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genRevertEdit, - aCommit, generator ); + m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genRevertEdit, aCommit, + static_cast( item ) ); } } } diff --git a/pcbnew/tools/generator_tool.cpp b/pcbnew/tools/generator_tool.cpp index e13da89526..a73c7a961d 100644 --- a/pcbnew/tools/generator_tool.cpp +++ b/pcbnew/tools/generator_tool.cpp @@ -82,17 +82,6 @@ int GENERATOR_TOOL::ShowGeneratorsManager( const TOOL_EVENT& aEvent ) } -int GENERATOR_TOOL::ShowGeneratorProperties( const TOOL_EVENT& aEvent ) -{ - PCB_BASE_EDIT_FRAME* editFrame = getEditFrame(); - PCB_GENERATOR* gen = aEvent.Parameter(); - - gen->ShowPropertiesDialog( editFrame ); - - return 0; -} - - int GENERATOR_TOOL::RegenerateAll( const TOOL_EVENT& aEvent ) { BOARD_COMMIT localCommit( this ); @@ -292,7 +281,6 @@ void GENERATOR_TOOL::setTransitions() { // Generator actions Go( &GENERATOR_TOOL::ShowGeneratorsManager, PCB_ACTIONS::generatorsShowManager.MakeEvent() ); - Go( &GENERATOR_TOOL::ShowGeneratorProperties, PCB_ACTIONS::generatorProperties.MakeEvent() ); Go( &GENERATOR_TOOL::RegenerateAll, PCB_ACTIONS::regenerateAll.MakeEvent() ); Go( &GENERATOR_TOOL::RegenerateOutdated, PCB_ACTIONS::regenerateOutdated.MakeEvent() ); diff --git a/pcbnew/tools/generator_tool.h b/pcbnew/tools/generator_tool.h index d9099df63e..194bbe0f87 100644 --- a/pcbnew/tools/generator_tool.h +++ b/pcbnew/tools/generator_tool.h @@ -50,7 +50,6 @@ public: void DestroyManagerDialog(); int ShowGeneratorsManager( const TOOL_EVENT& aEvent ); - int ShowGeneratorProperties( const TOOL_EVENT& aEvent ); int RegenerateSelected( const TOOL_EVENT& aEvent ); int RegenerateAll( const TOOL_EVENT& aEvent ); diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 6f93f3abe3..ee9c66b749 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -2391,11 +2391,6 @@ TOOL_ACTION PCB_ACTIONS::dragFreeAngle( TOOL_ACTION_ARGS() // GENERATOR_TOOL // -TOOL_ACTION PCB_ACTIONS::generatorProperties( TOOL_ACTION_ARGS() - .Name( "pcbnew.Generator.generatorProperties" ) - .Scope( AS_GLOBAL ) ); - - TOOL_ACTION PCB_ACTIONS::regenerateOutdated( TOOL_ACTION_ARGS() .Name( "pcbnew.Generator.regenerateOutdated" ) .Scope( AS_GLOBAL ) diff --git a/pcbnew/tools/pcb_actions.h b/pcbnew/tools/pcb_actions.h index 71203fbedd..a811d1d5fd 100644 --- a/pcbnew/tools/pcb_actions.h +++ b/pcbnew/tools/pcb_actions.h @@ -269,7 +269,6 @@ public: static TOOL_ACTION routerInlineDrag; /// Generator tool - static TOOL_ACTION generatorProperties; static TOOL_ACTION regenerateOutdated; static TOOL_ACTION regenerateAll; static TOOL_ACTION regenerateSelected; diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index 97dacf46cc..c63acb2755 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -539,9 +539,8 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) if( item->Type() == PCB_GENERATOR_T ) { - m_toolMgr->RunSynchronousAction( - PCB_ACTIONS::genStartEdit, &commit, - static_cast( item ) ); + m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genStartEdit, &commit, + static_cast( item ) ); } else { @@ -652,8 +651,8 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) { m_statusPopup->Hide(); - m_toolMgr->RunSynchronousAction( - PCB_ACTIONS::genPushEdit, &commit, static_cast( item ) ); + m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genPushEdit, &commit, + static_cast( item ) ); } commit.Push( _( "Drag Corner" ) ); @@ -670,9 +669,8 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) { if( item->Type() == PCB_GENERATOR_T ) { - m_toolMgr->RunSynchronousAction( - PCB_ACTIONS::genRevertEdit, &commit, - static_cast( item ) ); + m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genRevertEdit, &commit, + static_cast( item ) ); } commit.Revert(); @@ -1495,10 +1493,9 @@ void PCB_POINT_EDITOR::updateItem( BOARD_COMMIT* aCommit ) { GENERATOR_TOOL* generatorTool = m_toolMgr->GetTool(); PCB_GENERATOR* generatorItem = static_cast( item ); - generatorItem->UpdateFromEditPoints( m_editPoints, aCommit ); - m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genUpdateEdit, aCommit, - generatorItem ); + generatorItem->UpdateFromEditPoints( m_editPoints, aCommit ); + m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genUpdateEdit, aCommit, generatorItem ); m_statusPopup->Popup(); generatorItem->UpdateStatus( generatorTool, frame(), m_statusPopup.get() );