[PATCH] Improve clarity/uniformity in compose menu's crypto display
# HG changeset patch
# User David Champion <dgc@xxxxxxxxxxxx>
# Date 1271103184 18000
# Branch HEAD
# Node ID b2fcb8d467224cb229274c88a62cc2a8802125d6
# Parent 2cd62f40d8409007ecd596e8bd4a14eb225778cc
Improve clarity/uniformity in compose menu's crypto display
diff -r 2cd62f40d840 -r b2fcb8d46722 compose.c
--- a/compose.c Sun Apr 11 20:00:38 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 -- press (p)GP or (S)/MIME"));
- 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>"));