diff options
-rw-r--r-- | include/sfx2/sfx.hrc | 2 | ||||
-rw-r--r-- | sfx2/source/view/view.src | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 27 |
3 files changed, 36 insertions, 3 deletions
diff --git a/include/sfx2/sfx.hrc b/include/sfx2/sfx.hrc index 25e8355829f6..2cd1da9c40c4 100644 --- a/include/sfx2/sfx.hrc +++ b/include/sfx2/sfx.hrc @@ -122,6 +122,8 @@ #define STR_READONLY_PDF (RID_SFX_START+138) #define STR_SIGNATURE_BROKEN (RID_SFX_START+139) #define STR_SIGNATURE_SHOW (RID_SFX_START+140) +#define STR_SIGNATURE_NOTVALIDATED (RID_SFX_START+141) +#define STR_SIGNATURE_PARTIAL_OK (RID_SFX_START+142) #define STR_ACCTITLE_PRODUCTIVITYTOOLS (RID_SFX_START+157) #define SFX_THUMBNAIL_TEXT (RID_SFX_START+158) 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()); |