From 2a349f8e493ed8bb35aab30229964421e2bf1cc6 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Mon, 12 Jun 2017 22:51:21 +0100 Subject: [PATCH] PathConfigPane: Prevent an invalid index assert --- Source/Core/DolphinWX/Config/PathConfigPane.cpp | 9 ++++++++- Source/Core/DolphinWX/Config/PathConfigPane.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Config/PathConfigPane.cpp b/Source/Core/DolphinWX/Config/PathConfigPane.cpp index 866bc52956..5a0a1c1c13 100644 --- a/Source/Core/DolphinWX/Config/PathConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/PathConfigPane.cpp @@ -144,7 +144,14 @@ void PathConfigPane::BindEvents() m_wii_sdcard_filepicker->Bind(wxEVT_FILEPICKER_CHANGED, &PathConfigPane::OnSdCardPathChanged, this); - Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning); + Bind(wxEVT_UPDATE_UI, &PathConfigPane::OnEnableIfCoreNotRunning, this); +} + +void PathConfigPane::OnEnableIfCoreNotRunning(wxUpdateUIEvent& event) +{ + // Prevent the Remove button from being enabled via wxUpdateUIEvent + if (event.GetId() != m_remove_iso_path_button->GetId()) + WxEventUtils::OnEnableIfCoreNotRunning(event); } void PathConfigPane::OnISOPathSelectionChanged(wxCommandEvent& event) diff --git a/Source/Core/DolphinWX/Config/PathConfigPane.h b/Source/Core/DolphinWX/Config/PathConfigPane.h index 76a22a1586..484c6d937c 100644 --- a/Source/Core/DolphinWX/Config/PathConfigPane.h +++ b/Source/Core/DolphinWX/Config/PathConfigPane.h @@ -22,6 +22,8 @@ private: void LoadGUIValues(); void BindEvents(); + void OnEnableIfCoreNotRunning(wxUpdateUIEvent& event); + void OnISOPathSelectionChanged(wxCommandEvent&); void OnRecursiveISOCheckBoxChanged(wxCommandEvent&); void OnAddISOPath(wxCommandEvent&);