From 8dd41a1ffa0dd68fcd30a979e10ac4183033ead3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Thu, 7 Apr 2022 16:39:16 +0200 Subject: [PATCH] adapt interface to newer modals --- services/modals/src/api.rs | 5 ----- services/modals/src/main.rs | 13 ++++++------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/services/modals/src/api.rs b/services/modals/src/api.rs index dbeedf8e5..a91522185 100644 --- a/services/modals/src/api.rs +++ b/services/modals/src/api.rs @@ -28,11 +28,6 @@ pub struct ManagedListItem { pub struct ManagedPromptWithTextResponse { pub token: [u32; 4], pub prompt: xous_ipc::String::<1024>, - /// SID of a validator - pub validator: Option<[u32; 4]>, - /// the opcode to pass the validator - pub validator_op: u32, - /// the amount of fields to read pub fields: u32, /// placeholders pub placeholders: Option<[Option>; 10]>, diff --git a/services/modals/src/main.rs b/services/modals/src/main.rs index 3e74ecd55..5ba2c8371 100644 --- a/services/modals/src/main.rs +++ b/services/modals/src/main.rs @@ -82,11 +82,10 @@ fn xmain() -> ! { let mut dr: Option = None; // build the core data structure here - let text_action = TextEntry { - action_conn: renderer_cid, - action_opcode: Opcode::TextEntryReturn.to_u32().unwrap(), - ..Default::default() - }; + let mut text_action: TextEntry = Default::default(); + text_action.action_conn = renderer_cid; + text_action.action_opcode = Opcode::TextEntryReturn.to_u32().unwrap(); + let mut fixed_items = Vec::::new(); let notification = gam::modal::Notification::new( renderer_cid, @@ -106,7 +105,7 @@ fn xmain() -> ! { let mut renderer_modal = Modal::new( gam::SHARED_MODAL_NAME, - ActionType::TextEntry(text_action), + ActionType::TextEntry(text_action.clone()), Some("Placeholder"), None, GlyphStyle::Regular, @@ -305,7 +304,7 @@ fn xmain() -> ! { #[cfg(feature="tts")] tts.tts_simple(config.prompt.as_str().unwrap()).unwrap(); renderer_modal.modify( - Some(ActionType::TextEntry(text_action)), + Some(ActionType::TextEntry(text_action.clone())), Some(config.prompt.as_str().unwrap()), false, None, true, None );