1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-12-28 18:36:02 +00:00

prompt to delete atmosphere/contents, cleanups

This commit is contained in:
flb 2021-02-15 19:31:06 +01:00
parent 4c880f3d99
commit a7a62dfffd
9 changed files with 19 additions and 17 deletions

View file

@ -76,7 +76,7 @@
#define FW_DIRECTORY_PATH "/firmware/"
#define HIDE_TABS_JSON "/config/aio-switch-updater/hide_tabs.json"
#define MOVE_FILES_JSON "/config/aio-switch-updater/move_files.json"
#define COPY_FILES_JSON "/config/aio-switch-updater/copy_files.json"
#define ROMFS_FORWARDER "romfs:/aiosu-forwarder.nro"
#define FORWARDER_PATH "/config/aio-switch-updater/aiosu-forwarder.nro"

View file

@ -235,7 +235,9 @@
"tool_copyFiles": "Batch copy files",
"files_not_found": "The following files were not found and couldn't be copied:\n",
"move_files_not_found": "This tool allows you to copy files to other locations, which may be needed for your bootloader/trinket. Grab move_files.json at 'https://git.io/aiosu_move_files' and add it to your config folder. This will also be performed after updates."
"copy_files_not_found": "This tool allows you to copy files to other locations, which may be needed for your bootloader/trinket. Grab copy_files.json at 'https://git.io/aiosu_copy_files' and add it to your config folder. This will also be performed after updates.",
"delete_contents": "Would you like to remove the existing '/atmosphere/contents/' directory? This will prevent crashes if you have sysmodules that do not support the latest Atmosphère. Please note that it will delete all your existing sysmodules and cheats."

View file

@ -26,9 +26,7 @@ ConfirmPage::ConfirmPage(brls::StagedAppletFrame* frame, std::string text, bool
this->label->setHorizontalAlign(NVG_ALIGN_CENTER);
this->label->setParent(this);
this->registerAction("", brls::Key::B, [this] {
return true;
});
this->registerAction("", brls::Key::B, [this] { return true; });
}
void ConfirmPage::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned height, brls::Style* style, brls::FrameContext* ctx)

View file

@ -38,6 +38,8 @@ DialoguePage::DialoguePage(brls::StagedAppletFrame* frame, std::string text)
this->button2,
brls::FocusDirection::LEFT,
this->button1);
this->registerAction("", brls::Key::B, [this] { return true; });
}
void DialoguePage::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned height, brls::Style* style, brls::FrameContext* ctx)

View file

@ -51,8 +51,6 @@ MainFrame::MainFrame() : TabFrame()
this->addTab("menus/main_tools"_i18n , new ToolsTab(tag));
this->registerAction("" , brls::Key::B, [this] {
return true;
});
this->registerAction("" , brls::Key::B, [this] { return true; });
}

View file

@ -153,11 +153,11 @@ ToolsTab::ToolsTab(std::string tag) : brls::List()
move->getClickEvent()->subscribe([&](brls::View* view){
chdir("/");
std::string error = "";
if(std::filesystem::exists(MOVE_FILES_JSON)){
error = copyFiles(MOVE_FILES_JSON);
if(std::filesystem::exists(COPY_FILES_JSON)){
error = copyFiles(COPY_FILES_JSON);
}
else{
error = "menus/move_files_not_found"_i18n;
error = "menus/copy_files_not_found"_i18n;
}
brls::Dialog* dialog = new brls::Dialog(error);
brls::GenericEvent::Callback callback = [dialog](brls::View* view) {

View file

@ -180,15 +180,17 @@ void extractArchive(archiveType type, std::string tag){
break;
case ams_cfw:
if(isArchive(AMS_FILENAME)){
overwriteInis = showDialogBox("menus/ultils_overwrite"_i18n , "menus/utils_no"_i18n , "menus/utils_yes"_i18n );
if(showDialogBox("menus/ultils_overwrite"_i18n , "menus/utils_no"_i18n , "menus/utils_yes"_i18n) == 0)
overwriteInis = showDialogBox("menus/ultils_overwrite"_i18n , "menus/utils_no"_i18n, "menus/utils_yes"_i18n);
usleep(800000);
int deleteContents = showDialogBox("menus/delete_contents"_i18n , "menus/utils_no"_i18n , "menus/utils_yes"_i18n);
if(deleteContents == 1)
removeDir(AMS_CONTENTS);
extract(AMS_FILENAME, ROOT_PATH, overwriteInis);
}
break;
}
if(std::filesystem::exists(MOVE_FILES_JSON))
copyFiles(MOVE_FILES_JSON);
if(std::filesystem::exists(COPY_FILES_JSON))
copyFiles(COPY_FILES_JSON);
}
void progressTest(std::string url, archiveType type){
@ -208,7 +210,6 @@ std::string formatListItemTitle(const std::string str, size_t maxScore) {
return str.substr(0, i-1) + "\u2026";
}
}
return str;
}
@ -366,7 +367,7 @@ std::string readVersion(const char* path){
std::string copyFiles(const char* path) {
nlohmann::json toMove;
std::ifstream f(MOVE_FILES_JSON);
std::ifstream f(COPY_FILES_JSON);
f >> toMove;
f.close();
std::string error = "";

View file

@ -21,6 +21,7 @@ WorkerPage::WorkerPage(brls::StagedAppletFrame* frame, const std::string& text,
this->button->setParent(this);
this->registerAction("", brls::Key::B, [this] { return true; });
this->registerAction("", brls::Key::A, [this] { return true; });
}
void WorkerPage::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned height, brls::Style* style, brls::FrameContext* ctx)