From ee95e10128b635188854c8cbe54bda4bba442b38 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 1 Oct 2015 06:07:40 +0200 Subject: [PATCH] Make sure the OK button is the default item for the Connect dialog refs #10042 --- icinga-studio/IcingaStudio.fbp | 2 +- icinga-studio/connectform.cpp | 2 ++ icinga-studio/forms.cpp | 3 --- icinga-studio/forms.h | 3 +++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/icinga-studio/IcingaStudio.fbp b/icinga-studio/IcingaStudio.fbp index 33038d07a..09adf7e3e 100644 --- a/icinga-studio/IcingaStudio.fbp +++ b/icinga-studio/IcingaStudio.fbp @@ -1575,7 +1575,7 @@ 0 m_Buttons - none + protected diff --git a/icinga-studio/connectform.cpp b/icinga-studio/connectform.cpp index 1a38ee1b3..ab282ea69 100644 --- a/icinga-studio/connectform.cpp +++ b/icinga-studio/connectform.cpp @@ -52,6 +52,8 @@ ConnectForm::ConnectForm(wxWindow *parent, const Url::Ptr& url) m_PortText->SetValue(hostport[1]); else m_PortText->SetValue("5665"); + + SetDefaultItem(m_ButtonsOK); } Url::Ptr ConnectForm::GetUrl(void) const diff --git a/icinga-studio/forms.cpp b/icinga-studio/forms.cpp index ec3b25ff3..b1e052f94 100644 --- a/icinga-studio/forms.cpp +++ b/icinga-studio/forms.cpp @@ -142,9 +142,6 @@ ConnectFormBase::ConnectFormBase( wxWindow* parent, wxWindowID id, const wxStrin wxBoxSizer* m_ButtonsSizer; m_ButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - wxStdDialogButtonSizer* m_Buttons; - wxButton* m_ButtonsOK; - wxButton* m_ButtonsCancel; m_Buttons = new wxStdDialogButtonSizer(); m_ButtonsOK = new wxButton( m_ButtonsPanel, wxID_OK ); m_Buttons->AddButton( m_ButtonsOK ); diff --git a/icinga-studio/forms.h b/icinga-studio/forms.h index 613b7d469..c125ecbbb 100644 --- a/icinga-studio/forms.h +++ b/icinga-studio/forms.h @@ -77,6 +77,9 @@ class ConnectFormBase : public wxDialog wxTextCtrl* m_PortText; wxTextCtrl* m_UserText; wxTextCtrl* m_PasswordText; + wxStdDialogButtonSizer* m_Buttons; + wxButton* m_ButtonsOK; + wxButton* m_ButtonsCancel; public: -- 2.40.0