Updating Cheats manager when the ISO is changed etc.

The Cheats manager should be updated when the ISO is changed because it's non-modal

Removing code that read the ID from file because the cheats manager only has a use when an emulation is running (when the ID doesn't need to be read from the ISO again because it's in a variable). This fixes loading Gecko codes for .wad during an emulation because "VolumeHandler::GetVolume()" return false in this case
This commit is contained in:
John Peterson 2013-05-04 19:27:39 +02:00
commit 7cc2e3146b
5 changed files with 57 additions and 22 deletions

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "GeckoCodeDiag.h"
#include "Core.h"
#include "WxUtils.h"
#include <SFML/Network/Http.hpp>
@ -59,10 +60,10 @@ CodeConfigPanel::CodeConfigPanel(wxWindow* const parent)
SetSizerAndFit(sizer_main);
}
void CodeConfigPanel::UpdateCodeList()
void CodeConfigPanel::UpdateCodeList(bool checkRunning)
{
// disable the button if it doesn't have an effect
btn_download->Enable(!m_gameid.empty());
btn_download->Enable((!checkRunning || Core::IsRunning()) && !m_gameid.empty());
m_listbox_gcodes->Clear();
// add the codes to the listbox
@ -80,14 +81,15 @@ void CodeConfigPanel::UpdateCodeList()
UpdateInfoBox(evt);
}
void CodeConfigPanel::LoadCodes(const IniFile& inifile, const std::string& gameid)
void CodeConfigPanel::LoadCodes(const IniFile& inifile, const std::string& gameid, bool checkRunning)
{
m_gameid = gameid;
m_gcodes.clear();
Gecko::LoadCodes(inifile, m_gcodes);
if (!checkRunning || Core::IsRunning())
Gecko::LoadCodes(inifile, m_gcodes);
UpdateCodeList();
UpdateCodeList(checkRunning);
}
void CodeConfigPanel::ToggleCode(wxCommandEvent& evt)