include/sfx2/viewfrm.hxx | 1 + sfx2/source/view/viewfrm.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+)
New commits: commit 61e4f8503c89e0933b294304320e371804b077c9 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Jul 25 15:48:37 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Jul 26 10:02:21 2022 +0200 Resolves: tdf#149127 explain the infobar asking to refresh master password Change-Id: Ia8439dd6f5dca91f008150ed759eef92fcc4b9a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137440 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx index 24d1c35dbe90..a7bb8bd7844c 100644 --- a/include/sfx2/viewfrm.hxx +++ b/include/sfx2/viewfrm.hxx @@ -69,6 +69,7 @@ class SFX2_DLLPUBLIC SfxViewFrame final : public SfxShell, public SfxListener DECL_DLLPRIVATE_LINK(HiddenTrackChangesHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(HyphenationMissingHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(RefreshMasterPasswordHdl, weld::Button&, void); + DECL_DLLPRIVATE_STATIC_LINK(SfxViewFrame, HelpMasterPasswordHdl, weld::Button&, void); SAL_DLLPRIVATE void KillDispatcher_Impl(); virtual ~SfxViewFrame() override; diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index da5477928f51..de3c32c50141 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -46,6 +46,7 @@ #include <svl/eitem.hxx> #include <svl/whiter.hxx> #include <svl/undo.hxx> +#include <vcl/help.hxx> #include <vcl/stdtext.hxx> #include <vcl/weld.hxx> #include <vcl/weldutils.hxx> @@ -1468,6 +1469,12 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) rButton.set_label(SfxResId(STR_REFRESH_PASSWORD)); rButton.connect_clicked(LINK(this, SfxViewFrame, RefreshMasterPasswordHdl)); + if (Application::GetHelp()) + { + weld::Button& rHelp = pOldMasterPasswordInfoBar->addButton(); + rHelp.set_label(SfxResId(RID_STR_HELP)); + rHelp.connect_clicked(LINK(this, SfxViewFrame, HelpMasterPasswordHdl)); + } } } @@ -1718,6 +1725,12 @@ IMPL_LINK_NOARG(SfxViewFrame, RefreshMasterPasswordHdl, weld::Button&, void) RemoveInfoBar(u"oldmasterpassword"); } +IMPL_STATIC_LINK_NOARG(SfxViewFrame, HelpMasterPasswordHdl, weld::Button&, void) +{ + if (Help* pHelp = Application::GetHelp()) + pHelp->Start("cui/ui/optsecuritypage/savepassword"); +} + void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) { m_pImpl->bResizeInToOut = true;