diff --git a/gui/src/installer/prompt.rs b/gui/src/installer/prompt.rs index 7d91ea48..c08e0069 100644 --- a/gui/src/installer/prompt.rs +++ b/gui/src/installer/prompt.rs @@ -6,3 +6,4 @@ pub const DEFINE_DESCRIPTOR_SEQUENCE_TOOLTIP: &str = "Number of blocks after a coin is received \nfor which the recovery path is not available"; pub const DEFINE_DESCRIPTOR_FINGERPRINT_TOOLTIP: &str = "The alias is applied on all the keys derived from the same seed"; +pub const REGISTER_DESCRIPTOR_HELP: &str = "To be used with the wallet, a device needs the descriptor. Registration on a device is not a substitute for backing up the descriptor."; diff --git a/gui/src/installer/step/descriptor.rs b/gui/src/installer/step/descriptor.rs index 1dc8c5d5..0700876d 100644 --- a/gui/src/installer/step/descriptor.rs +++ b/gui/src/installer/step/descriptor.rs @@ -1034,6 +1034,7 @@ pub struct RegisterDescriptor { hmacs: Vec<(Fingerprint, DeviceKind, Option<[u8; 32]>)>, registered: HashSet, error: Option, + done: bool, } impl Step for RegisterDescriptor { @@ -1085,6 +1086,9 @@ impl Step for RegisterDescriptor { self.hws = Vec::new(); return self.load(); } + Message::UserActionDone(done) => { + self.done = done; + } _ => {} }; Command::none() @@ -1111,6 +1115,7 @@ impl Step for RegisterDescriptor { self.error.as_ref(), self.processing, self.chosen_hw, + self.done, ) } } diff --git a/gui/src/installer/view.rs b/gui/src/installer/view.rs index b991c028..c63cd08d 100644 --- a/gui/src/installer/view.rs +++ b/gui/src/installer/view.rs @@ -605,6 +605,7 @@ pub fn participate_xpub( ) } +#[allow(clippy::too_many_arguments)] pub fn register_descriptor<'a>( progress: (usize, usize), descriptor: String, @@ -613,10 +614,12 @@ pub fn register_descriptor<'a>( error: Option<&Error>, processing: bool, chosen_hw: Option, + done: bool, ) -> Element<'a, Message> { layout( progress, Column::new() + .max_width(1000) .push(text("Register descriptor").bold().size(50)) .push(card::simple( Column::new() @@ -628,9 +631,9 @@ pub fn register_descriptor<'a>( .on_press(Message::Clibpboard(descriptor)), ), ) - .spacing(10) - .max_width(1000), + .spacing(10), )) + .push(text(prompt::REGISTER_DESCRIPTOR_HELP)) .push_maybe(error.map(|e| card::error("Failed to register descriptor", e.to_string()))) .push( Column::new() @@ -640,7 +643,7 @@ pub fn register_descriptor<'a>( .align_items(Alignment::Center) .push( Container::new( - text(format!("{} hardware wallets connected", hws.len())) + text("Select hardware wallet to register descriptor on:") .bold(), ) .width(Length::Fill), @@ -668,12 +671,17 @@ pub fn register_descriptor<'a>( ) .width(Length::Fill), ) - .push(if processing { - button::primary(None, "Next").width(Length::Units(200)) - } else { + .push(Checkbox::new( + "I have registered the descriptor on my device(s)", + done, + Message::UserActionDone, + )) + .push(if done && !processing { button::primary(None, "Next") .on_press(Message::Next) .width(Length::Units(200)) + } else { + button::primary(None, "Next").width(Length::Units(200)) }) .width(Length::Fill) .height(Length::Fill)