Kaydet (Commit) 9674704c authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

gpg4libre: Show error message when signing fails

Change-Id: I58f3febaaaaa225952e87ad3f092950ace37d15d
Reviewed-on: https://gerrit.libreoffice.org/39283Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst a08c833a
......@@ -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 );
......
......@@ -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 )
......
......@@ -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();
......
......@@ -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: */
......@@ -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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment