WX: Add the ability to uninstall WADs from the game list

Simple quality-of-life addition that allows "uninstalling" WADs
(removing the corresponding installed title) from the NAND.

The option is only enabled when the WAD can be uninstalled

The motivation for this is actually to encourage proper usage of the
WAD launch feature (installing it to the NAND first), so we can
drop the "direct WAD title launch" hack.
This commit is contained in:
Léo Lam
2017-04-25 23:29:48 +02:00
parent 4d52df150b
commit 3124f3c4d8
5 changed files with 60 additions and 3 deletions

View File

@ -53,6 +53,8 @@
#include "DiscIO/NANDContentLoader.h"
#include "DiscIO/NANDImporter.h"
#include "DiscIO/VolumeCreator.h"
#include "DiscIO/VolumeWad.h"
#include "DolphinWX/AboutDolphin.h"
#include "DolphinWX/Cheats/CheatsWindow.h"
@ -1228,6 +1230,31 @@ void CFrame::OnInstallWAD(wxCommandEvent& event)
}
}
void CFrame::OnUninstallWAD(wxCommandEvent&)
{
const GameListItem* file = m_GameListCtrl->GetSelectedISO();
if (!file)
return;
if (!AskYesNoT("Uninstalling the WAD will remove the currently installed version "
"of this title from the NAND without deleting its save data. Continue?"))
{
return;
}
const auto volume = DiscIO::CreateVolumeFromFilename(file->GetFileName());
u64 title_id;
volume->GetTitleID(&title_id);
if (!DiscIO::CNANDContentManager::Access().RemoveTitle(title_id, Common::FROM_CONFIGURED_ROOT))
{
PanicAlertT("Failed to remove this title from the NAND.");
return;
}
if (title_id == TITLEID_SYSMENU)
UpdateLoadWiiMenuItem();
}
void CFrame::OnImportBootMiiBackup(wxCommandEvent& WXUNUSED(event))
{
if (!AskYesNoT("Merging a new NAND over your currently selected NAND will overwrite any channels "