[git] GpgOL - branch, async-enc, updated. gpgol-2.0.6-44-g9017cf6
by Andre Heinecke
cvs at cvs.gnupg.org
Tue Feb 20 15:15:03 CET 2018
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, async-enc has been updated
via 9017cf6fb9c78a83d9d5d08d886c41878444369b (commit)
via 569f4065d0863ac8c44c9f9c07fcd3b89ba4f7cb (commit)
from 1a1c949670faf05f1f1ea1b1f66ca808e9c026dd (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 9017cf6fb9c78a83d9d5d08d886c41878444369b
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Tue Feb 20 15:13:03 2018 +0100
Use gpgol_message_box in wks-helper
* src/wks-helper.cpp (WKSHelper::notify),
(WKSHelper::start_publish): Use gpgol_message_box.
--
You eat with your eyes ;-)
diff --git a/src/wks-helper.cpp b/src/wks-helper.cpp
index d993a11..753de8d 100644
--- a/src/wks-helper.cpp
+++ b/src/wks-helper.cpp
@@ -271,13 +271,12 @@ WKSHelper::notify (const char *cBox) const
if (state == NeedsPublish)
{
- wchar_t * w_title = utf8_to_wchar (_("GpgOL: Key directory available!"));
- wchar_t * w_desc = utf8_to_wchar (_("Your mail provider supports a key directory.\n\n"
+ if (gpgol_message_box (get_active_hwnd (),
+ _("Your mail provider supports a key directory.\n\n"
"Register your key in that directory to make\n"
"it easier for others to send you encrypted mail.\n\n\n"
- "Register Key?"));
- if (MessageBoxW (get_active_hwnd (),
- w_desc, w_title, MB_ICONINFORMATION | MB_YESNO) == IDYES)
+ "Register Key?"),
+ _("GpgOL: Key directory available!"), MB_YESNO) == IDYES)
{
start_publish (mbox);
}
@@ -285,9 +284,6 @@ WKSHelper::notify (const char *cBox) const
{
update_state (mbox, PublishDenied);
}
-
- xfree (w_desc);
- xfree (w_title);
return;
}
else
@@ -360,10 +356,10 @@ WKSHelper::start_publish (const std::string &mbox) const
if (data.empty ())
{
- MessageBox (get_active_hwnd (),
- "WKS client failed to create publishing request.",
- _("GpgOL"),
- MB_ICONINFORMATION|MB_OK);
+ gpgol_message_box (get_active_hwnd (),
+ "WKS client failed to create publishing request.",
+ _("GpgOL"),
+ MB_OK);
return;
}
@@ -469,6 +465,6 @@ WKSHelper::send_mail (const std::string &mimeData) const
invoke_oom_method (mail, "Save", NULL);
invoke_oom_method (mail, "Send", NULL);
- log_debug ("%s:%s: Publish successful",
+ log_debug ("%s:%s: Done send mail.",
SRCNAME, __func__);
}
commit 569f4065d0863ac8c44c9f9c07fcd3b89ba4f7cb
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Tue Feb 20 15:07:24 2018 +0100
Add UTF8 and Icon Message Box helper
* src/common.c (gpgol_message_box): New.
* src/common.h (gpgol_message_box): Declare.
* src/dialogs.h, src/dialogs.rc: Add icon.
* src/icons/Makefile.am (EXTRA_DIST): Add icon.
* src/icons/lock.ico: New.
diff --git a/src/common.c b/src/common.c
index 5d4c6fb..724aebe 100644
--- a/src/common.c
+++ b/src/common.c
@@ -38,6 +38,8 @@
#include "common.h"
+#include "dialogs.h"
+
HINSTANCE glob_hinst = NULL;
void
@@ -1028,3 +1030,30 @@ is_elevated()
return ret;
}
+
+int
+gpgol_message_box (HWND parent, const char *utf8_text,
+ const char *utf8_caption, UINT type)
+{
+ wchar_t *w_text = utf8_to_wchar (utf8_text);
+ wchar_t *w_caption = utf8_to_wchar (utf8_caption);
+ int ret = 0;
+
+ MSGBOXPARAMSW mbp;
+ mbp.cbSize = sizeof (MSGBOXPARAMS);
+ mbp.hwndOwner = parent;
+ mbp.hInstance = glob_hinst;
+ mbp.lpszText = w_text;
+ mbp.lpszCaption = w_caption;
+ mbp.dwStyle = type | MB_USERICON;
+ mbp.dwLanguageId = MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT);
+ mbp.lpfnMsgBoxCallback = NULL;
+ mbp.dwContextHelpId = 0;
+ mbp.lpszIcon = (LPCWSTR) MAKEINTRESOURCE (IDI_GPGOL_LOCK_ICON);
+
+ ret = MessageBoxIndirectW (&mbp);
+
+ xfree (w_text);
+ xfree (w_caption);
+ return ret;
+}
diff --git a/src/common.h b/src/common.h
index d306d16..ed7b87a 100644
--- a/src/common.h
+++ b/src/common.h
@@ -141,6 +141,9 @@ void log_window_hierarchy (HWND window, const char *fmt,
...) __attribute__ ((format (printf,2,3)));
void bring_to_front (HWND wid);
+
+int gpgol_message_box (HWND parent, const char *utf8_text,
+ const char *utf8_caption, UINT type);
#ifdef __cplusplus
}
#endif
diff --git a/src/dialogs.h b/src/dialogs.h
index 2cce4ad..ff6466c 100644
--- a/src/dialogs.h
+++ b/src/dialogs.h
@@ -122,6 +122,7 @@
#define IDI_SIGN_ENCRYPT_40_PNG 0x6075
#define IDI_ENCRYPT_20_PNG 0x6076
#define IDI_SIGN_20_PNG 0x6077
+#define IDI_GPGOL_LOCK_ICON 0x6078
/* Status icons */
#define ENCRYPT_ICON_OFFSET 0x10
diff --git a/src/dialogs.rc b/src/dialogs.rc
index 71409da..aab9831 100644
--- a/src/dialogs.rc
+++ b/src/dialogs.rc
@@ -69,6 +69,8 @@ IDI_SIGN_ENCRYPT_40_PNG RCDATA "icons/sign-enc-40.png"
IDI_ENCRYPT_20_PNG RCDATA "icons/encrypt-20.png"
IDI_SIGN_20_PNG RCDATA "icons/sign-20.png"
+IDI_GPGOL_LOCK_ICON ICON DISCARDABLE "icons/lock.ico"
+
IDB_LOGO BITMAP DISCARDABLE "icons/logo.bmp"
IDD_GPG_OPTIONS DIALOG DISCARDABLE 0, 0, 266, 274
diff --git a/src/icons/Makefile.am b/src/icons/Makefile.am
index 71cf74c..9eaec10 100644
--- a/src/icons/Makefile.am
+++ b/src/icons/Makefile.am
@@ -31,4 +31,4 @@ EXTRA_DIST= \
level-2.svg level-2-enc.svg level-2.png level-2-enc.png \
level-3.svg level-3-enc.svg level-3.png level-3-enc.png \
level-4.svg level-4-enc.svg level-4.png level-4-enc.png \
- logo.svg logo.bmp
+ logo.svg logo.bmp lock.ico
diff --git a/src/icons/lock.ico b/src/icons/lock.ico
new file mode 100644
index 0000000..e721db7
Binary files /dev/null and b/src/icons/lock.ico differ
-----------------------------------------------------------------------
Summary of changes:
src/common.c | 29 +++++++++++++++++++++++++++++
src/common.h | 3 +++
src/dialogs.h | 1 +
src/dialogs.rc | 2 ++
src/icons/Makefile.am | 2 +-
src/icons/lock.ico | Bin 0 -> 101758 bytes
src/wks-helper.cpp | 22 +++++++++-------------
7 files changed, 45 insertions(+), 14 deletions(-)
create mode 100644 src/icons/lock.ico
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list