aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2004-11-24 05:25:03 +0000
committerDavid Shaw <[email protected]>2004-11-24 05:25:03 +0000
commit04b715e4dad23f85a38cf72950fbc96e3b33b646 (patch)
tree7cefccf89f270fe8afa106116c2f93fad5186129 /g10/trustdb.c
parent(S_IRGRP) [HAVE_DOSISH_SYSTEM]: Define to 0. (diff)
downloadgnupg-04b715e4dad23f85a38cf72950fbc96e3b33b646.tar.gz
gnupg-04b715e4dad23f85a38cf72950fbc96e3b33b646.zip
* trustdb.h, trustdb.c (uid_trust_string_fixed): New. Return a fixed-size
translatable string similar to trust_value_to_string. This allows for easier lining up of displays. * keyedit.c (show_key_with_all_names), keylist.c (list_keyblock_print): Use it here to print validity strings. * gpgv.c: Stub.
Diffstat (limited to 'g10/trustdb.c')
-rw-r--r--g10/trustdb.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index e4e8f812c..75aa75279 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -489,6 +489,34 @@ trust_letter (unsigned int value)
}
}
+/* NOTE TO TRANSLATOR: these strings are similar to those in
+ trust_value_to_string(), but are a fixed length. This is needed to
+ make attractive information listings where columns line up
+ properly. The value "10" should be the length of the strings you
+ choose to translate to. This is the length in printable
+ columns. */
+const char *
+uid_trust_string_fixed(PKT_public_key *key,PKT_user_id *uid)
+{
+ if(!key && !uid)
+ return _("10");
+ else if(uid->is_revoked)
+ return _("[ revoked]");
+ else if(uid->is_expired)
+ return _("[ expired]");
+ else if(key)
+ switch(get_validity(key,uid)&TRUST_MASK)
+ {
+ case TRUST_UNKNOWN: return _("[ unknown]");
+ case TRUST_UNDEFINED: return _("[ undef ]");
+ case TRUST_MARGINAL: return _("[marginal]");
+ case TRUST_FULLY: return _("[ full ]");
+ case TRUST_ULTIMATE: return _("[ultimate]");
+ }
+
+ return "err";
+}
+
/* The strings here are similar to those in
pkclist.c:do_edit_ownertrust() */
const char *