diff --git a/Makefile b/Makefile index a21ac11..1b3b680 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ DATA := data INCLUDES := include /lib/borealis/library/include/borealis/extern/nlohmann APP_TITLE := All-in-One Switch Updater APP_AUTHOR := HamletDuFromage -APP_VERSION := 2.21.0 +APP_VERSION := 2.21.1 TARGET := $(notdir $(CURDIR)) ROMFS := resources diff --git a/include/extract.hpp b/include/extract.hpp index 9ff0de7..3be07a6 100644 --- a/include/extract.hpp +++ b/include/extract.hpp @@ -27,7 +27,7 @@ namespace extract { } Title; void extract( - const std::string& filename, const std::string& workingPath = ROOT_PATH, int overwriteInis = 1, std::function func = []() { return; }); + const std::string& filename, const std::string& workingPath = ROOT_PATH, bool preserveInis = false, std::function func = []() { return; }); std::vector getInstalledTitlesNs(); std::vector excludeTitles(const std::string& path, const std::vector& listedTitles); void writeTitlesToFile(const std::set& titles, const std::string& path); diff --git a/source/changelog_page.cpp b/source/changelog_page.cpp index e80336b..aaa660f 100644 --- a/source/changelog_page.cpp +++ b/source/changelog_page.cpp @@ -258,6 +258,9 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true) verTitles.push_back("v2.21.0"); changes.push_back("\uE016 Managing custom download links is now possible directly from the app.\n\uE016 Toggle/untoggle all games in cheats menu->exclude games from receiving cheat updates."); + verTitles.push_back("v2.21.0"); + changes.push_back("\uE016 Dialogs now default to not overwriting .ini files"); + for (int i = verTitles.size() - 1; i >= 0; i--) { listItem = new brls::ListItem(verTitles[i]); change = changes[i]; diff --git a/source/extract.cpp b/source/extract.cpp index 58e2fa7..5a1e323 100644 --- a/source/extract.cpp +++ b/source/extract.cpp @@ -88,7 +88,7 @@ namespace extract { } } // namespace - void extract(const std::string& archivePath, const std::string& workingPath, int overwriteInis, std::function func) + void extract(const std::string& archivePath, const std::string& workingPath, bool preserveInis, std::function func) { ensureAvailableStorage(archivePath); @@ -113,7 +113,7 @@ namespace extract { break; } if (appPath != filename) { - if ((overwriteInis == 0 && filename.substr(filename.length() - 4) == ".ini") || std::find_if(ignoreList.begin(), ignoreList.end(), [&filename](std::string ignored) { + if ((preserveInis == true && filename.substr(filename.length() - 4) == ".ini") || std::find_if(ignoreList.begin(), ignoreList.end(), [&filename](std::string ignored) { u8 res = filename.find(ignored); return (res == 0 || res == 1); }) != ignoreList.end()) { if (!std::filesystem::exists(filename)) { diff --git a/source/utils.cpp b/source/utils.cpp index 3c47e57..23caf51 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -173,21 +173,21 @@ namespace util { fs::copyFile(ROMFS_FORWARDER, FORWARDER_PATH); break; case contentType::custom: { - int overwriteInis = showDialogBoxBlocking("menus/utils/overwrite_inis"_i18n, "menus/common/no"_i18n, "menus/common/yes"_i18n); - extract::extract(CUSTOM_FILENAME, ROOT_PATH, overwriteInis); + int preserveInis = showDialogBoxBlocking("menus/utils/overwrite_inis"_i18n, "menus/common/yes"_i18n, "menus/common/no"_i18n); + extract::extract(CUSTOM_FILENAME, ROOT_PATH, preserveInis); break; } case contentType::bootloaders: { - int overwriteInis = showDialogBoxBlocking("menus/utils/overwrite_inis"_i18n, "menus/common/no"_i18n, "menus/common/yes"_i18n); - extract::extract(BOOTLOADER_FILENAME, ROOT_PATH, overwriteInis); + int preserveInis = showDialogBoxBlocking("menus/utils/overwrite_inis"_i18n, "menus/common/yes"_i18n, "menus/common/no"_i18n); + extract::extract(BOOTLOADER_FILENAME, ROOT_PATH, preserveInis); break; } case contentType::ams_cfw: { - int overwriteInis = showDialogBoxBlocking("menus/utils/overwrite_inis"_i18n, "menus/common/no"_i18n, "menus/common/yes"_i18n); + int preserveInis = showDialogBoxBlocking("menus/utils/overwrite_inis"_i18n, "menus/common/yes"_i18n, "menus/common/no"_i18n); int deleteContents = showDialogBoxBlocking("menus/ams_update/delete_sysmodules_flags"_i18n, "menus/common/no"_i18n, "menus/common/yes"_i18n); if (deleteContents == 1) removeSysmodulesFlags(AMS_CONTENTS); - extract::extract(AMS_FILENAME, ROOT_PATH, overwriteInis); + extract::extract(AMS_FILENAME, ROOT_PATH, preserveInis); break; } default: