summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-10 20:08:11 +0000
committerMichael Stahl <michael.stahl@cib.de>2020-01-13 19:10:15 +0100
commit6b3e268c9d21b911f14bab8ef95f69cf171a137c (patch)
tree8ea5945480ddd3a829f7cb95edb6a13246cfdb38
parentUpdate git submodules (diff)
downloadcore-6b3e268c9d21b911f14bab8ef95f69cf171a137c.tar.gz
core-6b3e268c9d21b911f14bab8ef95f69cf171a137c.zip
Resolves: tdf#129904 use the current page as the page for help
in the options dialog which has a non-standard organization for its contents vs an ordinary dialog Change-Id: I6a50652f5ae3fe2e8b4d32933bec6dc0217cbec1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86577 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit 52ac526a61c1a26bb9dbf995f4af02c9469b8cf6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86663 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--cui/source/inc/treeopt.hxx1
-rw-r--r--cui/source/options/treeopt.cxx17
2 files changed, 18 insertions, 0 deletions
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index aa6f7f5b0a02..6344c23cd96b 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -163,6 +163,7 @@ private:
DECL_LINK(BackHdl_Impl, weld::Button&, void);
DECL_LINK(ApplyHdl_Impl, weld::Button&, void);
DECL_LINK(OKHdl_Impl, weld::Button&, void);
+ DECL_LINK(HelpHdl_Impl, weld::Widget&, bool);
void SelectHdl_Impl();
virtual short run() override;
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index f36a8ab76029..c3005688e297 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -683,6 +683,22 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, ApplyHdl_Impl, weld::Button&, void)
}
}
+IMPL_LINK_NOARG(OfaTreeOptionsDialog, HelpHdl_Impl, weld::Widget&, bool)
+{
+ Help* pHelp = Application::GetHelp();
+ if (pHelp && xCurrentPageEntry && xTreeLB->get_iter_depth(*xCurrentPageEntry))
+ {
+ OptionsPageInfo* pPageInfo = reinterpret_cast<OptionsPageInfo*>(xTreeLB->get_id(*xCurrentPageEntry).toInt64());
+ if (pPageInfo->m_xPage)
+ {
+ OString sHelpId(pPageInfo->m_xPage->GetHelpId());
+ pHelp->Start(OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), m_xDialog.get());
+ return false;
+ }
+ }
+ return true;
+}
+
IMPL_LINK_NOARG(OfaTreeOptionsDialog, OKHdl_Impl, weld::Button&, void)
{
if (xCurrentPageEntry && xTreeLB->get_iter_depth(*xCurrentPageEntry))
@@ -748,6 +764,7 @@ void OfaTreeOptionsDialog::InitTreeAndHandler()
xBackPB->connect_clicked( LINK( this, OfaTreeOptionsDialog, BackHdl_Impl ) );
xApplyPB->connect_clicked( LINK( this, OfaTreeOptionsDialog, ApplyHdl_Impl ) );
xOkPB->connect_clicked( LINK( this, OfaTreeOptionsDialog, OKHdl_Impl ) );
+ m_xDialog->connect_help( LINK( this, OfaTreeOptionsDialog, HelpHdl_Impl ) );
}
void OfaTreeOptionsDialog::ActivatePage( sal_uInt16 nResId )