This repository has been archived on 2026-06-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PatchExtractor/source/patch_activity.hpp
niklascfw abea3f8765
All checks were successful
Build NRO / build (push) Successful in 1m44s
Fix self-delete to run only after successful extraction (v1.1.1).
Only remove PatchExtractor.nro on exit when the Done screen was reached;
early quit no longer deletes the NRO. Drop the ineffective mid-run self-delete.
2026-05-28 22:46:02 +02:00

43 lines
1.1 KiB
C++

#pragma once
#include <borealis.hpp>
#include <memory>
#include "extractor.hpp"
class PatchActivity : public brls::Activity {
public:
PatchActivity();
~PatchActivity() override;
brls::View* createContentView() override;
void onContentAvailable() override;
/** True only after a finished extraction (Done screen was reached). */
static bool shouldDeleteSelfOnExit();
private:
enum class Screen { Error, Ready, Extracting, Done };
void showScreen(Screen screen);
void startExtraction();
void onExtractTick();
void updateProgressUi();
bool onExtractClicked(brls::View* view);
brls::AppletFrame* frame = nullptr;
brls::Box* contentBox = nullptr;
brls::Label* titleLabel = nullptr;
brls::Label* messageLabel = nullptr;
brls::Label* detailLabel = nullptr;
brls::Label* progressLabel = nullptr;
brls::Box* progressTrack = nullptr;
brls::Rectangle* progressFill = nullptr;
brls::Button* actionButton = nullptr;
std::unique_ptr<PatchExtractor> extractor;
brls::RepeatingTimer extractTimer;
Screen currentScreen = Screen::Ready;
};