Merge #453: gui: display aliases on installer final step

29185b5096615ec6e494e850316f279cc5ba8fa5 gui: display aliases on installer final step (jp1ac4)

Pull request description:

  This is to resolve #436.

  For the alias, I'm selecting the element from `context.keys` that has the same fingerprint as `hw` / `context.signer` and then displaying the name of this key. This logic could possibly be extracted to a function.

  I haven't yet been able to test with a hardware device, but will try to get my Specter DIY up and running soon :)

ACKs for top commit:
  edouardparis:
    ACK 29185b5096615ec6e494e850316f279cc5ba8fa5

Tree-SHA512: 5e05e4c2f27d6effca1cf5137ab0a65606fef883383ac5fd5d0d0afac901c3f350d2a3ebe51499f2e1f82c0900d66935cae370f38479f2c55189b60a4de4d338
This commit is contained in:
edouard 2023-04-18 15:11:10 +02:00
commit 11b470ebbe
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F

View File

@ -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),