Fix Outlook 2010 TabComposeTools error
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 16 Nov 2017 08:42:59 +0000 (09:42 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Thu, 16 Nov 2017 08:42:59 +0000 (09:42 +0100)
* src/gpgoladdin.cpp (GetCustomUI_mime): Handle OL2010
differently.

--
For OL2010 we don't have an inline editor so no TabComposeTools.

GnuPG-Bug-ID: T3441

src/gpgoladdin.cpp

index 0f3d0d9..d8931de 100644 (file)
@@ -911,7 +911,7 @@ GetCustomUI_MIME (BSTR RibbonID, BSTR * RibbonXml)
     }
   /* We don't use this code currently because calling the send
      event for Inline Response mailitems fails. */
-  else if (!wcscmp (RibbonID, L"Microsoft.Outlook.Explorer"))
+  else if (!wcscmp (RibbonID, L"Microsoft.Outlook.Explorer") && g_ol_version_major > 14)
     {
       gpgrt_asprintf (&buffer,
         "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\""
@@ -986,6 +986,39 @@ GetCustomUI_MIME (BSTR RibbonID, BSTR * RibbonXml)
         optsSTip
         );
     }
+  else if (!wcscmp (RibbonID, L"Microsoft.Outlook.Explorer"))
+    {
+      // No TabComposeTools in Outlook 2010
+      gpgrt_asprintf (&buffer,
+        "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\""
+        " onLoad=\"ribbonLoaded\">"
+        " <ribbon>"
+        "   <tabs>"
+        "    <tab idMso=\"TabMail\">"
+        "     <group id=\"general_read\""
+        "            label=\"%s\">"
+        "       <button id=\"idSigned\""
+        "               getImage=\"btnSigstateLarge\""
+        "               size=\"large\""
+        "               getLabel=\"getSigLabel\""
+        "               getScreentip=\"getSigTip\""
+        "               getSupertip=\"getSigSTip\""
+        "               onAction=\"launchDetails\""
+        "               getEnabled=\"getIsDetailsEnabled\"/>"
+        "       <dialogBoxLauncher>"
+        "         <button id=\"optsBtn_read\""
+        "                 onAction=\"openOptions\""
+        "                 screentip=\"%s\"/>"
+        "       </dialogBoxLauncher>"
+        "     </group>"
+        "    </tab>"
+        "   </tabs>"
+        " </ribbon>"
+        "</customUI>",
+        _("GpgOL"),
+        optsSTip
+        );
+    }
 
   if (buffer)
     {