TOOL_MANAGER is no longer static. Reworked autoregistration of TOOL_ACTIONs.

This commit is contained in:
Maciej Suminski
2014-05-14 16:29:53 +02:00
parent ae4f41c328
commit def53707d5
11 changed files with 71 additions and 61 deletions
+3 -3
View File
@@ -1391,15 +1391,15 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
// Cancel the current tool
// TODO while sending a lot of cancel events works for sure, it is not the most
// elegant way to cancel a tool, this should be probably done another way
while( m_toolManager.GetCurrentTool()->GetName() != "pcbnew.InteractiveSelection" &&
while( m_toolManager->GetCurrentTool()->GetName() != "pcbnew.InteractiveSelection" &&
trials++ < MAX_TRIALS )
{
TOOL_EVENT cancel( TC_ANY, TA_CANCEL_TOOL );
m_toolManager.ProcessEvent( cancel );
m_toolManager->ProcessEvent( cancel );
}
if( !actionName.empty() )
m_toolManager.RunAction( actionName );
m_toolManager->RunAction( actionName );
}
}
else