[Libreoffice-commits] core.git: include/vcl vcl/source xmlsecurity/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Tue Jun 27 07:23:13 UTC 2017


 include/vcl/msgbox.hxx                                 |    1 +
 vcl/source/window/msgbox.cxx                           |   10 ++++++++++
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |    2 ++
 xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc |    1 +
 xmlsecurity/source/dialogs/digitalsignaturesdialog.src |    6 ++++++
 5 files changed, 20 insertions(+)

New commits:
commit 9674704cb721f600d678788aa5d9392ad410c330
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Mon Jun 26 22:20:19 2017 +0200

    gpg4libre: Show error message when signing fails
    
    Change-Id: I58f3febaaaaa225952e87ad3f092950ace37d15d
    Reviewed-on: https://gerrit.libreoffice.org/39283
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
index a76b88e4f265..01379bdcb73b 100644
--- a/include/vcl/msgbox.hxx
+++ b/include/vcl/msgbox.hxx
@@ -89,6 +89,7 @@ public:
 class VCL_DLLPUBLIC ErrorBox : public MessBox
 {
 public:
+                        ErrorBox( vcl::Window* pParent, const OUString& rMessage );
                         ErrorBox( vcl::Window* pParent, WinBits nStyle,
                                   const OUString& rMessage );
 
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index dfda1fabf11d..26012733eaf5 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -416,6 +416,16 @@ Image WarningBox::GetStandardImage()
     return ImplGetSVData()->maWinData.maMsgBoxImgList[2];
 }
 
+ErrorBox::ErrorBox( vcl::Window* pParent, const OUString& rMessage ) :
+    MessBox( pParent, WB_OK | WB_DEF_OK, OUString(), rMessage )
+{
+    // Default Text is the display title from the application
+    if ( GetText().isEmpty() )
+        SetText( Application::GetDisplayName() );
+
+    SetImage( ErrorBox::GetStandardImage() );
+}
+
 ErrorBox::ErrorBox( vcl::Window* pParent, WinBits nStyle,
                     const OUString& rMessage ) :
     MessBox( pParent, nStyle, OUString(), rMessage )
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 5f4464b8b957..3437b1255598 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -53,6 +53,7 @@
 #include "resourcemanager.hxx"
 
 #include <vcl/layout.hxx>
+#include <vcl/msgbox.hxx>
 #include <unotools/configitem.hxx>
 #include <comphelper/storagehelper.hxx>
 
@@ -434,6 +435,7 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, AddButtonHdl, Button*, void)
     catch ( uno::Exception& )
     {
         OSL_FAIL( "Exception while adding a signature!" );
+        ScopedVclPtrInstance<ErrorBox>(this, XsResId(STR_XMLSECDLG_SIGNING_FAILED))->Execute();
         // Don't keep invalid entries...
         ImplGetSignatureInformations(/*bUseTempStream=*/true, /*bCacheLastSignature=*/false);
         ImplFillSignaturesBox();
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
index 5409029f4033..b7867dd37a87 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
@@ -26,6 +26,7 @@
 #define STR_XMLSECDLG_OLD_ODF_FORMAT     RID_DIGITALSIGNATUREDLG_START
 #define STR_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN (RID_DIGITALSIGNATUREDLG_START + 1)
 #define STR_XMLSECDLG_QUERY_REALLYREMOVE (RID_DIGITALSIGNATUREDLG_START + 2)
+#define STR_XMLSECDLG_SIGNING_FAILED (RID_DIGITALSIGNATUREDLG_START + 3)
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
index 448d297d72e3..48f7cc3b478e 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
@@ -40,4 +40,10 @@ String STR_XMLSECDLG_QUERY_REALLYREMOVE
     Text [ en-US ] = "Document signature cannot be restored, once removed.\n"
         "Do you really want to remove selected signature?";
 };
+
+String STR_XMLSECDLG_SIGNING_FAILED
+{
+    Text [ en-US ] = "An error occured while adding the signature.";
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list