diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2017-04-25 23:29:48 +0200 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2017-04-25 23:34:32 +0200 |
| commit | 3124f3c4d8ac67937693e90056a8f7410dedbb16 (patch) | |
| tree | 0966f1a351bb78dc0f597b1441ad61dfb9bfb9ce /Source/Core/DolphinWX/FrameTools.cpp | |
| parent | 4d52df150bfb20f4892d364f00e52944ec3d3473 (diff) | |
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.
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 " |
