Add Dump Path to Configuration Menu

This commit is contained in:
Chris Burgener
2016-06-25 11:24:43 -04:00
parent 28a3691e70
commit e92ff9d09f
5 changed files with 41 additions and 3 deletions

View File

@ -87,6 +87,20 @@ void SConfig::SaveSettings()
m_SYSCONF->Save();
}
namespace
{
void CreateDumpPath(const std::string& path)
{
if (path.empty())
return;
File::SetUserPath(D_DUMP_IDX, path + '/');
File::CreateFullPath(File::GetUserPath(D_DUMPAUDIO_IDX));
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX));
File::CreateFullPath(File::GetUserPath(D_DUMPFRAMES_IDX));
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
}
} // namespace
void SConfig::SaveGeneralSettings(IniFile& ini)
{
IniFile::Section* general = ini.GetOrCreateSection("General");
@ -114,6 +128,8 @@ void SConfig::SaveGeneralSettings(IniFile& ini)
general->Set("RecursiveISOPaths", m_RecursiveISOFolder);
general->Set("NANDRootPath", m_NANDPath);
general->Set("DumpPath", m_DumpPath);
CreateDumpPath(m_DumpPath);
general->Set("WirelessMac", m_WirelessMac);
#ifdef USE_GDBSTUB
@ -381,6 +397,8 @@ void SConfig::LoadGeneralSettings(IniFile& ini)
general->Get("NANDRootPath", &m_NANDPath);
File::SetUserPath(D_WIIROOT_IDX, m_NANDPath);
general->Get("DumpPath", &m_DumpPath);
CreateDumpPath(m_DumpPath);
general->Get("WirelessMac", &m_WirelessMac);
}
@ -653,6 +671,7 @@ void SConfig::LoadDefaults()
m_strUniqueID = "00000000";
m_revision = 0;
}
static const char* GetRegionOfCountry(DiscIO::IVolume::ECountry country)
{
switch (country)