[Gpg4win-commits] [git] Gpg4win - branch, master, updated. gpg4win-3.1.0-11-g595b1bf

by Andre Heinecke cvs at cvs.gnupg.org
Mon Apr 30 11:48:36 CEST 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 for Windows".

The branch, master has been updated
       via  595b1bfa37db6ae7471515888fe221c60ec1ebbe (commit)
      from  d3b7807fdaa29e420c936a3934667589b527cc92 (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 595b1bfa37db6ae7471515888fe221c60ec1ebbe
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Apr 30 11:47:55 2018 +0200

    Add patch for GpgOL to better open conf
    
    * Makefile.am (EXTRA_DIST): Add it.
    * patches/gpgol-2.1.1/
    0001-Launch-Kleopatra-config-dialog-with-parent.patch: New.

diff --git a/Makefile.am b/Makefile.am
index a3cd2b8..c08e2d4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,7 +47,8 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \
         patches/gpa-0.9.10/0001-w32-Make-location-of-locale-dir-more-flexible.patch \
         patches/libgpg-error-1.29/0001-doc-Fix-yat2m-build-for-cross-compilation.patch \
-        patches/gpgol-2.1.1/0001-Disable-OL-2013-2016-resiliency-for-us.patch
+        patches/gpgol-2.1.1/0001-Disable-OL-2013-2016-resiliency-for-us.patch \
+        patches/gpgol-2.1.1/0001-Launch-Kleopatra-config-dialog-with-parent.patch
 
 
 copy-news:
diff --git a/patches/gpgol-2.1.1/0001-Launch-Kleopatra-config-dialog-with-parent.patch b/patches/gpgol-2.1.1/0001-Launch-Kleopatra-config-dialog-with-parent.patch
new file mode 100755
index 0000000..d61a0fb
--- /dev/null
+++ b/patches/gpgol-2.1.1/0001-Launch-Kleopatra-config-dialog-with-parent.patch
@@ -0,0 +1,113 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 07811afb552bfc1e51aea25a39cb52327831198b Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke at intevation.de>
+Date: Mon, 30 Apr 2018 11:44:54 +0200
+Subject: [PATCH] Launch Kleopatra config dialog with parent
+
+* src/addin-options.cpp (launch_kleo_config): New.
+(options_window_proc): Use it.
+
+--
+This fixes that the config dialog might be opened in the
+background, or that the assuan communication fails.
+
+Fixes
+GnuPG-Bug-Id: T3946
+---
+ src/addin-options.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 63 insertions(+), 1 deletion(-)
+
+diff --git a/src/addin-options.cpp b/src/addin-options.cpp
+index 32b47eb..6677a30 100644
+--- a/src/addin-options.cpp
++++ b/src/addin-options.cpp
+@@ -27,6 +27,11 @@
+ #include "common.h"
+ #include "engine.h"
+
++#include <string>
++
++#include <gpgme++/context.h>
++#include <gpgme++/data.h>
++
+ /* To avoid writing a dialog template for each language we use gettext
+    for the labels and hope that there is enough space in the dialog to
+    fit the longest translation.. */
+@@ -77,6 +82,63 @@ enable_disable_opts (HWND hDlg)
+   xfree (uiserver);
+ }
+
++static void
++launch_kleo_config (HWND hDlg)
++{
++  char *uiserver = get_uiserver_name ();
++  bool showError = false;
++  if (uiserver)
++    {
++      std::string path (uiserver);
++      xfree (uiserver);
++      if (path.find("kleopatra.exe") != std::string::npos)
++        {
++        size_t dpos;
++        if ((dpos = path.find(" --daemon")) != std::string::npos)
++            {
++              path.erase(dpos, strlen(" --daemon"));
++            }
++          auto ctx = GpgME::Context::createForEngine(GpgME::SpawnEngine);
++          if (!ctx)
++            {
++              log_error ("%s:%s: No spawn engine.",
++                         SRCNAME, __func__);
++            }
++            std::string parentWid = std::to_string ((int) (intptr_t) hDlg);
++            const char *argv[] = {path.c_str(),
++                                  "--config",
++                                  "--parent-windowid",
++                                  parentWid.c_str(),
++                                  NULL };
++            log_debug ("%s:%s: Starting %s %s %s",
++                       SRCNAME, __func__, path.c_str(), argv[1], argv[2]);
++            GpgME::Data d(GpgME::Data::null);
++            ctx->spawnAsync(path.c_str(), argv, d, d,
++                            d, (GpgME::Context::SpawnFlags) (
++                                GpgME::Context::SpawnAllowSetFg |
++                                GpgME::Context::SpawnShowWindow));
++        }
++      else
++        {
++          showError = true;
++        }
++    }
++  else
++    {
++      showError = true;
++    }
++
++  if (showError)
++    {
++      MessageBox (NULL,
++                  _("Could not find Kleopatra.\n"
++                  "Please reinstall Gpg4win with the Kleopatra component enabled."),
++                  _("GpgOL"),
++                  MB_ICONINFORMATION|MB_OK);
++    }
++
++}
++
+ static INT_PTR CALLBACK
+ options_window_proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+ {
+@@ -149,7 +211,7 @@ options_window_proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+                 break;
+               }
+             case IDC_GPG_CONF:
+-              engine_start_confdialog (hDlg);
++              launch_kleo_config (hDlg);
+               break;
+             case IDC_GPG_OPTIONS:
+               config_dialog_box (hDlg);
+--
+2.11.0

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                                        |   3 +-
 ...aunch-Kleopatra-config-dialog-with-parent.patch | 113 +++++++++++++++++++++
 2 files changed, 115 insertions(+), 1 deletion(-)
 create mode 100755 patches/gpgol-2.1.1/0001-Launch-Kleopatra-config-dialog-with-parent.patch


hooks/post-receive
-- 
GnuPG for Windows
http://git.gnupg.org



More information about the Gpg4win-commits mailing list