aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-05-16 00:24:06 -0400
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-05-16 04:13:57 -0400
commita170aa16b6d609b5e92b41a64711a2899e457135 (patch)
tree596ef9793d37514343f23f73662327a00a4d002e /src/yuzu/main.cpp
parent9edfd88a8a4244848ae564749d591903699f9946 (diff)
main: Prevent installing base titles into NAND
Many users have been installing their base titles into NAND instead of adding them into the games list. This prevents users from installing any base titles and warns the user about the action.
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 30bb1aac79..2c8649793c 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2101,6 +2101,7 @@ void GMainWindow::OnMenuInstallToNAND() {
QStringList new_files{}; // Newly installed files that do not yet exist in the NAND
QStringList overwritten_files{}; // Files that overwrote those existing in the NAND
QStringList failed_files{}; // Files that failed to install due to errors
+ bool detected_base_install{}; // Whether a base game was attempted to be installed
ui.action_Install_File_NAND->setEnabled(false);
@@ -2126,6 +2127,7 @@ void GMainWindow::OnMenuInstallToNAND() {
while (!future.isFinished()) {
QCoreApplication::processEvents();
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
result = future.result();
@@ -2146,6 +2148,10 @@ void GMainWindow::OnMenuInstallToNAND() {
case InstallResult::Failure:
failed_files.append(QFileInfo(file).fileName());
break;
+ case InstallResult::BaseInstallAttempted:
+ failed_files.append(QFileInfo(file).fileName());
+ detected_base_install = true;
+ break;
}
--remaining;
@@ -2153,6 +2159,13 @@ void GMainWindow::OnMenuInstallToNAND() {
install_progress->close();
+ if (detected_base_install) {
+ QMessageBox::warning(
+ this, tr("Install Results"),
+ tr("To avoid possible conflicts, we discourage users from installing base games to the "
+ "NAND.\nPlease, only use this feature to install updates and DLC."));
+ }
+
const QString install_results =
(new_files.isEmpty() ? QString{}
: tr("%n file(s) were newly installed\n", "", new_files.size())) +
@@ -2214,11 +2227,14 @@ InstallResult GMainWindow::InstallNSPXCI(const QString& filename) {
const auto res =
Core::System::GetInstance().GetFileSystemController().GetUserNANDContents()->InstallEntry(
*nsp, true, qt_raw_copy);
- if (res == FileSys::InstallResult::Success) {
+ switch (res) {
+ case FileSys::InstallResult::Success:
return InstallResult::Success;
- } else if (res == FileSys::InstallResult::OverwriteExisting) {
+ case FileSys::InstallResult::OverwriteExisting:
return InstallResult::Overwrite;
- } else {
+ case FileSys::InstallResult::ErrorBaseInstall:
+ return InstallResult::BaseInstallAttempted;
+ default:
return InstallResult::Failure;
}
}