mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 05:51:19 +12:00
Update title manager when clearing MLC path in settings (#319)
This commit is contained in:
parent
9df1325d14
commit
dd1cb1cccf
4 changed files with 34 additions and 18 deletions
|
@ -376,6 +376,24 @@ void CemuApp::CreateDefaultFiles(bool first_start)
|
|||
}
|
||||
|
||||
|
||||
bool CemuApp::TrySelectMLCPath(std::wstring path)
|
||||
{
|
||||
if (path.empty())
|
||||
path = ActiveSettings::GetDefaultMLCPath().wstring();
|
||||
|
||||
if (!TestWriteAccess(fs::path{ path }))
|
||||
return false;
|
||||
|
||||
GetConfig().SetMLCPath(path);
|
||||
CemuApp::CreateDefaultFiles();
|
||||
|
||||
// update TitleList and SaveList scanner with new MLC path
|
||||
CafeTitleList::SetMLCPath(path);
|
||||
CafeTitleList::Refresh();
|
||||
CafeSaveList::SetMLCPath(path);
|
||||
CafeSaveList::Refresh();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CemuApp::SelectMLCPath(wxWindow* parent)
|
||||
{
|
||||
|
@ -394,21 +412,15 @@ bool CemuApp::SelectMLCPath(wxWindow* parent)
|
|||
|
||||
const auto path = path_dialog.GetPath().ToStdWstring();
|
||||
|
||||
if (!TestWriteAccess(fs::path{ path }))
|
||||
if (!TrySelectMLCPath(path))
|
||||
{
|
||||
const auto result = wxMessageBox(_("Cemu can't write to the selected mlc path!\nDo you want to select another path?"), _("Error"), wxYES_NO | wxCENTRE | wxICON_ERROR);
|
||||
if (result == wxYES)
|
||||
continue;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
config.SetMLCPath(path);
|
||||
// update TitleList and SaveList scanner with new MLC path
|
||||
CafeTitleList::SetMLCPath(path);
|
||||
CafeTitleList::Refresh();
|
||||
CafeSaveList::SetMLCPath(path);
|
||||
CafeSaveList::Refresh();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue