Add patch for GpgOL to fix language in conf dlg
authorAndre Heinecke <aheinecke@intevation.de>
Tue, 16 Oct 2018 12:24:06 +0000 (14:24 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Tue, 16 Oct 2018 12:24:06 +0000 (14:24 +0200)
* patches/gpgol-2.3.1/
0001-Pass-lang-correctly-to-config-dialog.patch:
New.

Makefile.am
patches/gpgol-2.1.1/0001-Disable-OL-2013-2016-resiliency-for-us.patch [deleted file]
patches/gpgol-2.1.1/0001-Launch-Kleopatra-config-dialog-with-parent.patch [deleted file]
patches/gpgol-2.3.1/0001-Pass-lang-correctly-to-config-dialog.patch [new file with mode: 0755]

index 9fc7ec3..44b282b 100644 (file)
@@ -33,8 +33,7 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/glib-2.41.5/01-socket.patch \
         patches/glib-2.41.5/02-formatsec.patch \
         patches/gpa-0.9.10/0001-w32-Make-location-of-locale-dir-more-flexible.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 \
+        patches/gpgol-2.3.1/0001-Pass-lang-correctly-to-config-dialog.patch \
         patches/kconfigwidgets/0001-Make-QDbus-optional.patch \
         patches/kconfigwidgets/0002-Crudely-remove-KF5Auth-depedency.patch \
         patches/kiconthemes/0001-Make-DBus-optional.patch \
diff --git a/patches/gpgol-2.1.1/0001-Disable-OL-2013-2016-resiliency-for-us.patch b/patches/gpgol-2.1.1/0001-Disable-OL-2013-2016-resiliency-for-us.patch
deleted file mode 100755 (executable)
index 863720a..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-#! /bin/sh
-patch -p1 -l -f $* < $0
-exit $?
-
-From 8635193d010812d0bff2ee64e6c8e47f1ef43164 Mon Sep 17 00:00:00 2001
-From: Andre Heinecke <aheinecke@intevation.de>
-Date: Fri, 27 Apr 2018 08:29:13 +0200
-Subject: [PATCH] Disable OL 2013 / 2016 resiliency for us
-
-* src/gpgoladdin.cpp (setupDoNotDisable): New.
-(addGpgOLToReg): New helper.
-
---
-While this should not be necessrary if we don't crash, well
-in the real world it happens and then users have the problem
-that they have to manually renable GpgOL and report it
-as an issue.
-
-With this GpgOL should no longer be disabled in Outlook
-2013 and 2016. 2010 does not have this auto disable.
-
-GnuPG-Bug-Id: T3938
----
- src/gpgoladdin.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 73 insertions(+)
-
-diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp
-index 6f393ca..6525598 100644
---- a/src/gpgoladdin.cpp
-+++ b/src/gpgoladdin.cpp
-@@ -246,6 +246,77 @@ GpgolAddin::QueryInterface (REFIID riid, LPVOID* ppvObj)
-   return hr;
- }
-
-+static void
-+addGpgOLToReg (const std::string &path)
-+{
-+  HKEY h;
-+  int err = RegOpenKeyEx (HKEY_CURRENT_USER, path.c_str(), 0,
-+                          KEY_ALL_ACCESS, &h);
-+  if (err != ERROR_SUCCESS)
-+    {
-+      log_debug ("%s:%s: no DoNotDisableAddinList entry '%s' creating it",
-+                 SRCNAME, __func__, path.c_str ());
-+      err = RegCreateKeyEx (HKEY_CURRENT_USER, path.c_str (), 0, NULL,
-+                            REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,
-+                            &h, NULL);
-+    }
-+  if (err != ERROR_SUCCESS)
-+    {
-+      log_error ("%s:%s: failed to create key.",
-+                 SRCNAME, __func__);
-+      return;
-+    }
-+
-+  DWORD type;
-+  err = RegQueryValueEx (h, GPGOL_PROGID, NULL, &type, NULL, NULL);
-+  if (err == ERROR_SUCCESS)
-+    {
-+      log_debug ("%s:%s: Found gpgol reg key. Leaving it unchanged.",
-+                 SRCNAME, __func__);
-+      RegCloseKey (h);
-+      return;
-+    }
-+
-+  // No key exists. Create one.
-+  DWORD dwTemp = 1;
-+  err = RegSetValueEx (h, GPGOL_PROGID, 0, REG_DWORD, (BYTE*)&dwTemp, 4);
-+  RegCloseKey (h);
-+
-+  if (err != ERROR_SUCCESS)
-+    {
-+      log_error ("%s:%s: failed to set registry value.",
-+                 SRCNAME, __func__);
-+    }
-+  else
-+    {
-+      log_debug ("%s:%s: added gpgol to %s",
-+                 SRCNAME, __func__, path.c_str ());
-+    }
-+}
-+
-+/* This is a bit evil as we basically disable outlooks resiliency
-+   for us. But users are still able to manually disable the addon
-+   or change the donotdisable setting to zero and we won't change
-+   it.
-+
-+   It has been much requested by users that we do this automatically.
-+*/
-+static void
-+setupDoNotDisable ()
-+{
-+  std::string path = "Software\\Microsoft\\Office\\";
-+  path += std::to_string (g_ol_version_major);
-+  path += ".0\\Outlook\\Resiliency\\DoNotDisableAddinList";
-+
-+  addGpgOLToReg (path);
-+
-+  path = "Software\\Microsoft\\Office\\";
-+  path += std::to_string (g_ol_version_major);
-+  path += ".0\\Outlook\\Resiliency\\AddinList";
-+
-+  addGpgOLToReg (path);
-+}
-+
- STDMETHODIMP
- GpgolAddin::OnConnection (LPDISPATCH Application, ext_ConnectMode ConnectMode,
-                           LPDISPATCH AddInInst, SAFEARRAY ** custom)
-@@ -284,6 +355,8 @@ GpgolAddin::OnConnection (LPDISPATCH Application, ext_ConnectMode ConnectMode,
-     }
-   engine_init ();
-
-+  setupDoNotDisable ();
-+
-   if (ConnectMode != ext_cm_Startup)
-     {
-       OnStartupComplete (custom);
---
-2.11.0
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
deleted file mode 100755 (executable)
index d61a0fb..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#! /bin/sh
-patch -p1 -l -f $* < $0
-exit $?
-
-From 07811afb552bfc1e51aea25a39cb52327831198b Mon Sep 17 00:00:00 2001
-From: Andre Heinecke <aheinecke@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
diff --git a/patches/gpgol-2.3.1/0001-Pass-lang-correctly-to-config-dialog.patch b/patches/gpgol-2.3.1/0001-Pass-lang-correctly-to-config-dialog.patch
new file mode 100755 (executable)
index 0000000..d801ea8
--- /dev/null
@@ -0,0 +1,30 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 50e65b8425e2dece5dc791269bc564168bf819e1 Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Tue, 16 Oct 2018 14:14:29 +0200
+Subject: [PATCH] Pass lang correctly to config dialog
+
+* src/addin-options.cpp (open_gpgolconfig): Pass lang.
+---
+ src/addin-options.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/addin-options.cpp b/src/addin-options.cpp
+index d82b095..137d880 100644
+--- a/src/addin-options.cpp
++++ b/src/addin-options.cpp
+@@ -185,6 +185,9 @@ open_gpgolconfig (LPVOID arg)
+   args.push_back (std::string("--gpgol-version"));
+   args.push_back (std::string(VERSION));
+
++  args.push_back (std::string ("--lang"));
++  args.push_back (std::string (gettext_localename ()));
++
+   auto ctx = GpgME::Context::createForEngine (GpgME::SpawnEngine);
+   if (!ctx)
+     {
+--
+2.11.0