From 4bb1b4a3d2330907a57d30fa2ea4dbccfd0f82ae Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Thu, 29 Dec 2022 10:31:12 -0500 Subject: [PATCH] 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 --- pcbnew/dialogs/dialog_pns_settings.cpp | 10 +++++----- pcbnew/dialogs/dialog_pns_settings.h | 3 ++- pcbnew/tools/pcb_actions.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pcbnew/dialogs/dialog_pns_settings.cpp b/pcbnew/dialogs/dialog_pns_settings.cpp index d3757c04bf..9f39d853c8 100644 --- a/pcbnew/dialogs/dialog_pns_settings.cpp +++ b/pcbnew/dialogs/dialog_pns_settings.cpp @@ -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; } diff --git a/pcbnew/dialogs/dialog_pns_settings.h b/pcbnew/dialogs/dialog_pns_settings.h index 7b686b4a59..8694c19c96 100644 --- a/pcbnew/dialogs/dialog_pns_settings.h +++ b/pcbnew/dialogs/dialog_pns_settings.h @@ -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; diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 3ddda1b339..92cea7e9f7 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -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 );