diff options
| author | Léo Lam <leolino.lam@gmail.com> | 2017-04-29 22:24:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-29 22:24:41 +0200 |
| commit | 4105beb999c8b24c594bf3dea1fcdf6b5489b502 (patch) | |
| tree | c96abdc5fbf7daa1750ba4966e64560d42f85a65 /Source/Core/DolphinWX/FrameTools.cpp | |
| parent | ecf5f7d5f41bb003b13de0278cb621f53a7fde04 (diff) | |
| parent | 3124f3c4d8ac67937693e90056a8f7410dedbb16 (diff) | |
Merge pull request #5321 from leoetlino/wad-uninstall
WX: Add the ability to uninstall WADs from the game list
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/FrameTools.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 996c7770a6..9dd9c7a9a2 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -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 " |
