From 8dbe2366063f74b3f15dcdf18dcaea91e4bb1a61 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Mon, 29 Apr 2013 12:00:23 -0400 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFFixing=20or=20disabling=20the=20"Downl?= =?UTF-8?q?oad=20Codes=20(WiiRD=20Database)"=20button=20problem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Download Codes (WiiRD Database)" button is enabled (and its click return silently without an effect) when "Tools → Cheats Manager" is opened when there's a running emulation for which there's no "[Gecko]" ini section, confusing the user about the reason for not downloading codes or showing an error when there's no running emulation Solution when there's a running emulation: fix the button when there's no running emulation: disable the button (to indicate to the user that this button must be clicked elsewhere, in the ISO settings dialog, the user will realise or remember) --- Source/Core/DolphinWX/Src/CheatsWindow.cpp | 2 +- Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp | 6 +++++- Source/Core/DolphinWX/Src/GeckoCodeDiag.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/Src/CheatsWindow.cpp b/Source/Core/DolphinWX/Src/CheatsWindow.cpp index e3a51208b4..ba4918c917 100644 --- a/Source/Core/DolphinWX/Src/CheatsWindow.cpp +++ b/Source/Core/DolphinWX/Src/CheatsWindow.cpp @@ -39,7 +39,7 @@ wxCheatsWindow::wxCheatsWindow(wxWindow* const parent) { m_gameini_path = File::GetUserPath(D_GAMECONFIG_IDX) + vol->GetUniqueID() + ".ini"; m_gameini.Load(m_gameini_path); - m_geckocode_panel->LoadCodes(m_gameini); + m_geckocode_panel->LoadCodes(m_gameini, Core::g_CoreStartupParameter.GetUniqueID()); } } diff --git a/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp b/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp index 9f96956abc..12685fac75 100644 --- a/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp +++ b/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp @@ -41,7 +41,8 @@ CodeConfigPanel::CodeConfigPanel(wxWindow* const parent) // button sizer wxBoxSizer* const sizer_buttons = new wxBoxSizer(wxHORIZONTAL); - wxButton* const btn_download = new wxButton(this, -1, _("Download Codes (WiiRD Database)"), wxDefaultPosition, wxSize(128, -1)); + btn_download = new wxButton(this, -1, _("Download Codes (WiiRD Database)"), wxDefaultPosition, wxSize(128, -1)); + btn_download->Enable(false); btn_download->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeConfigPanel::DownloadCodes, this); sizer_buttons->AddStretchSpacer(1); sizer_buttons->Add(btn_download, 1, wxEXPAND); @@ -60,6 +61,9 @@ CodeConfigPanel::CodeConfigPanel(wxWindow* const parent) void CodeConfigPanel::UpdateCodeList() { + // disable the button if it doesn't have an effect + btn_download->Enable(!m_gameid.empty()); + m_listbox_gcodes->Clear(); // add the codes to the listbox std::vector::const_iterator diff --git a/Source/Core/DolphinWX/Src/GeckoCodeDiag.h b/Source/Core/DolphinWX/Src/GeckoCodeDiag.h index 8a59e09ce2..66bbdbd4bb 100644 --- a/Source/Core/DolphinWX/Src/GeckoCodeDiag.h +++ b/Source/Core/DolphinWX/Src/GeckoCodeDiag.h @@ -44,7 +44,7 @@ private: wxTextCtrl *textctrl_notes; wxListBox *listbox_codes; } m_infobox; - + wxButton* btn_download; };