2020-09-20 01:21:28 +01:00
|
|
|
#include "tools_tab.hpp"
|
|
|
|
|
|
|
|
ToolsTab::ToolsTab() : brls::List()
|
|
|
|
{
|
2020-09-26 15:55:24 +01:00
|
|
|
cheats = new brls::ListItem("Cheats menu");
|
|
|
|
cheats->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new CheatsPage());
|
2020-09-20 01:21:28 +01:00
|
|
|
});
|
2020-09-26 15:55:24 +01:00
|
|
|
this->addView(cheats);
|
2020-09-20 01:21:28 +01:00
|
|
|
|
|
|
|
JCcolor = new brls::ListItem("Change the Joy-Cons color");
|
|
|
|
JCcolor->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new JCPage());
|
|
|
|
});
|
|
|
|
this->addView(JCcolor);
|
|
|
|
|
2020-09-26 15:55:24 +01:00
|
|
|
downloadPayload = new brls::ListItem("Dowload payloads to " + std::string(BOOTLOADER_PL_PATH));
|
|
|
|
downloadPayload->getClickEvent()->subscribe([&](brls::View* view){
|
2020-09-21 19:36:46 +01:00
|
|
|
brls::Application::pushView(new DownloadPayloadPage());
|
|
|
|
});
|
2020-09-26 15:55:24 +01:00
|
|
|
this->addView(downloadPayload);
|
2020-09-21 19:36:46 +01:00
|
|
|
|
2020-09-23 12:21:05 +01:00
|
|
|
rebootPayload = new brls::ListItem("Inject payload");
|
2020-09-21 19:36:46 +01:00
|
|
|
rebootPayload->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new PayloadPage());
|
|
|
|
});
|
|
|
|
this->addView(rebootPayload);
|
|
|
|
|
2020-09-20 21:58:40 +01:00
|
|
|
std::string tag = getLatestTag(TAGS_INFO);
|
|
|
|
if(!tag.empty()){
|
|
|
|
updateApp = new brls::ListItem("Update the app (v" + tag +")");
|
|
|
|
std::string text("Downloading:\nAIO-switch-updater\n\nFrom:\n" + std::string(APP_URL));
|
|
|
|
updateApp->getClickEvent()->subscribe([&, text](brls::View* view) {
|
|
|
|
brls::StagedAppletFrame* stagedFrame = new brls::StagedAppletFrame();
|
|
|
|
stagedFrame->setTitle("Updating app");
|
|
|
|
stagedFrame->addStage(
|
|
|
|
new ConfirmPage(stagedFrame, text)
|
|
|
|
);
|
|
|
|
stagedFrame->addStage(
|
|
|
|
new WorkerPage(stagedFrame, "Downloading...", [](){downloadArchive(APP_URL, app);})
|
|
|
|
);
|
|
|
|
stagedFrame->addStage(
|
|
|
|
new WorkerPage(stagedFrame, "Extracting....", [](){extractArchive(app);})
|
|
|
|
);
|
|
|
|
stagedFrame->addStage(
|
|
|
|
new ConfirmPage(stagedFrame, "All done!", true)
|
|
|
|
);
|
|
|
|
brls::Application::pushView(stagedFrame);
|
|
|
|
});
|
|
|
|
this->addView(updateApp);
|
|
|
|
}
|
2020-09-23 12:21:05 +01:00
|
|
|
|
|
|
|
changelog = new brls::ListItem("Changelog");
|
|
|
|
changelog->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new ChangelogPage());
|
|
|
|
});
|
|
|
|
this->addView(changelog);
|
2020-09-20 01:21:28 +01:00
|
|
|
}
|