[PATCH] Improve clarity/uniformity in compose menu's crypto display, take 2
# HG changeset patch
# User David Champion <dgc@xxxxxxxxxxxx>
# Date 1271103184 18000
# Branch HEAD
# Node ID 41a46373ddd9f9178ac9bb18ff42354b8b40b3fb
# Parent 4d798ee2898ef5b059d05a331c01175c7556e657
Improve clarity/uniformity in compose menu's crypto display
Incorporates feedback on "Security: None" key hints.
diff -r 4d798ee2898e -r 41a46373ddd9 compose.c
--- a/compose.c Tue Apr 13 06:49:04 2010 -0700
+++ b/compose.c Mon Apr 12 15:13:04 2010 -0500
@@ -112,21 +112,13 @@
{
int off = 0;
- if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
- {
- if (!msg->security)
- mvaddstr (HDR_CRYPT, 0, "Security: ");
- else if (msg->security & APPLICATION_SMIME)
- mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
- else if (msg->security & APPLICATION_PGP)
- mvaddstr (HDR_CRYPT, 0, " PGP: ");
+ mvaddstr (HDR_CRYPT, 0, "Security: ");
+
+ if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
+ {
+ addstr(_("Not supported"));
+ return;
}
- else if ((WithCrypto & APPLICATION_SMIME))
- mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
- else if ((WithCrypto & APPLICATION_PGP))
- mvaddstr (HDR_CRYPT, 0, " PGP: ");
- else
- return;
if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))
addstr (_("Sign, Encrypt"));
@@ -135,21 +127,26 @@
else if (msg->security & SIGN)
addstr (_("Sign"));
else
- addstr (_("Clear"));
+ addstr (_("None"));
- if ((WithCrypto & APPLICATION_PGP))
- if ((msg->security & APPLICATION_PGP)
- && (msg->security & (ENCRYPT | SIGN)))
+ if ((msg->security & (ENCRYPT | SIGN)))
+ {
+ if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP))
{
if ((msg->security & INLINE))
- addstr (_(" (inline)"));
+ addstr (_(" (inline PGP)"));
else
- addstr (_(" (PGP/MIME)"));
+ addstr (_(" (PGP/MIME)"));
}
+ else if ((WithCrypto & APPLICATION_SMIME) &&
+ (msg->security & APPLICATION_SMIME))
+ addstr (_(" (S/MIME)"));
+ }
+
+ clrtoeol ();
+ move (HDR_CRYPTINFO, 0);
clrtoeol ();
- move (HDR_CRYPTINFO, 0);
- clrtoeol ();
if ((WithCrypto & APPLICATION_PGP)
&& msg->security & APPLICATION_PGP && msg->security & SIGN)
printw ("%s%s", _(" sign as: "), PgpSignAs ? PgpSignAs : _("<default>"));