fixup! feat(core/rust): boot sequence in rust

pull/2521/head
tychovrahe 4 months ago
parent ca03b71a5b
commit 2dd0b4fa2e

@ -27,7 +27,7 @@ disp_i8080_8bit_dw = [] # write pixels directly to peripheral
disp_i8080_16bit_dw = [] # write pixels directly to peripheral disp_i8080_16bit_dw = [] # write pixels directly to peripheral
debug = ["ui_debug"] debug = ["ui_debug"]
sbu = [] sbu = []
sd_card = ["sd_card_hotswap"] sd_card = []
sd_card_hotswap = [] sd_card_hotswap = []
rgb_led = [] rgb_led = []
backlight = [] backlight = []

@ -1,3 +1,5 @@
#![allow(unused_imports)]
use super::ffi; use super::ffi;
pub use super::ffi::{BTN_EVT_DOWN, BTN_EVT_UP, BTN_LEFT, BTN_RIGHT}; pub use super::ffi::{BTN_EVT_DOWN, BTN_EVT_UP, BTN_LEFT, BTN_RIGHT};

@ -16,6 +16,8 @@ use crate::ui::{
}, },
}; };
#[cfg(all(feature = "sd_card", not(feature = "sd_card_hotswap")))]
use crate::ui::model::component::CancelConfirmMsg;
#[cfg(all(feature = "sd_card", not(feature = "sd_card_hotswap")))] #[cfg(all(feature = "sd_card", not(feature = "sd_card_hotswap")))]
use crate::ui::model_tt::component::IconDialog; use crate::ui::model_tt::component::IconDialog;
@ -59,7 +61,7 @@ pub fn insert_sd_card() -> bool {
icon, icon,
StrBuffer::from("SD CARD REQUIRED"), StrBuffer::from("SD CARD REQUIRED"),
theme::button_bar( theme::button_bar(
Button::with_text(StrBuffer::from("OK")) Button::with_text(StrBuffer::from("TRY AGAIN"))
.styled(theme::button_default()) .styled(theme::button_default())
.map(|msg| { .map(|msg| {
(matches!(msg, ButtonMsg::Clicked)).then(|| CancelConfirmMsg::Confirmed) (matches!(msg, ButtonMsg::Clicked)).then(|| CancelConfirmMsg::Confirmed)
@ -81,7 +83,7 @@ pub fn retry_wrong_card() -> bool {
let title_str = StrBuffer::from("WRONG SD CARD"); let title_str = StrBuffer::from("WRONG SD CARD");
let title = Label::left_aligned(title_str, theme::TEXT_BOLD).vertically_centered(); let title = Label::left_aligned(title_str, theme::TEXT_BOLD).vertically_centered();
let msg = Label::left_aligned( let msg = Label::left_aligned(
StrBuffer::from("Please insert your SD card."), StrBuffer::from("Please insert the correct SD card for this device."),
theme::TEXT_NORMAL, theme::TEXT_NORMAL,
); );
@ -116,7 +118,7 @@ pub fn retry_wrong_card() -> bool {
icon, icon,
StrBuffer::from("WRONG SD CARD"), StrBuffer::from("WRONG SD CARD"),
theme::button_bar( theme::button_bar(
Button::with_text(StrBuffer::from("OK")) Button::with_text(StrBuffer::from("TRY AGAIN"))
.styled(theme::button_default()) .styled(theme::button_default())
.map(|msg| { .map(|msg| {
(matches!(msg, ButtonMsg::Clicked)).then(|| CancelConfirmMsg::Confirmed) (matches!(msg, ButtonMsg::Clicked)).then(|| CancelConfirmMsg::Confirmed)
@ -135,14 +137,14 @@ pub fn retry_wrong_card() -> bool {
#[cfg(feature = "sd_card")] #[cfg(feature = "sd_card")]
pub fn retry_sd_card() -> bool { pub fn retry_sd_card() -> bool {
let title_str = StrBuffer::from("SD CARD FAILURE"); let title_str = StrBuffer::from("SD CARD PROBLEM");
let title = Label::left_aligned(title_str, theme::TEXT_BOLD).vertically_centered(); let title = Label::left_aligned(title_str, theme::TEXT_BOLD).vertically_centered();
let msg = Label::left_aligned( let msg = Label::left_aligned(
StrBuffer::from("Please insert your SD card."), StrBuffer::from("There was a problem accessing the SD card."),
theme::TEXT_NORMAL, theme::TEXT_NORMAL,
); );
let left = Button::with_text("CANCEL").styled(theme::button_default()); let left = Button::with_text("ABORT").styled(theme::button_default());
let right = Button::with_text("RETRY").styled(theme::button_confirm()); let right = Button::with_text("RETRY").styled(theme::button_confirm());
let mut layout = RustLayout::new(Confirm::new( let mut layout = RustLayout::new(Confirm::new(

Loading…
Cancel
Save