From 52d1c93777b565e7cb489dee2af4954b03b81965 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 6 May 2020 20:49:58 +0100 Subject: [PATCH] Use standard OK/Cancel paradigm rather than Apply/Cancel. Apply/Cancel puts the buttons in a different order on some platforms. Fixes https://gitlab.com/kicad/code/kicad/issues/4332 --- pcbnew/dialogs/dialog_exchange_footprints.cpp | 6 +++--- pcbnew/dialogs/dialog_exchange_footprints.h | 2 +- pcbnew/dialogs/dialog_exchange_footprints_base.cpp | 8 ++++---- pcbnew/dialogs/dialog_exchange_footprints_base.fbp | 6 +++--- pcbnew/dialogs/dialog_exchange_footprints_base.h | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 6b513031ce..c79e8dbd99 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -150,8 +150,8 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent, // Ensure m_closeButton (with id = wxID_CANCEL) has the right label // (to fix automatic renaming of button label ) m_sdbSizerCancel->SetLabel( _( "Close" ) ); - - m_sdbSizerApply->SetDefault(); + m_sdbSizerOK->SetLabel( verb ); + m_sdbSizerOK->SetDefault(); // Now all widgets have the size fixed, call FinishDialogSettings FinishDialogSettings(); @@ -286,7 +286,7 @@ void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked( wxCommandEvent& event ) } -void DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClicked( wxCommandEvent& event ) +void DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked( wxCommandEvent& event ) { wxBusyCursor dummy; diff --git a/pcbnew/dialogs/dialog_exchange_footprints.h b/pcbnew/dialogs/dialog_exchange_footprints.h index 4351b0f5e2..5dca684789 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.h +++ b/pcbnew/dialogs/dialog_exchange_footprints.h @@ -54,7 +54,7 @@ private: void OnMatchRefClicked( wxCommandEvent& event ) override; void OnMatchValueClicked( wxCommandEvent& event ) override; void OnMatchIDClicked( wxCommandEvent& event ) override; - void OnApplyClicked( wxCommandEvent& event ) override; + void OnOKClicked( wxCommandEvent& event ) override; void ViewAndSelectFootprint( wxCommandEvent& event ) override; wxRadioButton* getRadioButtonForMode(); diff --git a/pcbnew/dialogs/dialog_exchange_footprints_base.cpp b/pcbnew/dialogs/dialog_exchange_footprints_base.cpp index f79470b2d5..191ea168ee 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints_base.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints_base.cpp @@ -120,8 +120,8 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare m_mainSizer->Add( m_MessageWindow, 5, wxEXPAND|wxRIGHT|wxLEFT, 10 ); m_sdbSizer = new wxStdDialogButtonSizer(); - m_sdbSizerApply = new wxButton( this, wxID_APPLY ); - m_sdbSizer->AddButton( m_sdbSizerApply ); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); @@ -148,7 +148,7 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare m_specifiedID->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchIDClicked ), NULL, this ); m_specifiedIDBrowseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::ViewAndSelectFootprint ), NULL, this ); m_newIDBrowseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::ViewAndSelectFootprint ), NULL, this ); - m_sdbSizerApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnApplyClicked ), NULL, this ); + m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnOKClicked ), NULL, this ); } DIALOG_EXCHANGE_FOOTPRINTS_BASE::~DIALOG_EXCHANGE_FOOTPRINTS_BASE() @@ -168,6 +168,6 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::~DIALOG_EXCHANGE_FOOTPRINTS_BASE() m_specifiedID->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchIDClicked ), NULL, this ); m_specifiedIDBrowseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::ViewAndSelectFootprint ), NULL, this ); m_newIDBrowseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::ViewAndSelectFootprint ), NULL, this ); - m_sdbSizerApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnApplyClicked ), NULL, this ); + m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnOKClicked ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_exchange_footprints_base.fbp b/pcbnew/dialogs/dialog_exchange_footprints_base.fbp index 840416b79d..cd021bd667 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints_base.fbp +++ b/pcbnew/dialogs/dialog_exchange_footprints_base.fbp @@ -1314,18 +1314,18 @@ wxEXPAND|wxALL 0 - 1 + 0 1 0 0 0 - 0 + 1 0 0 m_sdbSizer protected - OnApplyClicked + OnOKClicked diff --git a/pcbnew/dialogs/dialog_exchange_footprints_base.h b/pcbnew/dialogs/dialog_exchange_footprints_base.h index e73eb03337..6d01937bb6 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints_base.h +++ b/pcbnew/dialogs/dialog_exchange_footprints_base.h @@ -66,7 +66,7 @@ class DIALOG_EXCHANGE_FOOTPRINTS_BASE : public DIALOG_SHIM wxCheckBox* m_reset3DModels; WX_HTML_REPORT_PANEL* m_MessageWindow; wxStdDialogButtonSizer* m_sdbSizer; - wxButton* m_sdbSizerApply; + wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class @@ -77,7 +77,7 @@ class DIALOG_EXCHANGE_FOOTPRINTS_BASE : public DIALOG_SHIM virtual void OnMatchValueClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnMatchIDClicked( wxCommandEvent& event ) { event.Skip(); } virtual void ViewAndSelectFootprint( wxCommandEvent& event ) { event.Skip(); } - virtual void OnApplyClicked( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOKClicked( wxCommandEvent& event ) { event.Skip(); } public: