PIV bio additions

Disable dialog buttons when busy.
Show MATCH status in details view.
This commit is contained in:
Dain Nilsson 2024-08-23 17:14:44 +02:00
parent b2c432416e
commit e0c0b2ae2d
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
11 changed files with 32 additions and 11 deletions

View File

@ -500,6 +500,7 @@
}
},
"@_fingerprints": {},
"s_biometrics": null,
"l_fingerprint": "Fingerabdruck: {label}",
"@l_fingerprint": {
"placeholders": {

View File

@ -500,6 +500,7 @@
}
},
"@_fingerprints": {},
"s_biometrics": "Biometrics",
"l_fingerprint": "Fingerprint: {label}",
"@l_fingerprint": {
"placeholders": {

View File

@ -500,6 +500,7 @@
}
},
"@_fingerprints": {},
"s_biometrics": null,
"l_fingerprint": "Empreinte digitale\u00a0: {label}",
"@l_fingerprint": {
"placeholders": {

View File

@ -500,6 +500,7 @@
}
},
"@_fingerprints": {},
"s_biometrics": null,
"l_fingerprint": "指紋:{label}",
"@l_fingerprint": {
"placeholders": {

View File

@ -500,6 +500,7 @@
}
},
"@_fingerprints": {},
"s_biometrics": null,
"l_fingerprint": "Odcisk palca: {label}",
"@l_fingerprint": {
"placeholders": {

View File

@ -99,6 +99,7 @@ const appListItem95 = Key('$_prefix.95.applistitem');
// SlotMetadata body keys
const slotMetadataKeyType = Key('$_prefix.slotMetadata.keyType');
const slotMetadataBiometrics = Key('$_prefix.slotMetadata.biometrics');
// CertInfo body keys
const certInfoKeyType = Key('$_prefix.certInfo.keyType');

View File

@ -28,9 +28,10 @@ class CertInfoTable extends ConsumerWidget {
final CertInfo? certInfo;
final SlotMetadata? metadata;
final bool alwaysIncludePrivate;
final bool supportsBio;
const CertInfoTable(this.certInfo, this.metadata,
{super.key, this.alwaysIncludePrivate = false});
{super.key, this.alwaysIncludePrivate = false, this.supportsBio = false});
@override
Widget build(BuildContext context, WidgetRef ref) {
@ -46,6 +47,14 @@ class CertInfoTable extends ConsumerWidget {
metadata.keyType.getDisplayName(l10n),
keys.slotMetadataKeyType
),
if (metadata != null && supportsBio)
l10n.s_biometrics: (
[PinPolicy.matchAlways, PinPolicy.matchOnce]
.contains(metadata.pinPolicy)
? l10n.s_enabled
: l10n.s_disabled,
keys.slotMetadataBiometrics
),
if (metadata == null && alwaysIncludePrivate)
l10n.s_private_key: (l10n.s_none, keys.slotMetadataKeyType),
if (certInfo != null) ...{

View File

@ -249,11 +249,13 @@ class _GenerateKeyDialogState extends ConsumerState<GenerateKeyDialog> {
FilterChip(
label: Text(l10n.s_allow_fingerprint),
selected: _allowMatch,
onSelected: (value) {
setState(() {
_allowMatch = value;
});
},
onSelected: _generating
? null
: (value) {
setState(() {
_allowMatch = value;
});
},
),
]),
Padding(

View File

@ -315,11 +315,13 @@ class _ImportFileDialogState extends ConsumerState<ImportFileDialog> {
FilterChip(
label: Text(l10n.s_allow_fingerprint),
selected: _allowMatch,
onSelected: (value) {
setState(() {
_allowMatch = value;
});
},
onSelected: _importing
? null
: (value) {
setState(() {
_allowMatch = value;
});
},
),
],
]

View File

@ -158,6 +158,7 @@ class _PivScreenState extends ConsumerState<PivScreen> {
selected.metadata,
alwaysIncludePrivate:
pivState.supportsMetadata,
supportsBio: pivState.supportsBio,
),
if (selected.certInfo == null)
const SizedBox(height: 16)

View File

@ -98,6 +98,7 @@ class SlotDialog extends ConsumerWidget {
certInfo,
metadata,
alwaysIncludePrivate: pivState.supportsMetadata,
supportsBio: pivState.supportsBio,
),
if (certInfo == null) const SizedBox(height: 16),
],