From 1951df97db5ed774845f494287576032ae7188a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20L=C3=B6hr?= <julian.loehr@outlook.com>
Date: Tue, 16 Aug 2016 02:29:44 +0200
Subject: [PATCH] Change Input Config Dialogs to have only one 'Close' button

---
 Source/Core/DolphinWX/InputConfigDiag.cpp | 14 ++++++++++----
 Source/Core/DolphinWX/InputConfigDiag.h   |  3 ++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/Source/Core/DolphinWX/InputConfigDiag.cpp b/Source/Core/DolphinWX/InputConfigDiag.cpp
index 62efa38430..14a0068cc9 100644
--- a/Source/Core/DolphinWX/InputConfigDiag.cpp
+++ b/Source/Core/DolphinWX/InputConfigDiag.cpp
@@ -202,10 +202,15 @@ void InputConfigDialog::UpdateControlReferences()
   }
 }
 
-void InputConfigDialog::ClickSave(wxCommandEvent& event)
+void InputConfigDialog::OnClose(wxCloseEvent& event)
 {
   m_config.SaveConfig();
-  event.Skip();
+  EndModal(wxID_OK);
+}
+
+void InputConfigDialog::OnCloseButton(wxCommandEvent& event)
+{
+  Close();
 }
 
 int ControlDialog::GetRangeSliderValue() const
@@ -1097,11 +1102,12 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputConfig& config
   UpdateDeviceComboBox();
   UpdateProfileComboBox();
 
-  Bind(wxEVT_BUTTON, &InputConfigDialog::ClickSave, this, wxID_OK);
+  Bind(wxEVT_CLOSE_WINDOW, &InputConfigDialog::OnClose, this);
+  Bind(wxEVT_BUTTON, &InputConfigDialog::OnCloseButton, this, wxID_CLOSE);
 
   wxBoxSizer* const szr = new wxBoxSizer(wxVERTICAL);
   szr->Add(m_pad_notebook, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 5);
-  szr->Add(CreateButtonSizer(wxOK | wxCANCEL | wxNO_DEFAULT), 0, wxEXPAND | wxALL, 5);
+  szr->Add(CreateButtonSizer(wxCLOSE), 0, wxEXPAND | wxALL, 5);
 
   SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
   SetSizerAndFit(szr);
diff --git a/Source/Core/DolphinWX/InputConfigDiag.h b/Source/Core/DolphinWX/InputConfigDiag.h
index 4489099eee..1db88b284c 100644
--- a/Source/Core/DolphinWX/InputConfigDiag.h
+++ b/Source/Core/DolphinWX/InputConfigDiag.h
@@ -252,7 +252,8 @@ public:
   InputConfigDialog(wxWindow* const parent, InputConfig& config, const wxString& name,
                     const int tab_num = 0);
 
-  void ClickSave(wxCommandEvent& event);
+  void OnClose(wxCloseEvent& event);
+  void OnCloseButton(wxCommandEvent& event);
 
   void UpdateDeviceComboBox();
   void UpdateProfileComboBox();