diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-01-31 09:07:14 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-01-31 12:21:48 +0000 |
commit | 2dff5e856ab343b1296f63d645c47382493fe2fe (patch) | |
tree | 6b548f9aebff0f48f276372a1dc03ed59e38df51 /sfx2/source/view | |
parent | 95db32acabaae2a1d32874ecb8429e828c52a7ae (diff) |
tdf#105566 Show InfoBar when signature is invalid
gpg4libre
Change-Id: I272ac155889e25b9af91ff723a014588a65b045a
Reviewed-on: https://gerrit.libreoffice.org/33737
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r-- | sfx2/source/view/view.src | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sfx2/source/view/view.src b/sfx2/source/view/view.src index 0826609e5339..56b7fbaf91fc 100644 --- a/sfx2/source/view/view.src +++ b/sfx2/source/view/view.src @@ -140,4 +140,14 @@ String STR_READONLY_SIGN Text[ en-US ] = "Sign Document"; }; +String STR_SIGNATURE_BROKEN +{ + Text[ en-US ] = "Document has an invalid signature."; +}; + +String STR_SIGNATURE_SHOW +{ + Text[ en-US ] = "Show signatures"; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 42a259abaa95..ffa0d419e6aa 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1178,6 +1178,18 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) SfxBindings& rBind = GetBindings(); rBind.Invalidate( SID_RELOAD ); rBind.Invalidate( SID_EDITDOC ); + + SignatureState nSignatureState = GetObjectShell()->GetDocumentSignatureState(); + if (nSignatureState == SignatureState::BROKEN) { + basegfx::BColor aBackgroundColor = basegfx::BColor(0.5, 0.0, 0.0); + auto pInfoBar = AppendInfoBar("signature", SfxResId(STR_SIGNATURE_BROKEN), &aBackgroundColor); + VclPtrInstance<PushButton> xBtn(&GetWindow()); + xBtn->SetText(SfxResId(STR_SIGNATURE_SHOW)); + xBtn->SetSizePixel(xBtn->GetOptimalSize()); + xBtn->SetClickHdl(LINK(this, SfxViewFrame, SignDocumentHandler)); + pInfoBar->addButton(xBtn); + } + const SfxViewShell *pVSh; const SfxShell *pFSh; if ( !m_xObjSh->IsReadOnly() || |