summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-01-31 10:47:47 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-01-31 12:42:27 +0000
commit2499ecc4050a308dd52df0ca32e2d97dff9e40df (patch)
treed22b6228d6addbf2554360efb34777c90f7d9ab5 /sfx2
parent0cd819b68ced2a95a127a246c0558153fbdbcae2 (diff)
tdf#105566 Show InfoBar also for signed docs with warnings
gpg4libre Change-Id: Ia3df9d9d8121539fd1c6b77f8872287b0b432d8e Reviewed-on: https://gerrit.libreoffice.org/33744 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/view.src10
-rw-r--r--sfx2/source/view/viewfrm.cxx27
2 files changed, 34 insertions, 3 deletions
diff --git a/sfx2/source/view/view.src b/sfx2/source/view/view.src
index 56b7fbaf91fc..9507e0b03e8d 100644
--- a/sfx2/source/view/view.src
+++ b/sfx2/source/view/view.src
@@ -145,6 +145,16 @@ String STR_SIGNATURE_BROKEN
Text[ en-US ] = "Document has an invalid signature.";
};
+String STR_SIGNATURE_NOTVALIDATED
+{
+ Text[ en-US ] = "Signature is ok, but the certificate could not be validated.";
+};
+
+String STR_SIGNATURE_PARTIAL_OK
+{
+ Text[ en-US ] = "Signature is ok, but the document is only partially signed.";
+};
+
String STR_SIGNATURE_SHOW
{
Text[ en-US ] = "Show signatures";
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index a7f1d6a85448..dd6e317f814f 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1180,9 +1180,30 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
rBind.Invalidate( SID_EDITDOC );
SignatureState nSignatureState = GetObjectShell()->GetDocumentSignatureState();
- if (nSignatureState == SignatureState::BROKEN) {
- basegfx::BColor aBackgroundColor = SfxInfoBarWindow::getWarningColor();
- auto pInfoBar = AppendInfoBar("signature", SfxResId(STR_SIGNATURE_BROKEN), &aBackgroundColor);
+ basegfx::BColor aBackgroundColor;
+ OUString sMessage("");
+
+ switch (nSignatureState)
+ {
+ case SignatureState::BROKEN:
+ sMessage = SfxResId(STR_SIGNATURE_BROKEN);
+ aBackgroundColor = SfxInfoBarWindow::getDangerColor();
+ break;
+ case SignatureState::NOTVALIDATED:
+ sMessage = SfxResId(STR_SIGNATURE_NOTVALIDATED);
+ aBackgroundColor = SfxInfoBarWindow::getWarningColor();
+ break;
+ case SignatureState::PARTIAL_OK:
+ sMessage = SfxResId(STR_SIGNATURE_PARTIAL_OK);
+ aBackgroundColor = SfxInfoBarWindow::getWarningColor();
+ break;
+ default:
+ break;
+ }
+
+ if (!sMessage.isEmpty())
+ {
+ auto pInfoBar = AppendInfoBar("signature", sMessage, &aBackgroundColor);
VclPtrInstance<PushButton> xBtn(&GetWindow());
xBtn->SetText(SfxResId(STR_SIGNATURE_SHOW));
xBtn->SetSizePixel(xBtn->GetOptimalSize());