From 29185b5096615ec6e494e850316f279cc5ba8fa5 Mon Sep 17 00:00:00 2001 From: jp1ac4 <121959000+jp1ac4@users.noreply.github.com> Date: Mon, 17 Apr 2023 08:00:31 +0100 Subject: [PATCH] gui: display aliases on installer final step --- gui/src/installer/view.rs | 46 +++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/gui/src/installer/view.rs b/gui/src/installer/view.rs index ac29bf6e..cbdd78ac 100644 --- a/gui/src/installer/view.rs +++ b/gui/src/installer/view.rs @@ -937,26 +937,44 @@ pub fn install<'a>( acc.push( Row::new() .spacing(5) - .push(text(hw.0.to_string()).small()) + .push_maybe( + context.keys.iter().find_map(|k| { + if k.master_fingerprint == hw.1 + { + Some( + text(k.name.clone()) + .small() + .bold(), + ) + } else { + None + } + }), + ) .push( - text(format!( - "(fingerprint: {})", - hw.1 - )) - .small(), - ), + text(format!("#{}", hw.1)).small(), + ) + .push(text(hw.0.to_string()).small()), ) }, )) }) .push_maybe(context.signer.as_ref().map(|signer| { - Row::new().push(text("This computer").small()).push( - text(format!( - "(fingerprint: {})", - signer.fingerprint() - )) - .small(), - ) + Row::new() + .spacing(5) + .push_maybe(context.keys.iter().find_map(|k| { + if k.master_fingerprint == signer.fingerprint() + { + Some(text(k.name.clone()).small().bold()) + } else { + None + } + })) + .push( + text(format!("#{}", signer.fingerprint())) + .small(), + ) + .push(text("This computer").small()) })), ) .width(Length::Fill),