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

updated rcm submodule and added timer before reboot to payload

This commit is contained in:
flb 2021-06-01 15:28:03 +02:00
parent 41db622f65
commit 6459ab4ae1
3 changed files with 18 additions and 1 deletions

@ -1 +1 @@
Subproject commit bd424fccefa768df315ae1819268d2e8864a80c2
Subproject commit 53df22c99d1fcf17ec5dce93ea787f7d84f190b6

View file

@ -1,6 +1,7 @@
#pragma once
#include <borealis.hpp>
#include <chrono>
class DialoguePage : public brls::View
{
@ -8,6 +9,7 @@ class DialoguePage : public brls::View
brls::Button* button1 = nullptr;
brls::Button* button2 = nullptr;
brls::Label* label = nullptr;
std::chrono::system_clock::time_point start = std::chrono::high_resolution_clock::now();
brls::NavigationMap navigationMap;
bool erista = true;

View file

@ -3,6 +3,7 @@
#include "main_frame.hpp"
#include "fs.hpp"
#include <filesystem>
#include <algorithm>
namespace i18n = brls::i18n;
using namespace i18n::literals;
@ -59,6 +60,18 @@ void DialoguePage::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned h
{
this->label->frame(ctx);
this->button1->frame(ctx);
auto end = std::chrono::high_resolution_clock::now();
auto missing = std::max(1l - std::chrono::duration_cast<std::chrono::seconds>(end - start).count(), 0l);
auto text = std::string("menus/common/no"_i18n);
if (missing > 0) {
this->button2->setLabel(text + " (" + std::to_string(missing) + ")");
this->button2->setState(brls::ButtonState::DISABLED);
} else {
this->button2->setLabel(text);
this->button2->setState(brls::ButtonState::ENABLED);
}
this->button2->invalidate();
this->button2->frame(ctx);
}
@ -84,6 +97,8 @@ void DialoguePage::layout(NVGcontext* vg, brls::Style* style, brls::FontStash* s
style->CrashFrame.buttonWidth,
style->CrashFrame.buttonHeight);
this->button2->invalidate();
start = std::chrono::high_resolution_clock::now() + std::chrono::milliseconds(150);
}
brls::View* DialoguePage::getDefaultFocus()