Remove duplicated PNS TOOL_ACTIONs to display routing settings

This commit is contained in:
Maciej Suminski 2018-06-15 17:12:15 +02:00
parent 94b6f848bb
commit 583a9c08c0
3 changed files with 7 additions and 29 deletions

View File

@ -61,11 +61,6 @@ using namespace KIGFX;
namespace PNS {
TOOL_ACTION TOOL_BASE::ACT_RouterOptions( "pcbnew.InteractiveRouter.RouterOptions",
AS_CONTEXT, TOOL_ACTION::LegacyHotKey( HK_ROUTING_OPTIONS ),
_( "Routing Options..." ),
_( "Shows a dialog containing router options." ), tools_xpm );
TOOL_BASE::TOOL_BASE( const std::string& aToolName ) :
PCB_TOOL( aToolName )

View File

@ -44,8 +44,6 @@ namespace PNS {
class APIEXPORT TOOL_BASE : public PCB_TOOL
{
public:
static TOOL_ACTION ACT_RouterOptions;
TOOL_BASE( const std::string& aToolName );
virtual ~TOOL_BASE();

View File

@ -92,12 +92,13 @@ TOOL_ACTION PCB_ACTIONS::routerActivateDiffPair( "pcbnew.InteractiveRouter.DiffP
TOOL_ACTION PCB_ACTIONS::routerActivateSettingsDialog( "pcbnew.InteractiveRouter.SettingsDialog",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ROUTING_OPTIONS ),
_( "Interactive Router Settings..." ),
_( "Open Interactive Router settings" ), NULL, AF_ACTIVATE );
_( "Open Interactive Router settings" ), tools_xpm );
TOOL_ACTION PCB_ACTIONS::routerActivateDpDimensionsDialog( "pcbnew.InteractiveRouter.DpDimensionsDialog",
AS_GLOBAL, 0,
_( "Differential Pair Dimension Settings..." ),
_( "Open Differential Pair Dimension settings" ), ps_diff_pair_gap_xpm, AF_ACTIVATE );
_( "Open Differential Pair Dimension settings" ),
ps_diff_pair_gap_xpm );
TOOL_ACTION PCB_ACTIONS::routerActivateTuneSingleTrace( "pcbnew.LengthTuner.TuneSingleTrack",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ROUTE_TUNE_SINGLE ),
@ -192,12 +193,6 @@ static const TOOL_ACTION ACT_SwitchPosture( "pcbnew.InteractiveRouter.SwitchPost
_( "Switches posture of the currently routed track." ),
change_entry_orient_xpm );
static const TOOL_ACTION ACT_SetDpDimensions( "pcbnew.InteractiveRouter.SetDpDimensions",
AS_CONTEXT, TOOL_ACTION::LegacyHotKey( HK_DP_DIMENSIONS ),
_( "Differential Pair Dimensions..." ),
_( "Sets the width and gap of the currently routed differential pair." ),
ps_diff_pair_tune_length_xpm );
ROUTER_TOOL::ROUTER_TOOL() :
TOOL_BASE( "pcbnew.InteractiveRouter" )
{
@ -338,10 +333,10 @@ public:
Add( ACT_CustomTrackWidth );
if( aMode == PNS::PNS_MODE_ROUTE_DIFF_PAIR )
Add( ACT_SetDpDimensions );
Add( PCB_ACTIONS::routerActivateDpDimensionsDialog );
AppendSeparator();
Add( PNS::TOOL_BASE::ACT_RouterOptions );
Add( PCB_ACTIONS::routerActivateSettingsDialog );
AppendSeparator();
Add( &m_zoomMenu );
@ -777,12 +772,10 @@ void ROUTER_TOOL::performRouting()
int ROUTER_TOOL::DpDimensionsDialog( const TOOL_EVENT& aEvent )
{
Activate();
PNS::SIZES_SETTINGS sizes = m_router->Sizes();
DIALOG_PNS_DIFF_PAIR_DIMENSIONS settingsDlg( frame(), sizes );
if( settingsDlg.ShowModal() )
if( settingsDlg.ShowModal() == wxID_OK )
{
m_router->UpdateSizes( sizes );
m_savedSizes = sizes;
@ -794,14 +787,10 @@ int ROUTER_TOOL::DpDimensionsDialog( const TOOL_EVENT& aEvent )
int ROUTER_TOOL::SettingsDialog( const TOOL_EVENT& aEvent )
{
Activate();
DIALOG_PNS_SETTINGS settingsDlg( frame(), m_router->Settings() );
if( settingsDlg.ShowModal() )
{
if( settingsDlg.ShowModal() == wxID_OK )
m_savedSettings = m_router->Settings();
}
return 0;
}
@ -821,10 +810,6 @@ void ROUTER_TOOL::setTransitions()
Go( &ROUTER_TOOL::onViaCommand, ACT_SelLayerAndPlaceThroughVia.MakeEvent() );
Go( &ROUTER_TOOL::onViaCommand, ACT_SelLayerAndPlaceBlindVia.MakeEvent() );
// TODO is not this redundant? the same actions can be used for menus and hotkeys
Go( &ROUTER_TOOL::SettingsDialog, ACT_RouterOptions.MakeEvent() );
Go( &ROUTER_TOOL::DpDimensionsDialog, ACT_SetDpDimensions.MakeEvent() );
Go( &ROUTER_TOOL::CustomTrackWidthDialog, ACT_CustomTrackWidth.MakeEvent() );
Go( &ROUTER_TOOL::onTrackViaSizeChanged, PCB_ACTIONS::trackViaSizeChanged.MakeEvent() );
}