mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
add warn when enable stealth mode & add nav valid check (#1823)
* add warn when enable stealth * change FLASH ERROR to FLASH ERR cuz previous one were overlapped with date * check if nav is valid
This commit is contained in:
parent
a4f6bbda5e
commit
8068517808
@ -315,8 +315,15 @@ SystemStatusView::SystemStatusView(
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
toggle_stealth.on_change = [this](bool v) {
|
toggle_stealth.on_change = [this, &nav](bool v) {
|
||||||
pmem::set_stealth_mode(v);
|
pmem::set_stealth_mode(v);
|
||||||
|
if (nav.is_valid() && v) {
|
||||||
|
nav.display_modal(
|
||||||
|
"Stealth",
|
||||||
|
"You just enabled stealth mode.\n"
|
||||||
|
"When you transmit,\n"
|
||||||
|
"screen will turn off;\n");
|
||||||
|
}
|
||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -553,7 +560,7 @@ InformationView::InformationView(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (firmware_checksum_error()) {
|
if (firmware_checksum_error()) {
|
||||||
version.set("FLASH ERROR");
|
version.set("FLASH ERR");
|
||||||
version.set_style(&Styles::red);
|
version.set_style(&Styles::red);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,6 +592,10 @@ bool NavigationView::is_top() const {
|
|||||||
return view_stack.size() == 1;
|
return view_stack.size() == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NavigationView::is_valid() const {
|
||||||
|
return view_stack.size() != 0; // work around to check if nav is valid, not elegant i know. so TODO
|
||||||
|
}
|
||||||
|
|
||||||
View* NavigationView::push_view(std::unique_ptr<View> new_view) {
|
View* NavigationView::push_view(std::unique_ptr<View> new_view) {
|
||||||
free_view();
|
free_view();
|
||||||
|
|
||||||
|
@ -94,6 +94,7 @@ class NavigationView : public View {
|
|||||||
NavigationView& operator=(NavigationView&&) = delete;
|
NavigationView& operator=(NavigationView&&) = delete;
|
||||||
|
|
||||||
bool is_top() const;
|
bool is_top() const;
|
||||||
|
bool is_valid() const;
|
||||||
|
|
||||||
template <class T, class... Args>
|
template <class T, class... Args>
|
||||||
T* push(Args&&... args) {
|
T* push(Args&&... args) {
|
||||||
|
Loading…
Reference in New Issue
Block a user