From 7851f7f4007c4f5d34a805cfcc17acf30dca3b9f Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Thu, 1 May 2025 18:28:35 +0100 Subject: [PATCH] add option to extract zip to root, better name extract / compress options. --- sphaira/source/ui/menus/filebrowser.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sphaira/source/ui/menus/filebrowser.cpp b/sphaira/source/ui/menus/filebrowser.cpp index c6d4fad..e4f4718 100644 --- a/sphaira/source/ui/menus/filebrowser.cpp +++ b/sphaira/source/ui/menus/filebrowser.cpp @@ -552,7 +552,7 @@ Menu::Menu(const std::vector& nro_entries) : MenuBase{"FileBrowser"_i1 if (m_entries_current.size()) { if (check_all_ext(ZIP_EXTENSIONS)) { - options->Add(std::make_shared("Extract"_i18n, [this](){ + options->Add(std::make_shared("Extract zip"_i18n, [this](){ auto options = std::make_shared("Extract Options"_i18n, Sidebar::Side::RIGHT); ON_SCOPE_EXIT(App::Push(options)); @@ -564,6 +564,19 @@ Menu::Menu(const std::vector& nro_entries) : MenuBase{"FileBrowser"_i1 } })); + options->Add(std::make_shared("Extract to root"_i18n, [this](){ + App::Push(std::make_shared("Are you sure you want to extract to root?"_i18n, + "No"_i18n, "Yes"_i18n, 0, [this](auto op_index){ + if (op_index && *op_index) { + if (!m_selected_count) { + UnzipFile("/", GetEntry()); + } else { + UnzipFiles("/", GetSelectedEntries()); + } + } + })); + })); + options->Add(std::make_shared("Extract to..."_i18n, [this](){ std::string out; if (R_SUCCEEDED(swkbd::ShowText(out, "Enter the path to the folder to extract into", fs::AppendPath(m_path, ""))) && !out.empty()) { @@ -578,7 +591,7 @@ Menu::Menu(const std::vector& nro_entries) : MenuBase{"FileBrowser"_i1 } if (!check_all_ext(ZIP_EXTENSIONS) || m_selected_count) { - options->Add(std::make_shared("Compress"_i18n, [this](){ + options->Add(std::make_shared("Compress to zip"_i18n, [this](){ auto options = std::make_shared("Compress Options"_i18n, Sidebar::Side::RIGHT); ON_SCOPE_EXIT(App::Push(options));