[git] GpgOL - branch, master, updated. gpgol-1.4.0-237-g3cfdd11
by Andre Heinecke
cvs at cvs.gnupg.org
Fri Jan 6 13:35:50 CET 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".
The branch, master has been updated
via 3cfdd110a195ed02059d533d43fdb66da56d1852 (commit)
from 474f02a9278b8755bd99ba79fa018212be08baf1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3cfdd110a195ed02059d533d43fdb66da56d1852
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Fri Jan 6 13:32:21 2017 +0100
Update crypto summary and lvl2 icon
* src/dialogs.rc: Use the same icon for lvl2 and 3
* src/mail.cpp (Mail::get_crypto_summary): Change wording.
(Mail::get_crypto_summary): Fix comment.
(Mail::get_crypto_one_line): New. Move one liner also into
mail class.
(Mail::get_crypto_details): Minor wording change.
* src/mail.h: Update accordingly.
* src/ribbon-callbacks.cpp (get_sig_ttip): Use one liner funct.
--
The difference between trusted / certified highly trusted
is more confusing then just using "Level" imo. Different
security levels are a real world concept and are hopefully
understandable.
diff --git a/src/dialogs.rc b/src/dialogs.rc
index ba8cb8c..a99eee3 100644
--- a/src/dialogs.rc
+++ b/src/dialogs.rc
@@ -54,12 +54,14 @@ IDI_ENCSIGN_FILE_48_PNG RCDATA "icons/encrypt-sign-file-48.png"
IDI_LEVEL_0_ENC RCDATA "icons/level-0-enc.png"
IDI_LEVEL_1_ENC RCDATA "icons/level-1-enc.png"
-IDI_LEVEL_2_ENC RCDATA "icons/level-2-enc.png"
+
+/* We use the same icon for level 2 and 3 */
+IDI_LEVEL_2_ENC RCDATA "icons/level-3-enc.png"
IDI_LEVEL_3_ENC RCDATA "icons/level-3-enc.png"
IDI_LEVEL_4_ENC RCDATA "icons/level-4-enc.png"
IDI_LEVEL_0 RCDATA "icons/level-0.png"
IDI_LEVEL_1 RCDATA "icons/level-1.png"
-IDI_LEVEL_2 RCDATA "icons/level-2.png"
+IDI_LEVEL_2 RCDATA "icons/level-3.png"
IDI_LEVEL_3 RCDATA "icons/level-3.png"
IDI_LEVEL_4 RCDATA "icons/level-4.png"
diff --git a/src/mail.cpp b/src/mail.cpp
index 71eec62..95df6fd 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1474,21 +1474,29 @@ Mail::get_crypto_summary ()
const int level = get_signature_level ();
bool enc = is_encrypted ();
- if (level > 3 && enc)
+ if (level == 4 && enc)
{
- return _("Highly Secure");
+ return _("Security Level 4");
}
- if (level > 3)
+ if (level == 4)
+ {
+ return _("Trust Level 4");
+ }
+ if (level == 3 && enc)
+ {
+ return _("Security Level 3");
+ }
+ if (level == 3)
{
- return _("Highly Trusted");
+ return _("Trust Level 3");
}
- if (level >= 2 && enc)
+ if (level == 2 && enc)
{
- return _("Secure");
+ return _("Security Level 2");
}
- if (level >= 2)
+ if (level == 2)
{
- return _("Trusted");
+ return _("Trust Level 2");
}
if (enc)
{
@@ -1499,13 +1507,37 @@ Mail::get_crypto_summary ()
/* Even if it is signed, if it is not validly
signed it's still completly insecure as anyone
could have signed this. So we avoid the label
- "signed" here as this already leaves */
+ "signed" here as this word already implies some
+ security. */
return _("Insecure");
}
return _("Insecure");
}
std::string
+Mail::get_crypto_one_line()
+{
+ bool sig = is_signed ();
+ bool enc = is_encrypted ();
+ if (sig || enc)
+ {
+ if (sig && enc)
+ {
+ return _("Signed and encrypted message");
+ }
+ else if (sig)
+ {
+ return _("Signed message");
+ }
+ else if (enc)
+ {
+ return _("Encrypted message");
+ }
+ }
+ return _("Insecure message");
+}
+
+std::string
Mail::get_crypto_details()
{
/* Handle encrypt only */
@@ -1586,7 +1618,7 @@ Mail::get_crypto_details()
char *time = format_date_from_gpgme (first_contact);
/* i18n note signcount is always pulral because with signcount 1 we
* would not be in this branch. */
- gpgrt_asprintf (&buf, _("The senders address is trustworthy, because "
+ gpgrt_asprintf (&buf, _("The senders address is trusted, because "
"you have established a communication history "
"with this address starting on %s.\n"
"You encrypted %i and verified %i messages since."),
diff --git a/src/mail.h b/src/mail.h
index 0767df4..bba161a 100644
--- a/src/mail.h
+++ b/src/mail.h
@@ -260,6 +260,10 @@ public:
crypto state of this mail. */
std::string get_crypto_details ();
+ /** Returns a localized string describing a one line
+ summary of the crypto state. */
+ std::string get_crypto_one_line ();
+
/** Get the icon id of the appropiate icon for this mail */
int get_crypto_icon_id () const;
diff --git a/src/ribbon-callbacks.cpp b/src/ribbon-callbacks.cpp
index 3817184..503c773 100644
--- a/src/ribbon-callbacks.cpp
+++ b/src/ribbon-callbacks.cpp
@@ -1552,20 +1552,9 @@ HRESULT get_sig_ttip (LPDISPATCH ctrl, VARIANT *result)
result->vt = VT_BSTR;
wchar_t *w_result;
- if (mail && (mail->is_signed () || mail->is_encrypted ()))
+ if (mail)
{
- if (mail->is_signed () && mail->is_encrypted ())
- {
- w_result = utf8_to_wchar (_("Signed and encrypted message"));
- }
- else if (mail->is_signed ())
- {
- w_result = utf8_to_wchar (_("Signed message"));
- }
- else if (mail->is_encrypted ())
- {
- w_result = utf8_to_wchar (_("Encrypted message"));
- }
+ w_result = utf8_to_wchar (mail->get_crypto_one_line().c_str());
}
else
{
-----------------------------------------------------------------------
Summary of changes:
src/dialogs.rc | 6 ++++--
src/mail.cpp | 52 ++++++++++++++++++++++++++++++++++++++----------
src/mail.h | 4 ++++
src/ribbon-callbacks.cpp | 15 ++------------
4 files changed, 52 insertions(+), 25 deletions(-)
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list