Router: settings dialog fixes

Make keyboard activation of OK save settings instead of cancelling.
Also, fix the string for the shortcut so that it works (shortcut
unchanged).

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13303
This commit is contained in:
Mike Williams 2022-12-29 10:31:12 -05:00
parent 068b714908
commit 4bb1b4a3d2
3 changed files with 8 additions and 7 deletions

View File

@ -56,13 +56,13 @@ DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS( wxWindow* aParent, PNS::ROUTING_SETTIN
// Don't show options that are not implemented
m_suggestEnding->Hide();
SetDefaultItem( m_stdButtonsOK );
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
SetupStandardButtons();
finishDialogSettings();
}
void DIALOG_PNS_SETTINGS::OnOkClick( wxCommandEvent& aEvent )
bool DIALOG_PNS_SETTINGS::TransferDataFromWindow()
{
// Save widgets' values to settings
m_settings.SetMode( (PNS::PNS_MODE) m_mode->GetSelection() );
@ -82,7 +82,7 @@ void DIALOG_PNS_SETTINGS::OnOkClick( wxCommandEvent& aEvent )
if( m_freeAngleMode->IsEnabled() )
m_settings.SetFreeAngleMode( m_freeAngleMode->GetValue() );
aEvent.Skip(); // ends returning wxID_OK (default behavior)
return true;
}

View File

@ -39,8 +39,9 @@ class DIALOG_PNS_SETTINGS : public DIALOG_PNS_SETTINGS_BASE
public:
DIALOG_PNS_SETTINGS( wxWindow* aParent, PNS::ROUTING_SETTINGS& aSettings );
bool TransferDataFromWindow() override;
private:
virtual void OnOkClick( wxCommandEvent& aEvent ) override;
virtual void onModeChange( wxCommandEvent& aEvent ) override;
PNS::ROUTING_SETTINGS& m_settings;

View File

@ -1438,7 +1438,7 @@ TOOL_ACTION PCB_ACTIONS::routeDiffPair( "pcbnew.InteractiveRouter.DiffPair",
TOOL_ACTION PCB_ACTIONS::routerSettingsDialog( "pcbnew.InteractiveRouter.SettingsDialog",
AS_GLOBAL,
MD_CTRL + MD_SHIFT + ',', LEGACY_HK_NAME( "Routing Options" ),
MD_CTRL + '<', LEGACY_HK_NAME( "Routing Options" ),
_( "Interactive Router Settings..." ), _( "Open Interactive Router settings" ),
BITMAPS::tools );