2020-09-20 01:21:28 +01:00
|
|
|
#include "tools_tab.hpp"
|
2020-10-05 23:53:12 +01:00
|
|
|
|
|
|
|
namespace i18n = brls::i18n;
|
|
|
|
using namespace i18n::literals;
|
2020-09-29 15:41:43 +01:00
|
|
|
ToolsTab::ToolsTab(std::string tag) : brls::List()
|
2020-09-20 01:21:28 +01:00
|
|
|
{
|
2020-10-05 23:53:12 +01:00
|
|
|
cheats = new brls::ListItem("menus/tool_cheats"_i18n );
|
2020-09-26 15:55:24 +01:00
|
|
|
cheats->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new CheatsPage());
|
2020-09-20 01:21:28 +01:00
|
|
|
});
|
2020-10-05 16:14:10 +01:00
|
|
|
cheats->setHeight(LISTITEM_HEIGHT);
|
2020-09-26 15:55:24 +01:00
|
|
|
this->addView(cheats);
|
2020-09-20 01:21:28 +01:00
|
|
|
|
2020-10-05 23:53:12 +01:00
|
|
|
JCcolor = new brls::ListItem("menus/tool_change"_i18n );
|
2020-09-20 01:21:28 +01:00
|
|
|
JCcolor->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new JCPage());
|
|
|
|
});
|
2020-10-05 16:14:10 +01:00
|
|
|
JCcolor->setHeight(LISTITEM_HEIGHT);
|
2020-09-20 01:21:28 +01:00
|
|
|
this->addView(JCcolor);
|
|
|
|
|
2020-10-05 23:53:12 +01:00
|
|
|
downloadPayload = new brls::ListItem("menus/tool_download"_i18n + std::string(BOOTLOADER_PL_PATH));
|
2020-09-26 15:55:24 +01:00
|
|
|
downloadPayload->getClickEvent()->subscribe([&](brls::View* view){
|
2020-09-21 19:36:46 +01:00
|
|
|
brls::Application::pushView(new DownloadPayloadPage());
|
|
|
|
});
|
2020-10-06 14:19:19 +01:00
|
|
|
downloadPayload->setHeight(LISTITEM_HEIGHT);
|
2020-09-26 15:55:24 +01:00
|
|
|
this->addView(downloadPayload);
|
2020-09-21 19:36:46 +01:00
|
|
|
|
2020-10-05 23:53:12 +01:00
|
|
|
rebootPayload = new brls::ListItem("menus/tool_inject"_i18n );
|
2020-09-21 19:36:46 +01:00
|
|
|
rebootPayload->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new PayloadPage());
|
|
|
|
});
|
2020-10-05 16:14:10 +01:00
|
|
|
rebootPayload->setHeight(LISTITEM_HEIGHT);
|
2020-09-21 19:36:46 +01:00
|
|
|
this->addView(rebootPayload);
|
|
|
|
|
2020-09-28 19:50:21 +01:00
|
|
|
if(!tag.empty() && tag != APP_VERSION){
|
2020-10-05 23:53:12 +01:00
|
|
|
updateApp = new brls::ListItem("menus/tool_update"_i18n + tag +")");
|
|
|
|
std::string text("menus/tool_DownLoad"_i18n + std::string(APP_URL));
|
2020-09-20 21:58:40 +01:00
|
|
|
updateApp->getClickEvent()->subscribe([&, text](brls::View* view) {
|
|
|
|
brls::StagedAppletFrame* stagedFrame = new brls::StagedAppletFrame();
|
2020-10-05 23:53:12 +01:00
|
|
|
stagedFrame->setTitle("menus/tool_updating"_i18n );
|
2020-09-20 21:58:40 +01:00
|
|
|
stagedFrame->addStage(
|
|
|
|
new ConfirmPage(stagedFrame, text)
|
|
|
|
);
|
|
|
|
stagedFrame->addStage(
|
2020-10-05 23:53:12 +01:00
|
|
|
new WorkerPage(stagedFrame, "menus/tool_downloading"_i18n , [](){downloadArchive(APP_URL, app);})
|
2020-09-20 21:58:40 +01:00
|
|
|
);
|
|
|
|
stagedFrame->addStage(
|
2020-10-05 23:53:12 +01:00
|
|
|
new WorkerPage(stagedFrame, "menus/tool_extracting"_i18n , [](){extractArchive(app);})
|
2020-09-20 21:58:40 +01:00
|
|
|
);
|
|
|
|
stagedFrame->addStage(
|
2020-10-05 23:53:12 +01:00
|
|
|
new ConfirmPage(stagedFrame, "menus/tool_all_done"_i18n , true)
|
2020-09-20 21:58:40 +01:00
|
|
|
);
|
|
|
|
brls::Application::pushView(stagedFrame);
|
|
|
|
});
|
2020-10-05 16:14:10 +01:00
|
|
|
updateApp->setHeight(LISTITEM_HEIGHT);
|
2020-09-20 21:58:40 +01:00
|
|
|
this->addView(updateApp);
|
|
|
|
}
|
2020-09-23 12:21:05 +01:00
|
|
|
|
2020-10-05 23:53:12 +01:00
|
|
|
changelog = new brls::ListItem("menus/tool_changelog"_i18n );
|
2020-09-23 12:21:05 +01:00
|
|
|
changelog->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new ChangelogPage());
|
|
|
|
});
|
2020-10-05 16:14:10 +01:00
|
|
|
changelog->setHeight(LISTITEM_HEIGHT);
|
2020-09-23 12:21:05 +01:00
|
|
|
this->addView(changelog);
|
2020-10-05 01:59:46 +01:00
|
|
|
|
2020-10-05 23:53:12 +01:00
|
|
|
/* language = new brls::ListItem("menus/Language_Option"_i18n );
|
2020-10-05 01:59:46 +01:00
|
|
|
language->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
brls::Application::pushView(new LanguageOptionPage());
|
|
|
|
});
|
2020-10-05 16:14:10 +01:00
|
|
|
language->setHeight(LISTITEM_HEIGHT);
|
2020-10-05 23:53:12 +01:00
|
|
|
this->addView(language); */
|
2020-09-20 01:21:28 +01:00
|
|
|
}
|